Class PropagationByResource<T extends Serializable>
java.lang.Object
org.apache.syncope.core.provisioning.api.PropagationByResource<T>
- Type Parameters:
T
- key for propagation: could be simple resource or pair (resource, connObjectKeyValue) for linked accounts
- All Implemented Interfaces:
Serializable
Encapsulates operations to be performed on various resources.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
add
(ResourceOperation type, T key) Add an element.boolean
addAll
(ResourceOperation type, Collection<T> keys) Add some elements.void
addOldConnObjectKey
(String resourceKey, String oldConnObjectKey) Add old ConnObjectKey for a given resource name.asMap()
void
clear()
Removes all of the operations.boolean
contains
(ResourceOperation type, T key) boolean
get
(ResourceOperation type) Get resources for a given resource operation type.getOldConnObjectKey
(String resourceKey) Fetch old connObjectKey for given resource name.Fetch all old connObjectKeys.final boolean
isEmpty()
Whether no operations are present.final void
merge
(PropagationByResource<T> propByRes) Merge another resource operation instance into this instance.final void
purge()
Avoid potential conflicts by not doing create or update on any resource for which a delete is requested, and by not doing any create on any resource for which an update is requested.final boolean
remove
(ResourceOperation type, T key) Remove an element.boolean
removeAll
(Collection<T> keys) Removes only the resource names in the underlying resource name sets that are contained in the specified collection.boolean
removeAll
(ResourceOperation type, Set<T> keys) Remove some elements.boolean
retainAll
(Collection<T> keys) Retains only the resource names in the underlying resource name sets that are contained in the specified collection.final void
set
(ResourceOperation type, Collection<T> keys) Set resources for a given resource operation type.toString()
-
Constructor Details
-
PropagationByResource
public PropagationByResource()Default constructor.
-
-
Method Details
-
purge
public final void purge()Avoid potential conflicts by not doing create or update on any resource for which a delete is requested, and by not doing any create on any resource for which an update is requested. -
add
Add an element.- Parameters:
type
- resource operation typekey
- target resource- Returns:
- whether the operation was successful or not
-
addAll
Add some elements.- Parameters:
type
- resource operation typekeys
- target resources- Returns:
- whether the operation was successful or not
-
remove
Remove an element.- Parameters:
type
- resource operation typekey
- target resource- Returns:
- whether the operation was successful or not
-
removeAll
Remove some elements.- Parameters:
type
- resource operation typekeys
- target resources- Returns:
- whether the operation was successful or not
-
removeAll
Removes only the resource names in the underlying resource name sets that are contained in the specified collection.- Parameters:
keys
- collection containing resource names to be retained in the underlying resource name sets- Returns:
true
if the underlying resource name sets changed as a result of the call- See Also:
-
retainAll
Retains only the resource names in the underlying resource name sets that are contained in the specified collection.- Parameters:
keys
- collection containing resource names to be retained in the underlying resource name sets- Returns:
true
if the underlying resource name sets changed as a result of the call- See Also:
-
contains
-
contains
-
get
Get resources for a given resource operation type.- Parameters:
type
- resource operation type- Returns:
- resource matching the given type
-
asMap
-
set
Set resources for a given resource operation type.- Parameters:
type
- resource operation typekeys
- to be set
-
merge
Merge another resource operation instance into this instance.- Parameters:
propByRes
- to be merged
-
clear
public void clear()Removes all of the operations. -
isEmpty
public final boolean isEmpty()Whether no operations are present.- Returns:
- true if no operations (create / update / delete) and no old connObjectKeys are present
-
getOldConnObjectKeys
Fetch all old connObjectKeys.- Returns:
- old connObjectKeys; can be empty
-
getOldConnObjectKey
Fetch old connObjectKey for given resource name.- Parameters:
resourceKey
- resource name- Returns:
- old connObjectKey; can be null
-
addOldConnObjectKey
Add old ConnObjectKey for a given resource name.- Parameters:
resourceKey
- resourceKey resource nameoldConnObjectKey
- old ConnObjectKey
-
toString
-