Class DefaultMappingManager
- java.lang.Object
-
- org.apache.syncope.core.provisioning.java.DefaultMappingManager
-
- All Implemented Interfaces:
MappingManager
public class DefaultMappingManager extends Object implements MappingManager
-
-
Field Summary
Fields Modifier and Type Field Description protected AnyObjectDAOanyObjectDAOprotected AnyTypeDAOanyTypeDAOprotected AnyUtilsFactoryanyUtilsFactoryprotected ApplicationDAOapplicationDAOprotected DerAttrHandlerderAttrHandlerprotected static EncryptorENCRYPTORprotected GroupDAOgroupDAOprotected ImplementationDAOimplementationDAOprotected IntAttrNameParserintAttrNameParserprotected static LoggerLOGprotected RealmDAOrealmDAOprotected RelationshipTypeDAOrelationshipTypeDAOprotected UserDAOuserDAOprotected VirAttrCachevirAttrCacheprotected VirAttrHandlervirAttrHandler
-
Constructor Summary
Constructors Constructor Description DefaultMappingManager(AnyTypeDAO anyTypeDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, GroupDAO groupDAO, RelationshipTypeDAO relationshipTypeDAO, RealmDAO realmDAO, ApplicationDAO applicationDAO, ImplementationDAO implementationDAO, DerAttrHandler derAttrHandler, VirAttrHandler virAttrHandler, VirAttrCache virAttrCache, AnyUtilsFactory anyUtilsFactory, IntAttrNameParser intAttrNameParser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringdecodePassword(Account account)protected NameevaluateNAME(Any<?> any, Provision provision, String connObjectKey)Build __NAME__ for propagation.protected NameevaluateNAME(Realm realm, OrgUnit orgUnit, String connObjectKey)Build __NAME__ for propagation.Optional<String>getConnObjectKeyValue(Any<?> any, ExternalResource resource, Provision provision)Get connObjectKey internal value.Optional<String>getConnObjectKeyValue(Realm realm, OrgUnit orgUnit)Get connObjectKey internal value.protected StringgetGroupOwnerValue(ExternalResource resource, Provision provision, Any<?> any)protected StringgetIntValue(Realm realm, Item orgUnitItem)Pair<AttrSchemaType,List<PlainAttrValue>>getIntValues(ExternalResource resource, Provision provision, Item mapItem, IntAttrName intAttrName, AttrSchemaType schemaType, Any<?> any, AccountGetter usernameAccountGetter, PlainAttrGetter plainAttrGetter)Get attribute values for the givenItemand any object.protected static NamegetName(String evalConnObjectLink, String connObjectKey)protected StringgetPasswordAttrValue(Account account, String defaultValue)protected List<Implementation>getTransformers(Item item)booleanhasMustChangePassword(Provision provision)Checks if there is a mapping item in the givenProvisionformustChangePassword.Pair<String,Attribute>prepareAttr(ExternalResource resource, Provision provision, Item item, Any<?> any, String password, AccountGetter usernameAccountGetter, AccountGetter passwordAccountGetter, PlainAttrGetter plainAttrGetter)Prepare attribute for sending to a connector instance.Pair<String,Set<Attribute>>prepareAttrsFromAny(Any<?> any, String password, boolean changePwd, Boolean enable, ExternalResource resource, Provision provision)Prepare attributes for sending to a connector instance.Set<Attribute>prepareAttrsFromLinkedAccount(User user, LinkedAccount account, String password, boolean changePwd, Provision provision)Prepare attributes for sending to a connector instance.Pair<String,Set<Attribute>>prepareAttrsFromRealm(Realm realm, OrgUnit orgUnit)Prepare attributes for sending to a connector instance.protected StringprocessPreparedAttr(Pair<String,Attribute> preparedAttr, Set<Attribute> attributes)voidsetIntValues(Item mapItem, Attribute attr, AnyTO anyTO)Set attribute values, according to the givenItem, to any object from attribute received from connector.voidsetIntValues(Item item, Attribute attr, RealmTO realmTO)Set attribute values, according to the givenItem, to realm from attribute received from connector.
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
ENCRYPTOR
protected static final Encryptor ENCRYPTOR
-
anyTypeDAO
protected final AnyTypeDAO anyTypeDAO
-
userDAO
protected final UserDAO userDAO
-
anyObjectDAO
protected final AnyObjectDAO anyObjectDAO
-
groupDAO
protected final GroupDAO groupDAO
-
relationshipTypeDAO
protected final RelationshipTypeDAO relationshipTypeDAO
-
realmDAO
protected final RealmDAO realmDAO
-
applicationDAO
protected final ApplicationDAO applicationDAO
-
implementationDAO
protected final ImplementationDAO implementationDAO
-
derAttrHandler
protected final DerAttrHandler derAttrHandler
-
virAttrHandler
protected final VirAttrHandler virAttrHandler
-
virAttrCache
protected final VirAttrCache virAttrCache
-
anyUtilsFactory
protected final AnyUtilsFactory anyUtilsFactory
-
intAttrNameParser
protected final IntAttrNameParser intAttrNameParser
-
-
Constructor Detail
-
DefaultMappingManager
public DefaultMappingManager(AnyTypeDAO anyTypeDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, GroupDAO groupDAO, RelationshipTypeDAO relationshipTypeDAO, RealmDAO realmDAO, ApplicationDAO applicationDAO, ImplementationDAO implementationDAO, DerAttrHandler derAttrHandler, VirAttrHandler virAttrHandler, VirAttrCache virAttrCache, AnyUtilsFactory anyUtilsFactory, IntAttrNameParser intAttrNameParser)
-
-
Method Detail
-
getTransformers
protected List<Implementation> getTransformers(Item item)
-
processPreparedAttr
protected String processPreparedAttr(Pair<String,Attribute> preparedAttr, Set<Attribute> attributes)
-
evaluateNAME
protected Name evaluateNAME(Any<?> any, Provision provision, String connObjectKey)
Build __NAME__ for propagation. First look if there is a defined connObjectLink for the given resource (and in this case evaluate as JEXL); otherwise, take given connObjectKey.- Parameters:
any- given any objectprovision- external resourceconnObjectKey- connector object key- Returns:
- the value to be propagated as __NAME__
-
evaluateNAME
protected Name evaluateNAME(Realm realm, OrgUnit orgUnit, String connObjectKey)
Build __NAME__ for propagation. First look if there is a defined connObjectLink for the given resource (and in this case evaluate as JEXL); otherwise, take given connObjectKey.- Parameters:
realm- given any objectorgUnit- external resourceconnObjectKey- connector object key- Returns:
- the value to be propagated as __NAME__
-
prepareAttrsFromAny
@Transactional(readOnly=true) public Pair<String,Set<Attribute>> prepareAttrsFromAny(Any<?> any, String password, boolean changePwd, Boolean enable, ExternalResource resource, Provision provision)
Description copied from interface:MappingManagerPrepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromAnyin interfaceMappingManager- Parameters:
any- given any objectpassword- clear-text passwordchangePwd- whether password should be included for propagation attributes or notenable- whether any object must be enabled or notresource- resource informationprovision- provision information- Returns:
- connObjectLink + prepared attributes
-
prepareAttrsFromLinkedAccount
@Transactional(readOnly=true) public Set<Attribute> prepareAttrsFromLinkedAccount(User user, LinkedAccount account, String password, boolean changePwd, Provision provision)
Description copied from interface:MappingManagerPrepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromLinkedAccountin interfaceMappingManager- Parameters:
user- given useraccount- linked accountpassword- user's clear-text password, to use as default value in casechangePwd- whether password should be included for propagation attributes or notprovision- provision information- Returns:
- prepared attributes
-
prepareAttrsFromRealm
public Pair<String,Set<Attribute>> prepareAttrsFromRealm(Realm realm, OrgUnit orgUnit)
Description copied from interface:MappingManagerPrepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromRealmin interfaceMappingManager- Parameters:
realm- RealmorgUnit- provision information- Returns:
- connObjectLink + prepared attributes
-
prepareAttr
public Pair<String,Attribute> prepareAttr(ExternalResource resource, Provision provision, Item item, Any<?> any, String password, AccountGetter usernameAccountGetter, AccountGetter passwordAccountGetter, PlainAttrGetter plainAttrGetter)
Description copied from interface:MappingManagerPrepare attribute for sending to a connector instance.- Specified by:
prepareAttrin interfaceMappingManager- Parameters:
resource- resource informationprovision- provision informationitem- mapping itemany- given any objectpassword- clear-text passwordusernameAccountGetter- function to get actual account instance for usernamepasswordAccountGetter- function to get actual account instance for passwordplainAttrGetter- function to get PlainAttr instances- Returns:
- connObjectLink (if it is the case) + prepared attribute
-
getIntValues
@Transactional(readOnly=true) public Pair<AttrSchemaType,List<PlainAttrValue>> getIntValues(ExternalResource resource, Provision provision, Item mapItem, IntAttrName intAttrName, AttrSchemaType schemaType, Any<?> any, AccountGetter usernameAccountGetter, PlainAttrGetter plainAttrGetter)
Description copied from interface:MappingManagerGet attribute values for the givenItemand any object.- Specified by:
getIntValuesin interfaceMappingManager- Parameters:
resource- resource informationprovision- provision informationmapItem- mapping itemintAttrName- int attr nameschemaType- schema typeany- any objectusernameAccountGetter- function to get actual account instance for usernameplainAttrGetter- function to get PlainAttr instances- Returns:
- attribute values and their type
-
getGroupOwnerValue
protected String getGroupOwnerValue(ExternalResource resource, Provision provision, Any<?> any)
-
getConnObjectKeyValue
@Transactional(readOnly=true) public Optional<String> getConnObjectKeyValue(Any<?> any, ExternalResource resource, Provision provision)
Description copied from interface:MappingManagerGet connObjectKey internal value.- Specified by:
getConnObjectKeyValuein interfaceMappingManager- Parameters:
any- any objectresource- resource informationprovision- provision information- Returns:
- connObjectKey internal value
-
getConnObjectKeyValue
@Transactional(readOnly=true) public Optional<String> getConnObjectKeyValue(Realm realm, OrgUnit orgUnit)
Description copied from interface:MappingManagerGet connObjectKey internal value.- Specified by:
getConnObjectKeyValuein interfaceMappingManager- Parameters:
realm- realmorgUnit- orgUnit information- Returns:
- connObjectKey internal value
-
setIntValues
@Transactional(readOnly=true) public void setIntValues(Item mapItem, Attribute attr, AnyTO anyTO)
Description copied from interface:MappingManagerSet attribute values, according to the givenItem, to any object from attribute received from connector.- Specified by:
setIntValuesin interfaceMappingManager- Parameters:
mapItem- mapping itemattr- attribute received from connectoranyTO- any object
-
setIntValues
public void setIntValues(Item item, Attribute attr, RealmTO realmTO)
Description copied from interface:MappingManagerSet attribute values, according to the givenItem, to realm from attribute received from connector.- Specified by:
setIntValuesin interfaceMappingManager- Parameters:
item- mapping itemattr- attribute received from connectorrealmTO- realm
-
hasMustChangePassword
@Transactional(readOnly=true) public boolean hasMustChangePassword(Provision provision)
Description copied from interface:MappingManagerChecks if there is a mapping item in the givenProvisionformustChangePassword.- Specified by:
hasMustChangePasswordin interfaceMappingManager- Parameters:
provision- provision- Returns:
- if there is a mapping item in the given provision for
mustChangePassword
-
-