Package org.apache.guacamole.protocol
Class ConfiguredGuacamoleSocket
java.lang.Object
org.apache.guacamole.net.DelegatingGuacamoleSocket
org.apache.guacamole.protocol.ConfiguredGuacamoleSocket
- All Implemented Interfaces:
GuacamoleSocket
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 Summary
ConstructorsConstructorDescriptionConfiguredGuacamoleSocket
(GuacamoleSocket socket, GuacamoleConfiguration config) Creates a new ConfiguredGuacamoleSocket which uses the given GuacamoleConfiguration to complete the initial protocol handshake over the given GuacamoleSocket.ConfiguredGuacamoleSocket
(GuacamoleSocket socket, GuacamoleConfiguration config, GuacamoleClientInformation info) Creates a new ConfiguredGuacamoleSocket which uses the given GuacamoleConfiguration and GuacamoleClientInformation to complete the initial protocol handshake over the given GuacamoleSocket. -
Method Summary
Modifier and TypeMethodDescriptionReturns the GuacamoleConfiguration used to configure this ConfiguredGuacamoleSocket.Returns the unique ID associated with the Guacamole connection negotiated by this ConfiguredGuacamoleSocket.Returns the name of the protocol to be used.Returns the version of the Guacamole protocol associated with the Guacamole connection negotiated by this ConfiguredGuacamoleSocket.Methods inherited from class org.apache.guacamole.net.DelegatingGuacamoleSocket
close, getDelegateSocket, getReader, getWriter, isOpen
-
Constructor Details
-
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 Details
-
getConfiguration
Returns the GuacamoleConfiguration used to configure this ConfiguredGuacamoleSocket.- Returns:
- The GuacamoleConfiguration used to configure this ConfiguredGuacamoleSocket.
-
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
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
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 interfaceGuacamoleSocket
- Overrides:
getProtocol
in classDelegatingGuacamoleSocket
- Returns:
- The name of the protocol to be used, or null if this information is not available.
-