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
public class PropagationByResource<T extends Serializable> extends Object implements Serializable
Encapsulates operations to be performed on various resources.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropagationByResource()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(ResourceOperation type, T key)Add an element.booleanaddAll(ResourceOperation type, Collection<T> keys)Add some elements.voidaddOldConnObjectKey(String resourceKey, String oldConnObjectKey)Add old ConnObjectKey for a given resource name.Map<T,ResourceOperation>asMap()voidclear()Removes all of the operations.booleancontains(ResourceOperation type, T key)booleancontains(T key)Set<T>get(ResourceOperation type)Get resources for a given resource operation type.StringgetOldConnObjectKey(String resourceKey)Fetch old connObjectKey for given resource name.Map<String,String>getOldConnObjectKeys()Fetch all old connObjectKeys.booleanisEmpty()Whether no operations are present.voidmerge(PropagationByResource<T> propByRes)Merge another resource operation instance into this instance.voidpurge()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.booleanremove(ResourceOperation type, T key)Remove an element.booleanremoveAll(Collection<T> keys)Removes only the keys in the underlying sets that are contained in the specified collection.booleanremoveAll(ResourceOperation type, Set<T> keys)Remove some elements.booleanremoveIf(Predicate<? super T> filter)Removes all of the keys in the underlying sets that satisfy the given predicate.booleanretainAll(Collection<T> keys)Retains only the keys in the underlying sets that are contained in the specified collection.voidset(ResourceOperation type, Collection<T> keys)Set resources for a given resource operation type.StringtoString()
-
-
-
Method Detail
-
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
public final boolean add(ResourceOperation type, T key)
Add an element.- Parameters:
type- resource operation typekey- target resource- Returns:
- whether the operation was successful or not
-
addAll
public boolean addAll(ResourceOperation type, Collection<T> keys)
Add some elements.- Parameters:
type- resource operation typekeys- target resources- Returns:
- whether the operation was successful or not
-
remove
public final boolean remove(ResourceOperation type, T key)
Remove an element.- Parameters:
type- resource operation typekey- target resource- Returns:
- whether the operation was successful or not
-
removeAll
public boolean removeAll(ResourceOperation type, Set<T> keys)
Remove some elements.- Parameters:
type- resource operation typekeys- target resources- Returns:
- whether the operation was successful or not
-
removeAll
public boolean removeAll(Collection<T> keys)
Removes only the keys in the underlying sets that are contained in the specified collection.- Parameters:
keys- collection containing keys to be retained in the underlying sets- Returns:
trueif the underlying sets changed as a result of the call- See Also:
Collection.removeAll(java.util.Collection)
-
removeIf
public boolean removeIf(Predicate<? super T> filter)
Removes all of the keys in the underlying sets that satisfy the given predicate.- Parameters:
filter- a predicate which returns true for elements to be removed- Returns:
trueif the underlying sets changed as a result of the call- See Also:
Collection.removeIf(java.util.function.Predicate)
-
retainAll
public boolean retainAll(Collection<T> keys)
Retains only the keys in the underlying sets that are contained in the specified collection.- Parameters:
keys- collection containing keys to be retained in the underlying sets- Returns:
trueif the underlying sets changed as a result of the call- See Also:
Collection.retainAll(java.util.Collection)
-
contains
public boolean contains(ResourceOperation type, T key)
-
contains
public boolean contains(T key)
-
get
public final Set<T> get(ResourceOperation type)
Get resources for a given resource operation type.- Parameters:
type- resource operation type- Returns:
- resource matching the given type
-
asMap
public Map<T,ResourceOperation> asMap()
-
set
public final void set(ResourceOperation type, Collection<T> keys)
Set resources for a given resource operation type.- Parameters:
type- resource operation typekeys- to be set
-
merge
public final void merge(PropagationByResource<T> propByRes)
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
public Map<String,String> getOldConnObjectKeys()
Fetch all old connObjectKeys.- Returns:
- old connObjectKeys; can be empty
-
getOldConnObjectKey
public String getOldConnObjectKey(String resourceKey)
Fetch old connObjectKey for given resource name.- Parameters:
resourceKey- resource name- Returns:
- old connObjectKey; can be null
-
addOldConnObjectKey
public void addOldConnObjectKey(String resourceKey, String oldConnObjectKey)
Add old ConnObjectKey for a given resource name.- Parameters:
resourceKey- resourceKey resource nameoldConnObjectKey- old ConnObjectKey
-
-