Class DefaultPropagationManager
java.lang.Object
org.apache.syncope.core.provisioning.java.propagation.DefaultPropagationManager
- All Implemented Interfaces:
PropagationManager
@Transactional(rollbackFor=java.lang.Throwable.class)
public class DefaultPropagationManager
extends Object
implements PropagationManager
Manage the data propagation to external resources.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnyUtilsFactory
protected final ConnObjectUtils
protected final DerAttrHandler
protected final EntityFactory
protected static final Logger
protected final MappingManager
protected final ExternalResourceDAO
protected final VirSchemaDAO
Fields inherited from interface org.apache.syncope.core.provisioning.api.propagation.PropagationManager
MANDATORY_MISSING_ATTR_NAME, MANDATORY_NULL_OR_EMPTY_ATTR_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPropagationManager
(VirSchemaDAO virSchemaDAO, ExternalResourceDAO resourceDAO, EntityFactory entityFactory, ConnObjectUtils connObjectUtils, MappingManager mappingManager, DerAttrHandler derAttrHandler, AnyUtilsFactory anyUtilsFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<PropagationTaskInfo> createTasks
(Any any, String password, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs) Create propagation tasks.createTasks
(Realm realm, PropagationByResource<String> propByRes, Collection<String> excludedResources) Create the needed tasks for the realm for each resource associated, unless inexcludedResources
.getCreateTasks
(AnyTypeKind kind, String key, Boolean enable, PropagationByResource<String> propByRes, Collection<Attr> vAttrs, Collection<String> excludedResources) Create the tasks for every associated resource, unless inexcludedResources
.protected List
<PropagationTaskInfo> getCreateTasks
(Any any, String password, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) getDeleteTasks
(AnyTypeKind kind, String key, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<String> excludedResources) Create the delete tasks from each resource associated, unless inexcludedResources
.protected List
<PropagationTaskInfo> getDeleteTasks
(Any any, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<String> excludedResources) getUpdateTasks
(AnyUR anyUR, AnyTypeKind kind, String key, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) Create the update tasks on each resource associated, unless inexcludedResources
.protected List
<PropagationTaskInfo> getUpdateTasks
(AnyUR anyUR, Any any, String password, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) getUserCreateTasks
(String key, String password, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) Create the user tasks for every associated resource, unless inexcludedResources
.getUserUpdateTasks
(UserWorkflowResult<Pair<UserUR, Boolean>> wfResult) Create the update tasks for the user on each resource associated; propagate password update only to requested resources.getUserUpdateTasks
(UserWorkflowResult<Pair<UserUR, Boolean>> wfResult, List<String> changePwdRes, Collection<String> excludedResources) Create the update tasks for the user on each resource associated, unless inexcludedResources
.protected boolean
Checks whether the given attribute shall be treated as an ordinary attribute or not, for purpose of building AttributeDelta instances.newTask
(DerAttrHandler derAttrHandler, Any any, ExternalResource resource, ResourceOperation operation, Provision provision, Stream<Item> mappingItems, Pair<String, Set<Attribute>> preparedAttrs) prepareAttrs
(AnyTypeKind kind, String key, String password, List<String> changePwdRes, Boolean enable, Collection<String> excludedResources) Prepare attributes for propagation.prepareAttrs
(Realm realm) Prepare attributes for propagation.setAttributeDeltas
(List<PropagationTaskInfo> tasks, Map<Pair<String, String>, Set<Attribute>> beforeAttrs) Enrich the provided tasks with attribute deltas.
-
Field Details
-
LOG
-
virSchemaDAO
-
resourceDAO
-
entityFactory
-
connObjectUtils
-
mappingManager
-
derAttrHandler
-
anyUtilsFactory
-
-
Constructor Details
-
DefaultPropagationManager
public DefaultPropagationManager(VirSchemaDAO virSchemaDAO, ExternalResourceDAO resourceDAO, EntityFactory entityFactory, ConnObjectUtils connObjectUtils, MappingManager mappingManager, DerAttrHandler derAttrHandler, AnyUtilsFactory anyUtilsFactory)
-
-
Method Details
-
getCreateTasks
public List<PropagationTaskInfo> getCreateTasks(AnyTypeKind kind, String key, Boolean enable, PropagationByResource<String> propByRes, Collection<Attr> vAttrs, Collection<String> excludedResources) Description copied from interface:PropagationManager
Create the tasks for every associated resource, unless inexcludedResources
.- Specified by:
getCreateTasks
in interfacePropagationManager
- Parameters:
kind
- any type kindkey
- any keyenable
- whether any should be enabled or notpropByRes
- operation to be performed per resourcevAttrs
- virtual attributes to be setexcludedResources
- external resources performing not to be considered for propagation- Returns:
- list of propagation tasks
-
getUserCreateTasks
public List<PropagationTaskInfo> getUserCreateTasks(String key, String password, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) Description copied from interface:PropagationManager
Create the user tasks for every associated resource, unless inexcludedResources
.- Specified by:
getUserCreateTasks
in interfacePropagationManager
- Parameters:
key
- user keypassword
- to be setenable
- whether user must be enabled or notpropByRes
- operation to be performed per resourcepropByLinkedAccount
- operation to be performed for linked accountsvAttrs
- virtual attributes to be setexcludedResources
- external resources not to be considered for propagation- Returns:
- list of propagation tasks
-
getCreateTasks
protected List<PropagationTaskInfo> getCreateTasks(Any any, String password, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) -
getUpdateTasks
public List<PropagationTaskInfo> getUpdateTasks(AnyUR anyUR, AnyTypeKind kind, String key, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) Description copied from interface:PropagationManager
Create the update tasks on each resource associated, unless inexcludedResources
.- Specified by:
getUpdateTasks
in interfacePropagationManager
- Parameters:
anyUR
- update requestkind
- any type kindkey
- any keychangePwdRes
- the resources in which the password must be included in the propagation attributesenable
- whether any should be enabled or not, may be null to leave unchangedpropByRes
- operation to be performed per resourcepropByLinkedAccount
- operation to be performed for linked accountsvAttrs
- virtual attributes to be setexcludedResources
- external resource keys not to be considered for propagation- Returns:
- list of propagation tasks
-
getUserUpdateTasks
public List<PropagationTaskInfo> getUserUpdateTasks(UserWorkflowResult<Pair<UserUR, Boolean>> wfResult, List<String> changePwdRes, Collection<String> excludedResources) Description copied from interface:PropagationManager
Create the update tasks for the user on each resource associated, unless inexcludedResources
.- Specified by:
getUserUpdateTasks
in interfacePropagationManager
- Parameters:
wfResult
- user to be propagated (and info associated), as per result from workflowchangePwdRes
- the resources in which the password must be included in the propagation attributesexcludedResources
- external resources not to be considered for propagation- Returns:
- list of propagation tasks
-
getUserUpdateTasks
public List<PropagationTaskInfo> getUserUpdateTasks(UserWorkflowResult<Pair<UserUR, Boolean>> wfResult) Description copied from interface:PropagationManager
Create the update tasks for the user on each resource associated; propagate password update only to requested resources.- Specified by:
getUserUpdateTasks
in interfacePropagationManager
- Parameters:
wfResult
- user to be propagated (and info associated), as per result from workflow- Returns:
- list of propagation tasks
-
getUpdateTasks
protected List<PropagationTaskInfo> getUpdateTasks(AnyUR anyUR, Any any, String password, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs, Collection<String> excludedResources) -
getDeleteTasks
public List<PropagationTaskInfo> getDeleteTasks(AnyTypeKind kind, String key, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<String> excludedResources) Description copied from interface:PropagationManager
Create the delete tasks from each resource associated, unless inexcludedResources
.- Specified by:
getDeleteTasks
in interfacePropagationManager
- Parameters:
kind
- any type kindkey
- any keypropByRes
- operation to be performed per resourcepropByLinkedAccount
- operation to be performed for linked accountsexcludedResources
- external resource keys not to be considered for propagation- Returns:
- list of propagation tasks
-
getDeleteTasks
protected List<PropagationTaskInfo> getDeleteTasks(Any any, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<String> excludedResources) -
newTask
public PropagationTaskInfo newTask(DerAttrHandler derAttrHandler, Any any, ExternalResource resource, ResourceOperation operation, Provision provision, Stream<Item> mappingItems, Pair<String, Set<Attribute>> preparedAttrs) - Specified by:
newTask
in interfacePropagationManager
-
createTasks
protected List<PropagationTaskInfo> createTasks(Any any, String password, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, Collection<Attr> vAttrs) Create propagation tasks.- Parameters:
any
- to be provisionedpassword
- clear text password to be provisionedchangePwdRes
- the resources in which the password must be included in the propagation attributesenable
- whether user must be enabled or notpropByRes
- operation to be performed per resourcepropByLinkedAccount
- operation to be performed on linked accountsvAttrs
- virtual attributes to be set- Returns:
- list of propagation tasks created
-
createTasks
public List<PropagationTaskInfo> createTasks(Realm realm, PropagationByResource<String> propByRes, Collection<String> excludedResources) Description copied from interface:PropagationManager
Create the needed tasks for the realm for each resource associated, unless inexcludedResources
.- Specified by:
createTasks
in interfacePropagationManager
- Parameters:
realm
- realmpropByRes
- operation to be performed per resourceexcludedResources
- external resource keys not to be considered for propagation- Returns:
- list of propagation tasks
-
prepareAttrs
@Transactional(readOnly=true, propagation=REQUIRES_NEW) public Map<Pair<String,String>, prepareAttrsSet<Attribute>> (AnyTypeKind kind, String key, String password, List<String> changePwdRes, Boolean enable, Collection<String> excludedResources) Description copied from interface:PropagationManager
Prepare attributes for propagation.- Specified by:
prepareAttrs
in interfacePropagationManager
- Parameters:
kind
- any type kindkey
- any keypassword
- to be set (for users)changePwdRes
- the resources in which the password must be included in the propagation attributes (for users)enable
- whether any should be enabled or not, may be null to leave unchangedexcludedResources
- external resource keys not to be considered for propagation- Returns:
- map with prepared attributes per External Resource
-
prepareAttrs
@Transactional(readOnly=true, propagation=REQUIRES_NEW) public Map<Pair<String,String>, prepareAttrsSet<Attribute>> (Realm realm) Description copied from interface:PropagationManager
Prepare attributes for propagation.- Specified by:
prepareAttrs
in interfacePropagationManager
- Parameters:
realm
- realm- Returns:
- map with prepared attributes per External Resource
-
isOrdinaryForAttrForDelta
Checks whether the given attribute shall be treated as an ordinary attribute or not, for purpose of building AttributeDelta instances.- Parameters:
attr
- ConnId attribute- Returns:
- whether the condition is matched or not
-
setAttributeDeltas
public List<PropagationTaskInfo> setAttributeDeltas(List<PropagationTaskInfo> tasks, Map<Pair<String, String>, Set<Attribute>> beforeAttrs) Description copied from interface:PropagationManager
Enrich the provided tasks with attribute deltas.- Specified by:
setAttributeDeltas
in interfacePropagationManager
- Parameters:
tasks
- propagation tasksbeforeAttrs
- attribute values before update- Returns:
- enriched propagation tasks
-