Package org.apache.guacamole.net
Interface GuacamoleTunnel
- All Known Implementing Classes:
AbstractGuacamoleTunnel
,DelegatingGuacamoleTunnel
,SimpleGuacamoleTunnel
public interface GuacamoleTunnel
Provides a unique identifier and synchronized access to the GuacamoleReader
and GuacamoleWriter associated with a GuacamoleSocket.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The Guacamole protocol instruction opcode reserved for arbitrary internal use by tunnel implementations. -
Method Summary
Modifier and TypeMethodDescriptionAcquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.Acquires exclusive write access to the Guacamole instruction stream and returns a GuacamoleWriter for writing to that stream.void
close()
Release all resources allocated to this GuacamoleTunnel.Returns the GuacamoleSocket used by this GuacamoleTunnel for reading and writing.getUUID()
Returns the unique identifier associated with this GuacamoleTunnel.boolean
Returns whether there are threads waiting for read access to the Guacamole instruction stream.boolean
Returns whether there are threads waiting for write access to the Guacamole instruction stream.boolean
isOpen()
Returns whether this GuacamoleTunnel is open, or has been closed.void
Relinquishes exclusive read access to the Guacamole instruction stream.void
Relinquishes exclusive write access to the Guacamole instruction stream.
-
Field Details
-
INTERNAL_DATA_OPCODE
The Guacamole protocol instruction opcode reserved for arbitrary internal use by tunnel implementations. The value of this opcode is guaranteed to be the empty string (""). Tunnel implementations may use this opcode for any purpose. It is currently used by the HTTP tunnel to mark the end of the HTTP response, and by the WebSocket tunnel to transmit the tunnel UUID.- See Also:
-
-
Method Details
-
acquireReader
GuacamoleReader acquireReader()Acquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.- Returns:
- A GuacamoleReader for reading from the Guacamole instruction stream.
-
releaseReader
void releaseReader()Relinquishes exclusive read access to the Guacamole instruction stream. This function should be called whenever a thread finishes using a GuacamoleTunnel's GuacamoleReader. -
hasQueuedReaderThreads
boolean hasQueuedReaderThreads()Returns whether there are threads waiting for read access to the Guacamole instruction stream.- Returns:
- true if threads are waiting for read access the Guacamole instruction stream, false otherwise.
-
acquireWriter
GuacamoleWriter acquireWriter()Acquires exclusive write access to the Guacamole instruction stream and returns a GuacamoleWriter for writing to that stream.- Returns:
- A GuacamoleWriter for writing to the Guacamole instruction stream.
-
releaseWriter
void releaseWriter()Relinquishes exclusive write access to the Guacamole instruction stream. This function should be called whenever a thread finishes using a GuacamoleTunnel's GuacamoleWriter. -
hasQueuedWriterThreads
boolean hasQueuedWriterThreads()Returns whether there are threads waiting for write access to the Guacamole instruction stream.- Returns:
- true if threads are waiting for write access the Guacamole instruction stream, false otherwise.
-
getUUID
UUID getUUID()Returns the unique identifier associated with this GuacamoleTunnel.- Returns:
- The unique identifier associated with this GuacamoleTunnel.
-
getSocket
GuacamoleSocket getSocket()Returns the GuacamoleSocket used by this GuacamoleTunnel for reading and writing.- Returns:
- The GuacamoleSocket used by this GuacamoleTunnel.
-
close
Release all resources allocated to this GuacamoleTunnel.- Throws:
GuacamoleException
- if an error occurs while releasing resources.
-
isOpen
boolean isOpen()Returns whether this GuacamoleTunnel is open, or has been closed.- Returns:
- true if this GuacamoleTunnel is open, false if it is closed.
-