Class ConfiguredGuacamoleSocket

  • All Implemented Interfaces:
    GuacamoleSocket

    public class ConfiguredGuacamoleSocket
    extends DelegatingGuacamoleSocket
    A GuacamoleSocket which pre-configures the connection based on a given GuacamoleConfiguration, completing the initial protocol handshake before accepting data for read or write. This is useful for forcing a connection to the Guacamole proxy server with a specific configuration while disallowing the client that will be using this GuacamoleSocket from manually controlling the initial protocol handshake.
    • Constructor Detail

      • ConfiguredGuacamoleSocket

        public ConfiguredGuacamoleSocket​(GuacamoleSocket socket,
                                         GuacamoleConfiguration config)
                                  throws GuacamoleException
        Creates a new ConfiguredGuacamoleSocket which uses the given GuacamoleConfiguration to complete the initial protocol handshake over the given GuacamoleSocket. A default GuacamoleClientInformation object is used to provide basic client information.
        Parameters:
        socket - The GuacamoleSocket to wrap.
        config - The GuacamoleConfiguration to use to complete the initial protocol handshake.
        Throws:
        GuacamoleException - If an error occurs while completing the initial protocol handshake.
      • ConfiguredGuacamoleSocket

        public ConfiguredGuacamoleSocket​(GuacamoleSocket socket,
                                         GuacamoleConfiguration config,
                                         GuacamoleClientInformation info)
                                  throws GuacamoleException
        Creates a new ConfiguredGuacamoleSocket which uses the given GuacamoleConfiguration and GuacamoleClientInformation to complete the initial protocol handshake over the given GuacamoleSocket.
        Parameters:
        socket - The GuacamoleSocket to wrap.
        config - The GuacamoleConfiguration to use to complete the initial protocol handshake.
        info - The GuacamoleClientInformation to use to complete the initial protocol handshake.
        Throws:
        GuacamoleException - If an error occurs while completing the initial protocol handshake.
    • Method Detail

      • getConfiguration

        public GuacamoleConfiguration getConfiguration()
        Returns the GuacamoleConfiguration used to configure this ConfiguredGuacamoleSocket.
        Returns:
        The GuacamoleConfiguration used to configure this ConfiguredGuacamoleSocket.
      • getConnectionID

        public String getConnectionID()
        Returns the unique ID associated with the Guacamole connection negotiated by this ConfiguredGuacamoleSocket. The ID is provided by the "ready" instruction returned by the Guacamole proxy.
        Returns:
        The ID of the negotiated Guacamole connection.
      • getProtocolVersion

        public GuacamoleProtocolVersion getProtocolVersion()
        Returns the version of the Guacamole protocol associated with the Guacamole connection negotiated by this ConfiguredGuacamoleSocket. This version is the lowest version common to both ConfiguredGuacamoleSocket and the relevant Guacamole proxy instance (guacd).
        Returns:
        The protocol version that this ConfiguredGuacamoleSocket will use to communicate with guacd.
      • getProtocol

        public String getProtocol()
        Description copied from interface: GuacamoleSocket
        Returns the name of the protocol to be used. If the protocol is not known or the implementation refuses to reveal the underlying protocol, null is returned.

        Implementations should aim to expose the name of the underlying protocol, such that protocol-specific responses like the "required" and "argv" instructions can be handled correctly by code consuming the GuacamoleSocket.

        Specified by:
        getProtocol in interface GuacamoleSocket
        Overrides:
        getProtocol in class DelegatingGuacamoleSocket
        Returns:
        The name of the protocol to be used, or null if this information is not available.