Class DelegatingEnvironment

  • All Implemented Interfaces:
    Environment

    public class DelegatingEnvironment
    extends Object
    implements Environment
    Environment implementation which simply delegates all function calls to a wrapped Environment instance.
    • Constructor Detail

      • DelegatingEnvironment

        public DelegatingEnvironment​(Environment environment)
        Creates a new DelegatingEnvironment which delegates all function calls to the given Environment.
        Parameters:
        environment - The Environment that all function calls should be delegated to.
    • Method Detail

      • getGuacamoleHome

        public File getGuacamoleHome()
        Description copied from interface: Environment
        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.
        Specified by:
        getGuacamoleHome in interface Environment
        Returns:
        The File representing the Guacamole home directory, which may or may not exist, and may turn out to not be a directory.
      • getProtocols

        public Map<String,​ProtocolInfo> getProtocols()
        Description copied from interface: Environment
        Returns a map of all available protocols, where each key is the name of that protocol as would be passed to guacd during connection.
        Specified by:
        getProtocols in interface Environment
        Returns:
        A map of all available protocols.
      • getProtocol

        public ProtocolInfo getProtocol​(String name)
        Description copied from interface: Environment
        Returns the protocol having the given name. The name must be the protocol name as would be passed to guacd during connection.
        Specified by:
        getProtocol in interface Environment
        Parameters:
        name - The name of the protocol.
        Returns:
        The protocol having the given name, or null if no such protocol is registered.
      • getProperty

        public <Type> Type getProperty​(GuacamoleProperty<Type> property)
                                throws org.apache.guacamole.GuacamoleException
        Description copied from interface: Environment
        Given a GuacamoleProperty, parses and returns the value set for that property in guacamole.properties, if any.
        Specified by:
        getProperty in interface Environment
        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

        public <Type> Type getProperty​(GuacamoleProperty<Type> property,
                                       Type defaultValue)
                                throws org.apache.guacamole.GuacamoleException
        Description copied from interface: Environment
        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.
        Specified by:
        getProperty in interface Environment
        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.
      • getRequiredProperty

        public <Type> Type getRequiredProperty​(GuacamoleProperty<Type> property)
                                        throws org.apache.guacamole.GuacamoleException
        Description copied from interface: Environment
        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.
        Specified by:
        getRequiredProperty in interface Environment
        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.
      • getDefaultGuacamoleProxyConfiguration

        public GuacamoleProxyConfiguration getDefaultGuacamoleProxyConfiguration()
                                                                          throws org.apache.guacamole.GuacamoleException
        Description copied from interface: Environment
        Returns the connection information which should be used, by default, to connect to guacd when establishing a remote desktop connection.
        Specified by:
        getDefaultGuacamoleProxyConfiguration in interface Environment
        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

        public void addGuacamoleProperties​(GuacamoleProperties properties)
                                    throws org.apache.guacamole.GuacamoleException
        Description copied from interface: Environment
        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 given GuacamoleProperties.
        Specified by:
        addGuacamoleProperties in interface Environment
        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.