diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java index ed4ed4580..2d7bf685e 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java @@ -67,9 +67,22 @@ public class ReaderGuacamoleReader implements GuacamoleReader { this.input = input; } + /** + * The location within the received data buffer that parsing should begin + * when more data is read. + */ private int parseStart; + /** + * The buffer holding all received, unparsed data. + */ private char[] buffer = new char[20480]; + + /** + * The number of characters currently used within the data buffer. All + * other characters within the buffer are free space available for + * future reads. + */ private int usedLength = 0; @Override diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java index 134ac07d8..93577ae81 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java @@ -51,10 +51,27 @@ import net.sourceforge.guacamole.io.GuacamoleWriter; */ public class GuacamoleTunnel { + /** + * The UUID associated with this tunnel. Every tunnel must have a + * corresponding UUID such that tunnel read/write requests can be + * directed to the proper tunnel. + */ private UUID uuid; + + /** + * The GuacamoleSocket that tunnel should use for communication on + * behalf of the connecting user. + */ private GuacamoleSocket socket; + /** + * Lock acquired when a read operation is in progress. + */ private ReentrantLock readerLock; + + /** + * Lock acquired when a write operation is in progress. + */ private ReentrantLock writerLock; /** diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java index 37e42e8e2..113148192 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java @@ -63,12 +63,31 @@ import org.slf4j.LoggerFactory; */ public class InetGuacamoleSocket implements GuacamoleSocket { + /** + * Logger for this class. + */ private Logger logger = LoggerFactory.getLogger(InetGuacamoleSocket.class); + /** + * The GuacamoleReader this socket should read from. + */ private GuacamoleReader reader; + + /** + * The GuacamoleWriter this socket should write to. + */ private GuacamoleWriter writer; + /** + * The number of milliseconds to wait for data on the TCP socket before + * timing out. + */ private static final int SOCKET_TIMEOUT = 15000; + + /** + * The TCP socket that the GuacamoleReader and GuacamoleWriter exposed + * by this class should affect. + */ private Socket sock; /** diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java index 4fafc54a2..bf713b3d9 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java @@ -58,7 +58,15 @@ import net.sourceforge.guacamole.net.GuacamoleSocket; */ public class ConfiguredGuacamoleSocket implements GuacamoleSocket { + /** + * The wrapped socket. + */ private GuacamoleSocket socket; + + /** + * The configuration to use when performing the Guacamole protocol + * handshake. + */ private GuacamoleConfiguration config; /** diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java index dca225261..2e67a9cca 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java @@ -51,9 +51,19 @@ import java.util.Set; */ public class GuacamoleConfiguration implements Serializable { + /** + * Identifier unique to this version of GuacamoleConfiguration. + */ private static final long serialVersionUID = 1L; + /** + * The name of the protocol associated with this configuration. + */ private String protocol; + + /** + * Map of all associated parameter values, indexed by parameter name. + */ private Map parameters = new HashMap(); /** diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleInstruction.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleInstruction.java index dd8319b8c..d3d10a74e 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleInstruction.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleInstruction.java @@ -1,10 +1,6 @@ package net.sourceforge.guacamole.protocol; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -41,6 +37,10 @@ import java.util.List; * * ***** END LICENSE BLOCK ***** */ +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + /** * An abstract representation of a Guacamole instruction, as defined by the * Guacamole protocol. @@ -63,7 +63,7 @@ public class GuacamoleInstruction { * Creates a new GuacamoleInstruction having the given Operation and * list of arguments values. * - * @param operation The opcode of the instruction to create. + * @param opcode The opcode of the instruction to create. * @param args The list of argument values to provide in the new * instruction if any. */ diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java index 36d5517d6..7ab97d0d2 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java @@ -57,6 +57,9 @@ import org.slf4j.LoggerFactory; */ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { + /** + * Logger for this class. + */ private Logger logger = LoggerFactory.getLogger(GuacamoleHTTPTunnelServlet.class); /** diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java index f89e44bef..ef049e8c9 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java @@ -53,8 +53,14 @@ import org.slf4j.LoggerFactory; */ public class GuacamoleSession { + /** + * Logger for this class. + */ private Logger logger = LoggerFactory.getLogger(GuacamoleSession.class); + /** + * Map of all currently attached tunnels, indexed by tunnel UUID. + */ private ConcurrentMap tunnels; /**