Package org.apache.guacamole.environment
Interface Environment
- All Known Implementing Classes:
DelegatingEnvironment
,LocalEnvironment
public interface Environment
The environment of an arbitrary Guacamole instance, describing available
protocols, configuration parameters, and the GUACAMOLE_HOME directory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnumGuacamoleProperty
<CaseSensitivity> A property that configures how Guacamole handles case sensitivity - it can be enabled for both usernames and group names, just usernames, just group names, or disabled for both.static final StringGuacamoleProperty
The hostname of the server where guacd (the Guacamole proxy server) is running.static final IntegerGuacamoleProperty
The port that guacd (the Guacamole proxy server) is listening on.static final BooleanGuacamoleProperty
Whether guacd requires SSL/TLS on connections. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
addGuacamoleProperties
(GuacamoleProperties properties) Adds another possible source of Guacamole configuration properties to this Environment.default CaseSensitivity
Returns the case sensitivity configuration for Guacamole as defined in guacamole.properties, or the default of enabling case sensitivity for both usernames and group names.Returns the connection information which should be used, by default, to connect to guacd when establishing a remote desktop connection.Returns the Guacamole home directory as determined when this Environment object was created.<Type> Type
getProperty
(GuacamoleProperty<Type> property) Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any.<Type> Type
getProperty
(GuacamoleProperty<Type> property, Type defaultValue) Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any.default <Type> Collection
<Type> getPropertyCollection
(GuacamoleProperty<Type> property) Given a GuacamoleProperty, parses and returns a sorted Collection of the value set for that property in guacamole.properties, if any.default <Type> Collection
<Type> getPropertyCollection
(GuacamoleProperty<Type> property, Collection<Type> defaultValue) Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any.default <Type> Collection
<Type> getPropertyCollection
(GuacamoleProperty<Type> property, Type defaultValue) Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any.getProtocol
(String name) Returns the protocol having the given name.Returns a map of all available protocols, where each key is the name of that protocol as would be passed to guacd during connection.<Type> Type
getRequiredProperty
(GuacamoleProperty<Type> property) Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties.default <Type> Collection
<Type> getRequiredPropertyCollection
(GuacamoleProperty<Type> property) Given a GuacamoleProperty, parses and returns a sorted Collection of values for that property in guacamole.properties.
-
Field Details
-
GUACD_HOSTNAME
The hostname of the server where guacd (the Guacamole proxy server) is running. -
GUACD_PORT
The port that guacd (the Guacamole proxy server) is listening on. -
GUACD_SSL
Whether guacd requires SSL/TLS on connections. -
CASE_SENSITIVITY
A property that configures how Guacamole handles case sensitivity - it can be enabled for both usernames and group names, just usernames, just group names, or disabled for both.
-
-
Method Details
-
getGuacamoleHome
File getGuacamoleHome()Returns the Guacamole home directory as determined when this Environment object was created. The Guacamole home directory is found by checking, in order: the guacamole.home system property, the GUACAMOLE_HOME environment variable, and finally the .guacamole directory in the home directory of the user running the servlet container.- Returns:
- The File representing the Guacamole home directory, which may or may not exist, and may turn out to not be a directory.
-
getProtocols
Map<String,ProtocolInfo> getProtocols()Returns a map of all available protocols, where each key is the name of that protocol as would be passed to guacd during connection.- Returns:
- A map of all available protocols.
-
getProtocol
Returns the protocol having the given name. The name must be the protocol name as would be passed to guacd during connection.- Parameters:
name
- The name of the protocol.- Returns:
- The protocol having the given name, or null if no such protocol is registered.
-
getProperty
<Type> Type getProperty(GuacamoleProperty<Type> property) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.- Returns:
- The parsed value of the property as read from guacamole.properties.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties.
-
getProperty
<Type> Type getProperty(GuacamoleProperty<Type> property, Type defaultValue) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any. If no value is found, the provided default value is returned.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.defaultValue
- The value to return if no value was given in guacamole.properties.- Returns:
- The parsed value of the property as read from guacamole.properties, or the provided default value if no value was found.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties.
-
getPropertyCollection
default <Type> Collection<Type> getPropertyCollection(GuacamoleProperty<Type> property) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns a sorted Collection of the value set for that property in guacamole.properties, if any. The implementation of parsing and returning a collection of multiple values is up to the individual property implementations, and not all implementations will support reading and returning multiple values.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.- Returns:
- A sorted collection of the the parsed values of the property as read from guacamole.properties.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties.
-
getPropertyCollection
default <Type> Collection<Type> getPropertyCollection(GuacamoleProperty<Type> property, Type defaultValue) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any. If no value is found, a Collection is returned with the provided default value. The implementation of parsing and returning a collection of multiple values is up to the individual property implementations, and not all implementations will support reading and returning multiple values.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.defaultValue
- The single value to return in the Collection if no value was given in guacamole.properties.- Returns:
- A sorted collection of the the parsed values of the property as read from guacamole.properties, or a Collection with the single default value provided.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties.
-
getPropertyCollection
default <Type> Collection<Type> getPropertyCollection(GuacamoleProperty<Type> property, Collection<Type> defaultValue) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any. If no value is found, the provided Collection of default values is returned. The implementation of parsing and returning a collection of multiple values is up to the individual property implementations, and not all implementations will support reading and returning multiple values.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.defaultValue
- The Collection of values to return in the Collection if no value was given in guacamole.properties.- Returns:
- A sorted collection of the the parsed values of the property as read from guacamole.properties, or a Collection with the single default value provided.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties.
-
getRequiredProperty
<Type> Type getRequiredProperty(GuacamoleProperty<Type> property) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties. An exception is thrown if the value is not provided.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.- Returns:
- The parsed value of the property as read from guacamole.properties.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties, or if the property is not specified.
-
getRequiredPropertyCollection
default <Type> Collection<Type> getRequiredPropertyCollection(GuacamoleProperty<Type> property) throws org.apache.guacamole.GuacamoleException Given a GuacamoleProperty, parses and returns a sorted Collection of values for that property in guacamole.properties. An exception is thrown if the value is not provided. The implementation of parsing and returning a collection of multiple values is up to the individual property implementations, and not all implementations will support reading and returning multiple values.- Type Parameters:
Type
- The type that the given property is parsed into.- Parameters:
property
- The property to read from guacamole.properties.- Returns:
- A sorted Collection of the property as read from guacamole.properties.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the value for the given property in guacamole.properties, or if the property is not specified.
-
getDefaultGuacamoleProxyConfiguration
GuacamoleProxyConfiguration getDefaultGuacamoleProxyConfiguration() throws org.apache.guacamole.GuacamoleExceptionReturns the connection information which should be used, by default, to connect to guacd when establishing a remote desktop connection.- Returns:
- The connection information which should be used, by default, to connect to guacd.
- Throws:
org.apache.guacamole.GuacamoleException
- If the connection information for guacd cannot be retrieved.
-
addGuacamoleProperties
default void addGuacamoleProperties(GuacamoleProperties properties) throws org.apache.guacamole.GuacamoleException Adds another possible source of Guacamole configuration properties to this Environment. Properties not already defined by other sources of Guacamole configuration properties will alternatively be read from the givenGuacamoleProperties
.- Parameters:
properties
- The GuacamoleProperties to add to this Environment.- Throws:
org.apache.guacamole.GuacamoleException
- If the given GuacamoleProperties cannot be added, or if this Environment does not support this operation.
-
getCaseSensitivity
Returns the case sensitivity configuration for Guacamole as defined in guacamole.properties, or the default of enabling case sensitivity for both usernames and group names.- Returns:
- The case sensitivity setting as configured in guacamole.properties, or the default of enabling case sensitivity.
-