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 AnyUtilsFactoryprotected final ConnObjectUtilsprotected final DerAttrHandlerprotected final EntityFactoryprotected static final Loggerprotected final MappingManagerprotected final ExternalResourceDAOFields inherited from interface org.apache.syncope.core.provisioning.api.propagation.PropagationManager
MANDATORY_MISSING_ATTR_NAME, MANDATORY_NULL_OR_EMPTY_ATTR_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDefaultPropagationManager(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) 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<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<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<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<String> excludedResources) getUserCreateTasks(String key, String password, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount, 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 booleanChecks 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
-
resourceDAO
-
entityFactory
-
connObjectUtils
-
mappingManager
-
derAttrHandler
-
anyUtilsFactory
-
-
Constructor Details
-
DefaultPropagationManager
public DefaultPropagationManager(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<String> excludedResources) Description copied from interface:PropagationManagerCreate the tasks for every associated resource, unless inexcludedResources.- Specified by:
getCreateTasksin interfacePropagationManager- Parameters:
kind- any type kindkey- any keyenable- whether any should be enabled or notpropByRes- operation to be performed per resourceexcludedResources- 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<String> excludedResources) Description copied from interface:PropagationManagerCreate the user tasks for every associated resource, unless inexcludedResources.- Specified by:
getUserCreateTasksin 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 accountsexcludedResources- 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<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<String> excludedResources) Description copied from interface:PropagationManagerCreate the update tasks on each resource associated, unless inexcludedResources.- Specified by:
getUpdateTasksin 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 accountsexcludedResources- 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:PropagationManagerCreate the update tasks for the user on each resource associated, unless inexcludedResources.- Specified by:
getUserUpdateTasksin 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:PropagationManagerCreate the update tasks for the user on each resource associated; propagate password update only to requested resources.- Specified by:
getUserUpdateTasksin 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<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:PropagationManagerCreate the delete tasks from each resource associated, unless inexcludedResources.- Specified by:
getDeleteTasksin 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:
newTaskin interfacePropagationManager
-
createTasks
protected List<PropagationTaskInfo> createTasks(Any any, String password, List<String> changePwdRes, Boolean enable, PropagationByResource<String> propByRes, PropagationByResource<Pair<String, String>> propByLinkedAccount) 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 accounts- Returns:
- list of propagation tasks created
-
createTasks
public List<PropagationTaskInfo> createTasks(Realm realm, PropagationByResource<String> propByRes, Collection<String> excludedResources) Description copied from interface:PropagationManagerCreate the needed tasks for the realm for each resource associated, unless inexcludedResources.- Specified by:
createTasksin 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:PropagationManagerPrepare attributes for propagation.- Specified by:
prepareAttrsin 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:PropagationManagerPrepare attributes for propagation.- Specified by:
prepareAttrsin 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:PropagationManagerEnrich the provided tasks with attribute deltas.- Specified by:
setAttributeDeltasin interfacePropagationManager- Parameters:
tasks- propagation tasksbeforeAttrs- attribute values before update- Returns:
- enriched propagation tasks
-