ObjectType
- The type of objects stored within this Directory.public abstract class DecoratingDirectory<ObjectType extends Identifiable> extends DelegatingDirectory<ObjectType>
Constructor and Description |
---|
DecoratingDirectory(Directory<ObjectType> directory)
Creates a new DecoratingDirectory which decorates the objects within
the given directory.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ObjectType object)
Adds the given object to the overall set.
|
protected abstract ObjectType |
decorate(ObjectType object)
Given an object retrieved from a Directory which originates from a
different AuthenticationProvider, returns an identical type of object
optionally wrapped with additional information, functionality, etc.
|
ObjectType |
get(String identifier)
Returns the object having the given identifier.
|
Collection<ObjectType> |
getAll(Collection<String> identifiers)
Returns the objects having the given identifiers.
|
protected abstract ObjectType |
undecorate(ObjectType object)
Given an object originally returned from a call to this
DecoratingDirectory's decorate() function, reverses the decoration
operation, returning the original object.
|
void |
update(ObjectType object)
Updates the stored object with the data contained in the given object.
|
getDelegateDirectory, getIdentifiers, remove
public DecoratingDirectory(Directory<ObjectType> directory)
directory
- The Directory whose objects are being decorated.protected abstract ObjectType decorate(ObjectType object) throws org.apache.guacamole.GuacamoleException
object
- An object from a Directory which originates from a different
AuthenticationProvider.org.apache.guacamole.GuacamoleException
- If the provided object cannot be decorated due to an error.protected abstract ObjectType undecorate(ObjectType object) throws org.apache.guacamole.GuacamoleException
object
- An object which was originally returned by a call to this
DecoratingDirectory's decorate() function.org.apache.guacamole.GuacamoleException
- If the provided object cannot be undecorated due to an error.public ObjectType get(String identifier) throws org.apache.guacamole.GuacamoleException
Directory
get
in interface Directory<ObjectType extends Identifiable>
get
in class DelegatingDirectory<ObjectType extends Identifiable>
identifier
- The identifier to use when locating the object to
return.org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the
object, or if permission for retrieving the
object is denied.public Collection<ObjectType> getAll(Collection<String> identifiers) throws org.apache.guacamole.GuacamoleException
Directory
getAll
in interface Directory<ObjectType extends Identifiable>
getAll
in class DelegatingDirectory<ObjectType extends Identifiable>
identifiers
- The identifiers to use when locating the objects to return.org.apache.guacamole.GuacamoleException
- If an error occurs while retrieving the objects, or if permission
to retrieve the requested objects is denied.public void add(ObjectType object) throws org.apache.guacamole.GuacamoleException
Directory
add
in interface Directory<ObjectType extends Identifiable>
add
in class DelegatingDirectory<ObjectType extends Identifiable>
object
- The object to add.org.apache.guacamole.GuacamoleException
- If an error occurs while adding the object, or if adding the object
is not allowed.public void update(ObjectType object) throws org.apache.guacamole.GuacamoleException
Directory
update
in interface Directory<ObjectType extends Identifiable>
update
in class DelegatingDirectory<ObjectType extends Identifiable>
object
- The object which will supply the data for the update.org.apache.guacamole.GuacamoleException
- If an error occurs while updating the object,
or if updating the object is not allowed.Copyright © 2018. All rights reserved.