Class GuacamoleConfiguration

  • All Implemented Interfaces:
    Serializable

    public class GuacamoleConfiguration
    extends Object
    implements Serializable
    All information necessary to complete the initial protocol handshake of a Guacamole session.
    See Also:
    Serialized Form
    • Constructor Detail

      • GuacamoleConfiguration

        public GuacamoleConfiguration()
        Creates a new, blank GuacamoleConfiguration with its protocol, connection ID, and parameters unset.
      • GuacamoleConfiguration

        public GuacamoleConfiguration​(GuacamoleConfiguration config)
        Copies the given GuacamoleConfiguration, creating a new, indepedent GuacamoleConfiguration containing the same protocol, connection ID, and parameter values, if any.
        Parameters:
        config - The GuacamoleConfiguration to copy.
    • Method Detail

      • getConnectionID

        public String getConnectionID()
        Returns the ID of the connection being joined, if any. If no connection is being joined, this returns null, and the protocol must be set.
        Returns:
        The ID of the connection being joined, or null if no connection is being joined.
      • setConnectionID

        public void setConnectionID​(String connectionID)
        Sets the ID of the connection being joined, if any. If no connection is being joined, this value must be omitted.
        Parameters:
        connectionID - The ID of the connection being joined.
      • getProtocol

        public String getProtocol()
        Returns the name of the protocol to be used.
        Returns:
        The name of the protocol to be used.
      • setProtocol

        public void setProtocol​(String protocol)
        Sets the name of the protocol to be used. If no connection is being joined (a new connection is being established), this value must be set.

        If a connection is being joined, this value should still be set to ensure that protocol-specific responses like the "required" and "argv" instructions can be understood in their proper context by other code that may consume this GuacamoleConfiguration like ConfiguredGuacamoleSocket.

        If this value is unavailable or remains unset, it is still possible to join an established connection using setConnectionID(java.lang.String), however protocol-specific responses like the "required" and "argv" instructions might not be possible to handle correctly if the underlying protocol is not made available through some other means to the client receiving those responses.

        Parameters:
        protocol - The name of the protocol to be used.
      • getParameter

        public String getParameter​(String name)
        Returns the value set for the parameter with the given name, if any.
        Parameters:
        name - The name of the parameter to return the value for.
        Returns:
        The value of the parameter with the given name, or null if that parameter has not been set.
      • setParameter

        public void setParameter​(String name,
                                 String value)
        Sets the value for the parameter with the given name.
        Parameters:
        name - The name of the parameter to set the value for.
        value - The value to set for the parameter with the given name.
      • unsetParameter

        public void unsetParameter​(String name)
        Removes the value set for the parameter with the given name.
        Parameters:
        name - The name of the parameter to remove the value of.
      • getParameterNames

        public Set<String> getParameterNames()
        Returns a set of all currently defined parameter names. Each name corresponds to a parameter that has a value set on this GuacamoleConfiguration via setParameter().
        Returns:
        A set of all currently defined parameter names.
      • getParameters

        public Map<String,​String> getParameters()
        Returns a map which contains parameter name/value pairs as key/value pairs. Changes to this map will affect the parameters stored within this configuration.
        Returns:
        A map which contains all parameter name/value pairs as key/value pairs.
      • setParameters

        public void setParameters​(Map<String,​String> parameters)
        Replaces all current parameters with the parameters defined within the given map. Key/value pairs within the map represent parameter name/value pairs.
        Parameters:
        parameters - A map which contains all parameter name/value pairs as key/value pairs.