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
Component to manage extension point and expose the
UserMapperService
interface.- Since:
- 7.4
- Author:
- tiry
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<UserMapperDescriptor>
static final String
protected Map<String,
UserMapper> Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deactivate
(ComponentContext context) Deactivates the component.Gives access to the contributed Mapping namesreturns the named mapper is anygetOrCreateAndUpdateNuxeoPrincipal
(String mappingName, Object userObject) Should retrieve (create if needed) and update the NuxeoPrincipal according to the given userObjectgetOrCreateAndUpdateNuxeoPrincipal
(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) 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
getApplicationStartedOrder
-
Field Details
-
mappers
-
descriptors
-
MAPPER_EP
- See Also:
-
-
Constructor Details
-
UserMapperComponent
public UserMapperComponent()
-
-
Method Details
-
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
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
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
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 NuxeoExceptionDescription 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 NuxeoExceptionDescription 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
Description copied from interface:UserMapperService
Gives access to the contributed Mapping names- Specified by:
getAvailableMappings
in interfaceUserMapperService
-