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 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.Map<T,ResourceOperation>
asMap()
void
clear()
Removes all of the operations.boolean
contains(ResourceOperation type, T key)
boolean
contains(T key)
Set<T>
get(ResourceOperation type)
Get resources for a given resource operation type.String
getOldConnObjectKey(String resourceKey)
Fetch old connObjectKey for given resource name.Map<String,String>
getOldConnObjectKeys()
Fetch all old connObjectKeys.boolean
isEmpty()
Whether no operations are present.void
merge(PropagationByResource<T> propByRes)
Merge another resource operation instance into this instance.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.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.void
set(ResourceOperation type, Collection<T> keys)
Set resources for a given resource operation type.String
toString()
-
-
-
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 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:
Collection.removeAll(java.util.Collection)
-
retainAll
public boolean retainAll(Collection<T> keys)
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:
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
-
-