public class SimpleConnectionDirectory extends Object implements Directory<String,Connection>
Constructor and Description |
---|
SimpleConnectionDirectory(Map<String,GuacamoleConfiguration> configs)
Creates a new SimpleConnectionDirectory which provides
access to the configurations contained within the given Map.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Connection connection)
Adds the given object to the overall set.
|
Connection |
get(String identifier)
Returns the object having the given identifier.
|
Set<String> |
getIdentifiers()
Returns a Set containing all identifiers for all objects within this
Directory.
|
void |
move(String identifier,
Directory<String,Connection> directory)
Moves the object with the given identifier to the given directory.
|
Connection |
putConnection(Connection connection)
An internal method for modifying the Connections in this Directory.
|
void |
remove(String identifier)
Removes the object with the given identifier from the overall set.
|
Connection |
removeConnection(String identifier)
An internal method for removing a Connection from this Directory.
|
void |
update(Connection connection)
Updates the stored object with the data contained in the given object.
|
public SimpleConnectionDirectory(Map<String,GuacamoleConfiguration> configs)
configs
- The Map of GuacamoleConfigurations to provide access to.public Connection get(String identifier) throws GuacamoleException
Directory
get
in interface Directory<String,Connection>
identifier
- The identifier to use when locating the object to
return.GuacamoleException
- If an error occurs while retrieving the
object, or if permission for retrieving the
object is denied.public Set<String> getIdentifiers() throws GuacamoleException
Directory
getIdentifiers
in interface Directory<String,Connection>
GuacamoleException
- If an error occurs while retrieving
the identifiers.public void add(Connection connection) throws GuacamoleException
Directory
add
in interface Directory<String,Connection>
connection
- The object to add.GuacamoleException
- If an error occurs while adding the object , or
if adding the object is not allowed.public void update(Connection connection) throws GuacamoleException
Directory
update
in interface Directory<String,Connection>
connection
- The object which will supply the data for the update.GuacamoleException
- If an error occurs while updating the object,
or if updating the object is not allowed.public void remove(String identifier) throws GuacamoleException
Directory
remove
in interface Directory<String,Connection>
identifier
- The identifier of the object to remove.GuacamoleException
- If an error occurs while removing the object,
or if removing object is not allowed.public void move(String identifier, Directory<String,Connection> directory) throws GuacamoleException
Directory
move
in interface Directory<String,Connection>
identifier
- The identifier of the object to remove.directory
- The directory to move the object to.GuacamoleException
- If an error occurs while moving the object,
or if moving object is not allowed.public Connection putConnection(Connection connection)
connection
- The connection to add or update the Directory with.public Connection removeConnection(String identifier)
identifier
- The identifier of the Connection to remove.Copyright © 2016. All Rights Reserved.