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 theUserMapperServiceinterface.- Since:
- 7.4
- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected List<UserMapperDescriptor>descriptorsprotected static Loglogstatic StringMAPPER_EPprotected 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 voiddeactivate(ComponentContext context)Deactivates the component.Set<String>getAvailableMappings()Gives access to the contributed Mapping namesUserMappergetMapper(String mappingName)returns the named mapper is anyNuxeoPrincipalgetOrCreateAndUpdateNuxeoPrincipal(String mappingName, Object userObject)Should retrieve (create if needed) and update the NuxeoPrincipal according to the given userObjectNuxeoPrincipalgetOrCreateAndUpdateNuxeoPrincipal(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 userObjectvoidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidstart(ComponentContext context)Start the component.voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)ObjectwrapNuxeoPrincipal(String mappingName, NuxeoPrincipal principal, Object nativePrincipal, Map<String,Serializable> params)Wrap theNuxeoPrincipalas 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:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
getMapper
public UserMapper getMapper(String mappingName) throws NuxeoException
Description copied from interface:UserMapperServicereturns the named mapper is any- Specified by:
getMapperin interfaceUserMapperService- Throws:
NuxeoException
-
getOrCreateAndUpdateNuxeoPrincipal
public NuxeoPrincipal getOrCreateAndUpdateNuxeoPrincipal(String mappingName, Object userObject) throws NuxeoException
Description copied from interface:UserMapperServiceShould retrieve (create if needed) and update the NuxeoPrincipal according to the given userObject- Specified by:
getOrCreateAndUpdateNuxeoPrincipalin 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:UserMapperServiceShould retrieve (create if needed) and update the NuxeoPrincipal according to the given userObject- Specified by:
getOrCreateAndUpdateNuxeoPrincipalin 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:UserMapperServiceWrap theNuxeoPrincipalas the userObject used in the external authentication system *- Specified by:
wrapNuxeoPrincipalin interfaceUserMapperService- Parameters:
mappingName- the name of the contributed mapping to useprincipal- theNuxeoPrincipalto wrapnativePrincipal- the principal Object in the target system (can be null)- Throws:
NuxeoException
-
getAvailableMappings
public Set<String> getAvailableMappings()
Description copied from interface:UserMapperServiceGives access to the contributed Mapping names- Specified by:
getAvailableMappingsin interfaceUserMapperService
-
-