Class DefaultMappingManager
java.lang.Object
org.apache.syncope.core.provisioning.java.DefaultMappingManager
- All Implemented Interfaces:
MappingManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnyObjectDAO
protected final AnyTypeDAO
protected final DerAttrHandler
protected final EncryptorManager
protected final GroupDAO
protected final ImplementationDAO
protected final IntAttrNameParser
protected static final Logger
protected final RealmSearchDAO
protected final RelationshipTypeDAO
protected final UserDAO
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultMappingManager
(AnyTypeDAO anyTypeDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, GroupDAO groupDAO, RelationshipTypeDAO relationshipTypeDAO, RealmSearchDAO realmSearchDAO, ImplementationDAO implementationDAO, DerAttrHandler derAttrHandler, IntAttrNameParser intAttrNameParser, EncryptorManager encryptorManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected static PlainAttrValue
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.getConnObjectKeyValue
(Any any, ExternalResource resource, Provision provision) Get connObjectKey internal value.getConnObjectKeyValue
(Realm realm, ExternalResource resource) Get connObjectKey internal value.protected String
getGroupOwnerValue
(ExternalResource resource, Provision provision, Any any) getIntValues
(ExternalResource resource, Item item, IntAttrName intAttrName, AttrSchemaType schemaType, Realm realm) Get attribute values for the givenItem
and realm.getIntValues
(ExternalResource resource, Provision provision, Item item, 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, Item item, Realm realm) Prepare attribute for sending to a connector instance.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, ExternalResource resource) Prepare attributes for sending to a connector instance.void
setIntValues
(Item item, 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
-
anyTypeDAO
-
userDAO
-
anyObjectDAO
-
groupDAO
-
relationshipTypeDAO
-
realmSearchDAO
-
implementationDAO
-
derAttrHandler
-
intAttrNameParser
-
encryptorManager
-
-
Constructor Details
-
DefaultMappingManager
public DefaultMappingManager(AnyTypeDAO anyTypeDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, GroupDAO groupDAO, RelationshipTypeDAO relationshipTypeDAO, RealmSearchDAO realmSearchDAO, ImplementationDAO implementationDAO, DerAttrHandler derAttrHandler, IntAttrNameParser intAttrNameParser, EncryptorManager encryptorManager)
-
-
Method Details
-
processPreparedAttr
-
getName
-
clonePlainAttrValue
-
getTransformers
-
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
-
prepareAttrsFromRealm
Description copied from interface:MappingManager
Prepare attributes for sending to a connector instance.- Specified by:
prepareAttrsFromRealm
in interfaceMappingManager
- Parameters:
realm
- Realmresource
- resource 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
-
prepareAttr
Description copied from interface:MappingManager
Prepare attribute for sending to a connector instance.- Specified by:
prepareAttr
in interfaceMappingManager
- Parameters:
resource
- resource informationitem
- mapping itemrealm
- given realm- Returns:
- connObjectLink (if it is the case) + prepared attribute
-
getIntValues
@Transactional(readOnly=true) public Pair<AttrSchemaType,List<PlainAttrValue>> getIntValues(ExternalResource resource, Provision provision, Item item, 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 informationitem
- 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
-
getIntValues
@Transactional(readOnly=true) public Pair<AttrSchemaType,List<PlainAttrValue>> getIntValues(ExternalResource resource, Item item, IntAttrName intAttrName, AttrSchemaType schemaType, Realm realm) Description copied from interface:MappingManager
Get attribute values for the givenItem
and realm.- Specified by:
getIntValues
in interfaceMappingManager
- Parameters:
resource
- resource informationitem
- mapping itemintAttrName
- int attr nameschemaType
- schema typerealm
- realm- 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, ExternalResource resource) Description copied from interface:MappingManager
Get connObjectKey internal value.- Specified by:
getConnObjectKeyValue
in interfaceMappingManager
- Parameters:
realm
- realmresource
- resource 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:
item
- 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
-