Class DefaultMappingManager
java.lang.Object
org.apache.syncope.core.provisioning.java.DefaultMappingManager
- All Implemented Interfaces:
MappingManager
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AnyObjectDAO
protected final AnyTypeDAO
protected final AnyUtilsFactory
protected final ApplicationDAO
protected final DerAttrHandler
protected static final Encryptor
protected final GroupDAO
protected final ImplementationDAO
protected final IntAttrNameParser
protected static final Logger
protected final RealmSearchDAO
protected final RelationshipTypeDAO
protected final UserDAO
protected final javax.cache.Cache
<VirAttrCacheKey, VirAttrCacheValue> protected final VirAttrHandler
-
Constructor Summary
ConstructorDescriptionDefaultMappingManager
(AnyTypeDAO anyTypeDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, GroupDAO groupDAO, RelationshipTypeDAO relationshipTypeDAO, RealmSearchDAO realmSearchDAO, ApplicationDAO applicationDAO, ImplementationDAO implementationDAO, DerAttrHandler derAttrHandler, VirAttrHandler virAttrHandler, javax.cache.Cache<VirAttrCacheKey, VirAttrCacheValue> virAttrCache, AnyUtilsFactory anyUtilsFactory, IntAttrNameParser intAttrNameParser) -
Method Summary
Modifier and TypeMethodDescriptiondecodePassword
(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.getConnObjectKeyValue
(Any<?> any, ExternalResource resource, Provision provision) Get connObjectKey internal value.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) 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
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
.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.prepareAttrsFromAny
(Any<?> any, String password, boolean changePwd, Boolean enable, ExternalResource resource, Provision provision) Prepare attributes for sending to a connector instance.prepareAttrsFromLinkedAccount
(User user, LinkedAccount account, String password, boolean changePwd, Provision provision) Prepare attributes for sending to a connector instance.prepareAttrsFromRealm
(Realm realm, OrgUnit orgUnit) Prepare attributes for sending to a connector instance.protected String
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 Details
-
LOG
-
ENCRYPTOR
-
anyTypeDAO
-
userDAO
-
anyObjectDAO
-
groupDAO
-
relationshipTypeDAO
-
realmSearchDAO
-
applicationDAO
-
implementationDAO
-
derAttrHandler
-
virAttrHandler
-
virAttrCache
-
anyUtilsFactory
-
intAttrNameParser
-
-
Constructor Details
-
DefaultMappingManager
public DefaultMappingManager(AnyTypeDAO anyTypeDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, GroupDAO groupDAO, RelationshipTypeDAO relationshipTypeDAO, RealmSearchDAO realmSearchDAO, ApplicationDAO applicationDAO, ImplementationDAO implementationDAO, DerAttrHandler derAttrHandler, VirAttrHandler virAttrHandler, javax.cache.Cache<VirAttrCacheKey, VirAttrCacheValue> virAttrCache, AnyUtilsFactory anyUtilsFactory, IntAttrNameParser intAttrNameParser)
-
-
Method Details
-
getTransformers
-
processPreparedAttr
-
getName
-
evaluateNAME
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
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
-
getIntValue
-
prepareAttrsFromRealm
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
-
decodePassword
-
getPasswordAttrValue
-
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
-
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
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
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
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
-