Provide means for retrieving configuration by identifier.

This commit is contained in:
Michael Jumper
2013-01-30 23:04:31 -08:00
parent c20a479449
commit 7e4a210ba5
2 changed files with 21 additions and 0 deletions

View File

@@ -50,6 +50,21 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
*/
public interface GuacamoleConfigurationDirectory {
/**
* Returns the GuacamoleConfiguration having the given identifier.
*
* @param identifier The identifier of the GuacamoleConfiguration to
* return.
* @return The GuacamoleConfiguration having the given identifier, or null
* if no such GuacamoleConfiguration exists.
*
* @throws GuacamoleException If an error occurs while retrieving the
* configuration, or if access to the
* configuration is denied.
*/
GuacamoleConfiguration getConfiguration(String identifier)
throws GuacamoleException;
/**
* Returns a Map containing all GuacamoleConfigurations. The keys of this
* Map are Strings which uniquely identify each configuration.

View File

@@ -70,6 +70,12 @@ public class SimpleGuacamoleConfigurationDirectory
this.configs = configs;
}
@Override
public GuacamoleConfiguration getConfiguration(String identifier)
throws GuacamoleException {
return configs.get(identifier);
}
@Override
public Map<String, GuacamoleConfiguration> getConfigurations()
throws GuacamoleException {