Package org.apache.guacamole.net
Class DelegatingGuacamoleSocket
java.lang.Object
org.apache.guacamole.net.DelegatingGuacamoleSocket
- All Implemented Interfaces:
GuacamoleSocket
- Direct Known Subclasses:
ConfiguredGuacamoleSocket
,FailoverGuacamoleSocket
,FilteredGuacamoleSocket
GuacamoleSocket implementation which simply delegates all function calls to
an underlying GuacamoleSocket.
-
Constructor Summary
ConstructorsConstructorDescriptionWraps the given GuacamoleSocket such that all function calls against this DelegatingGuacamoleSocket will be delegated to it. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Releases all resources in use by the connection represented by this GuacamoleSocket.protected GuacamoleSocket
Returns the underlying GuacamoleSocket wrapped by this DelegatingGuacamoleSocket.Returns the name of the protocol to be used.Returns a GuacamoleReader which can be used to read from the Guacamole instruction stream associated with the connection represented by this GuacamoleSocket.Returns a GuacamoleWriter which can be used to write to the Guacamole instruction stream associated with the connection represented by this GuacamoleSocket.boolean
isOpen()
Returns whether this GuacamoleSocket is open and can be used for reading and writing.
-
Constructor Details
-
DelegatingGuacamoleSocket
Wraps the given GuacamoleSocket such that all function calls against this DelegatingGuacamoleSocket will be delegated to it.- Parameters:
socket
- The GuacamoleSocket to wrap.
-
-
Method Details
-
getDelegateSocket
Returns the underlying GuacamoleSocket wrapped by this DelegatingGuacamoleSocket.- Returns:
- The GuacamoleSocket wrapped by this DelegatingGuacamoleSocket.
-
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
- Returns:
- The name of the protocol to be used, or null if this information is not available.
-
getReader
Description copied from interface:GuacamoleSocket
Returns a GuacamoleReader which can be used to read from the Guacamole instruction stream associated with the connection represented by this GuacamoleSocket.- Specified by:
getReader
in interfaceGuacamoleSocket
- Returns:
- A GuacamoleReader which can be used to read from the Guacamole instruction stream.
-
getWriter
Description copied from interface:GuacamoleSocket
Returns a GuacamoleWriter which can be used to write to the Guacamole instruction stream associated with the connection represented by this GuacamoleSocket.- Specified by:
getWriter
in interfaceGuacamoleSocket
- Returns:
- A GuacamoleWriter which can be used to write to the Guacamole instruction stream.
-
close
Description copied from interface:GuacamoleSocket
Releases all resources in use by the connection represented by this GuacamoleSocket.- Specified by:
close
in interfaceGuacamoleSocket
- Throws:
GuacamoleException
- If an error occurs while releasing resources.
-
isOpen
public boolean isOpen()Description copied from interface:GuacamoleSocket
Returns whether this GuacamoleSocket is open and can be used for reading and writing.- Specified by:
isOpen
in interfaceGuacamoleSocket
- Returns:
- true if this GuacamoleSocket is open, false otherwise.
-