Package org.nuxeo.usermapper.service
Class UserMapperComponent
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.usermapper.service.UserMapperComponent
-
- All Implemented Interfaces:
Adaptable
,Component
,Extensible
,TimestampedService
,UserMapperService
public class UserMapperComponent extends DefaultComponent implements UserMapperService
Component to manage extension point and expose theUserMapperService
interface.- Since:
- 7.4
- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected List<UserMapperDescriptor>
descriptors
protected static Log
log
static String
MAPPER_EP
protected Map<String,UserMapper>
mappers
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description UserMapperComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deactivate(ComponentContext context)
Deactivates the component.Set<String>
getAvailableMappings()
Gives access to the contributed Mapping namesUserMapper
getMapper(String mappingName)
returns the named mapper is anyNuxeoPrincipal
getOrCreateAndUpdateNuxeoPrincipal(String mappingName, Object userObject)
Should retrieve (create if needed) and update the NuxeoPrincipal according to the given userObjectNuxeoPrincipal
getOrCreateAndUpdateNuxeoPrincipal(String mappingName, Object userObject, boolean createIfNeeded, boolean update, Map<String,Serializable> params)
Should retrieve (create if needed) and update the NuxeoPrincipal according to the given userObjectvoid
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
start(ComponentContext context)
Start the component.void
unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
Object
wrapNuxeoPrincipal(String mappingName, NuxeoPrincipal principal, Object nativePrincipal, Map<String,Serializable> params)
Wrap theNuxeoPrincipal
as the userObject used in the external authentication system *-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
log
protected static final Log log
-
mappers
protected Map<String,UserMapper> mappers
-
descriptors
protected List<UserMapperDescriptor> descriptors
-
MAPPER_EP
public static final String MAPPER_EP
- See Also:
- Constant Field Values
-
-
Method Detail
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
start
public void start(ComponentContext context)
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
getMapper
public UserMapper getMapper(String mappingName) throws NuxeoException
Description copied from interface:UserMapperService
returns the named mapper is any- Specified by:
getMapper
in interfaceUserMapperService
- Throws:
NuxeoException
-
getOrCreateAndUpdateNuxeoPrincipal
public NuxeoPrincipal getOrCreateAndUpdateNuxeoPrincipal(String mappingName, Object userObject) throws NuxeoException
Description copied from interface:UserMapperService
Should retrieve (create if needed) and update the NuxeoPrincipal according to the given userObject- Specified by:
getOrCreateAndUpdateNuxeoPrincipal
in interfaceUserMapperService
- Parameters:
mappingName
- the name of the contributed mapping to useuserObject
- the native userObject- Returns:
- the matching
NuxeoPrincipal
- Throws:
NuxeoException
-
getOrCreateAndUpdateNuxeoPrincipal
public NuxeoPrincipal getOrCreateAndUpdateNuxeoPrincipal(String mappingName, Object userObject, boolean createIfNeeded, boolean update, Map<String,Serializable> params) throws NuxeoException
Description copied from interface:UserMapperService
Should retrieve (create if needed) and update the NuxeoPrincipal according to the given userObject- Specified by:
getOrCreateAndUpdateNuxeoPrincipal
in interfaceUserMapperService
- Parameters:
mappingName
- the name of the contributed mapping to useuserObject
- the native userObjectcreateIfNeeded
- flag to allow creation (default is true)update
- flag to run update (default is true)- Returns:
- the matching
NuxeoPrincipal
- Throws:
NuxeoException
-
wrapNuxeoPrincipal
public Object wrapNuxeoPrincipal(String mappingName, NuxeoPrincipal principal, Object nativePrincipal, Map<String,Serializable> params) throws NuxeoException
Description copied from interface:UserMapperService
Wrap theNuxeoPrincipal
as the userObject used in the external authentication system *- Specified by:
wrapNuxeoPrincipal
in interfaceUserMapperService
- Parameters:
mappingName
- the name of the contributed mapping to useprincipal
- theNuxeoPrincipal
to wrapnativePrincipal
- the principal Object in the target system (can be null)- Throws:
NuxeoException
-
getAvailableMappings
public Set<String> getAvailableMappings()
Description copied from interface:UserMapperService
Gives access to the contributed Mapping names- Specified by:
getAvailableMappings
in interfaceUserMapperService
-
-