net.sourceforge.guacamole.protocol
Class ConfiguredGuacamoleSocket

java.lang.Object
  extended by net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket
All Implemented Interfaces:
GuacamoleSocket

public class ConfiguredGuacamoleSocket
extends Object
implements 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.

Author:
Michael Jumper

Constructor Summary
ConfiguredGuacamoleSocket(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
 void close()
          Releases all resources in use by the connection represented by this GuacamoleSocket.
 GuacamoleConfiguration getConfiguration()
          Returns the GuacamoleConfiguration used to configure this ConfiguredGuacamoleSocket.
 GuacamoleReader getReader()
          Returns a GuacamoleReader which can be used to read from the Guacamole instruction stream associated with the connection represented by this GuacamoleSocket.
 GuacamoleWriter getWriter()
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

getWriter

public GuacamoleWriter 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 interface GuacamoleSocket
Returns:
A GuacamoleWriter which can be used to write to the Guacamole instruction stream.

getReader

public GuacamoleReader 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 interface GuacamoleSocket
Returns:
A GuacamoleReader which can be used to read from the Guacamole instruction stream.

close

public void close()
           throws GuacamoleException
Description copied from interface: GuacamoleSocket
Releases all resources in use by the connection represented by this GuacamoleSocket.

Specified by:
close in interface GuacamoleSocket
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 interface GuacamoleSocket
Returns:
true if this GuacamoleSocket is open, false otherwise.


Copyright © 2012. All Rights Reserved.