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 AnyObjectDAO
anyObjectDAO
protected AnyTypeDAO
anyTypeDAO
protected AnyUtilsFactory
anyUtilsFactory
protected ApplicationDAO
applicationDAO
protected DerAttrHandler
derAttrHandler
protected static Encryptor
ENCRYPTOR
protected GroupDAO
groupDAO
protected ImplementationDAO
implementationDAO
protected IntAttrNameParser
intAttrNameParser
protected static Logger
LOG
protected RealmDAO
realmDAO
protected RelationshipTypeDAO
relationshipTypeDAO
protected UserDAO
userDAO
protected VirAttrCache
virAttrCache
protected VirAttrHandler
virAttrHandler
-
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 String
decodePassword(Account account)
protected Name
evaluateNAME(Any<?> any, Provision provision, String connObjectKey)
Build __NAME__ for propagation.protected Name
evaluateNAME(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 String
getGroupOwnerValue(ExternalResource resource, Provision provision, Any<?> any)
protected String
getIntValue(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 givenItem
and any object.protected static Name
getName(String evalConnObjectLink, String connObjectKey)
protected String
getPasswordAttrValue(Account account, String defaultValue)
protected List<Implementation>
getTransformers(Item item)
boolean
hasMustChangePassword(Provision provision)
Checks if there is a mapping item in the givenProvision
formustChangePassword
.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 String
processPreparedAttr(Pair<String,Attribute> preparedAttr, Set<Attribute> attributes)
void
setIntValues(Item mapItem, Attribute attr, AnyTO anyTO)
Set attribute values, according to the givenItem
, to any object from attribute received from connector.void
setIntValues(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:MappingManager
Prepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromAny
in 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:MappingManager
Prepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromLinkedAccount
in 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:MappingManager
Prepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromRealm
in 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:MappingManager
Prepare attribute for sending to a connector instance.- Specified by:
prepareAttr
in 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:MappingManager
Get attribute values for the givenItem
and any object.- Specified by:
getIntValues
in 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:MappingManager
Get connObjectKey internal value.- Specified by:
getConnObjectKeyValue
in 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:MappingManager
Get connObjectKey internal value.- Specified by:
getConnObjectKeyValue
in 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:MappingManager
Set attribute values, according to the givenItem
, to any object from attribute received from connector.- Specified by:
setIntValues
in 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:MappingManager
Set attribute values, according to the givenItem
, to realm from attribute received from connector.- Specified by:
setIntValues
in interfaceMappingManager
- Parameters:
item
- mapping itemattr
- attribute received from connectorrealmTO
- realm
-
hasMustChangePassword
@Transactional(readOnly=true) public boolean hasMustChangePassword(Provision provision)
Description copied from interface:MappingManager
Checks if there is a mapping item in the givenProvision
formustChangePassword
.- Specified by:
hasMustChangePassword
in interfaceMappingManager
- Parameters:
provision
- provision- Returns:
- if there is a mapping item in the given provision for
mustChangePassword
-
-