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
Fields Modifier and Type Field Description static String
INTERNAL_DATA_OPCODE
The Guacamole protocol instruction opcode reserved for arbitrary internal use by tunnel implementations.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GuacamoleReader
acquireReader()
Acquires exclusive read access to the Guacamole instruction stream and returns a GuacamoleReader for reading from that stream.GuacamoleWriter
acquireWriter()
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.GuacamoleSocket
getSocket()
Returns the GuacamoleSocket used by this GuacamoleTunnel for reading and writing.UUID
getUUID()
Returns the unique identifier associated with this GuacamoleTunnel.boolean
hasQueuedReaderThreads()
Returns whether there are threads waiting for read access to the Guacamole instruction stream.boolean
hasQueuedWriterThreads()
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
releaseReader()
Relinquishes exclusive read access to the Guacamole instruction stream.void
releaseWriter()
Relinquishes exclusive write access to the Guacamole instruction stream.
-
-
-
Field Detail
-
INTERNAL_DATA_OPCODE
static final String 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:
- Constant Field Values
-
-
Method Detail
-
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
void close() throws GuacamoleException
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.
-
-