Class SimpleRelatedObjectSet
java.lang.Object
org.apache.guacamole.net.auth.simple.SimpleRelatedObjectSet
- All Implemented Interfaces:
RelatedObjectSet
A read-only implementation of RelatedObjectSet which uses a backing Set
of identifiers to determine which objects are present.
-
Field Summary
Fields inherited from interface org.apache.guacamole.net.auth.RelatedObjectSet
EMPTY_SET
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty SimpleRelatedObjectSet.SimpleRelatedObjectSet
(Set<String> identifiers) Creates a new SimpleRelatedObjectSet which contains the objects having the identifiers within the given Set. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addObjects
(Set<String> identifiers) Adds the objects having the given identifiers, if not already present.Returns a Set which contains the identifiers of all objects contained within this RelatedObjectSet.void
removeObjects
(Set<String> identifiers) Removes each of the objects having the specified identifiers, if present.protected void
setObjects
(Set<String> identifiers) Replaces the Set of object identifiers which backs this SimpleRelatedObjectSet.
-
Constructor Details
-
SimpleRelatedObjectSet
public SimpleRelatedObjectSet()Creates a new empty SimpleRelatedObjectSet. If you are not extending SimpleRelatedObjectSet and only need an immutable, empty RelatedObjectSet, consider usingRelatedObjectSet.EMPTY_SET
instead. -
SimpleRelatedObjectSet
Creates a new SimpleRelatedObjectSet which contains the objects having the identifiers within the given Set. The given Set backs the contents of the new SimpleRelatedObjectSet. While the SimpleRelatedObjectSet is read-only, any changes to the underlying Set will be reflected in the SimpleRelatedObjectSet.- Parameters:
identifiers
- The Set containing the identifiers of all objects which should be present within the new SimpleRelatedObjectSet.
-
-
Method Details
-
setObjects
Replaces the Set of object identifiers which backs this SimpleRelatedObjectSet. Future function calls on this SimpleRelatedObjectSet will instead use the provided Set.- Parameters:
identifiers
- The Set containing the identifiers of all objects which should be present within this SimpleRelatedObjectSet.
-
getObjects
Description copied from interface:RelatedObjectSet
Returns a Set which contains the identifiers of all objects contained within this RelatedObjectSet.- Specified by:
getObjects
in interfaceRelatedObjectSet
- Returns:
- A Set which contains the identifiers of all objects contained within this RelatedObjectSet.
-
addObjects
Description copied from interface:RelatedObjectSet
Adds the objects having the given identifiers, if not already present. If a specified object is already present, no operation is performed regarding that object.- Specified by:
addObjects
in interfaceRelatedObjectSet
- Parameters:
identifiers
- The identifiers of all objects being added.- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while adding the objects, or if permission to add objects is denied.
-
removeObjects
Description copied from interface:RelatedObjectSet
Removes each of the objects having the specified identifiers, if present. If a specified object is not present, no operation is performed regarding that object.- Specified by:
removeObjects
in interfaceRelatedObjectSet
- Parameters:
identifiers
- The identifiers of all objects being removed.- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while removing the objects, or if permission to remove objects is denied.
-