Package org.apache.guacamole.protocol
Class GuacamoleProtocolVersion
- java.lang.Object
-
- org.apache.guacamole.protocol.GuacamoleProtocolVersion
-
public class GuacamoleProtocolVersion extends Object
Representation of a Guacamole protocol version. Convenience methods are provided for parsing and comparing versions, as is necessary when determining the version of the Guacamole protocol common to guacd and a client.
-
-
Field Summary
Fields Modifier and Type Field Description static GuacamoleProtocolVersion
LATEST
The most recent version of the Guacamole protocol at the time this version of GuacamoleProtocolVersion was built.static GuacamoleProtocolVersion
VERSION_1_0_0
Protocol version 1.0.0 and older.static GuacamoleProtocolVersion
VERSION_1_1_0
Protocol version 1.1.0, which introduces Client-Server version detection, arbitrary handshake instruction order, and support for passing the client timezone to the server during the handshake.static GuacamoleProtocolVersion
VERSION_1_3_0
Protocol version 1.3.0, which introduces the "required" instruction allowing the server to explicitly request connection parameters from the client.static GuacamoleProtocolVersion
VERSION_1_5_0
Protocol version 1.5.0, which introduces the "msg" instruction, allowing the server to send message notifications that will be displayed on the client.
-
Constructor Summary
Constructors Constructor Description GuacamoleProtocolVersion(int major, int minor, int patch)
Generate a new GuacamoleProtocolVersion object with the given major version, minor version, and patch version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
atLeast(GuacamoleProtocolVersion otherVersion)
Returns whether this GuacamoleProtocolVersion is at least as recent as (greater than or equal to) the given version.boolean
equals(Object obj)
int
getMajor()
Return the major version component of the protocol version.int
getMinor()
Return the minor version component of the protocol version.int
getPatch()
Return the patch version component of the protocol version.int
hashCode()
static GuacamoleProtocolVersion
parseVersion(String version)
Parse the String format of the version provided and return the the enum value matching that version.String
toString()
-
-
-
Field Detail
-
VERSION_1_0_0
public static final GuacamoleProtocolVersion VERSION_1_0_0
Protocol version 1.0.0 and older. Any client that doesn't explicitly set the protocol version will negotiate down to this protocol version. This requires that handshake instructions be ordered correctly, and lacks support for certain protocol-related features introduced in later versions.
-
VERSION_1_1_0
public static final GuacamoleProtocolVersion VERSION_1_1_0
Protocol version 1.1.0, which introduces Client-Server version detection, arbitrary handshake instruction order, and support for passing the client timezone to the server during the handshake.
-
VERSION_1_3_0
public static final GuacamoleProtocolVersion VERSION_1_3_0
Protocol version 1.3.0, which introduces the "required" instruction allowing the server to explicitly request connection parameters from the client.
-
VERSION_1_5_0
public static final GuacamoleProtocolVersion VERSION_1_5_0
Protocol version 1.5.0, which introduces the "msg" instruction, allowing the server to send message notifications that will be displayed on the client. The version also adds support for the "name" handshake instruction, allowing guacd to store the name of the user who is accessing the connection.
-
LATEST
public static final GuacamoleProtocolVersion LATEST
The most recent version of the Guacamole protocol at the time this version of GuacamoleProtocolVersion was built.
-
-
Constructor Detail
-
GuacamoleProtocolVersion
public GuacamoleProtocolVersion(int major, int minor, int patch)
Generate a new GuacamoleProtocolVersion object with the given major version, minor version, and patch version.- Parameters:
major
- The integer representation of the major version component.minor
- The integer representation of the minor version component.patch
- The integer representation of the patch version component.
-
-
Method Detail
-
getMajor
public int getMajor()
Return the major version component of the protocol version.- Returns:
- The integer major version component.
-
getMinor
public int getMinor()
Return the minor version component of the protocol version.- Returns:
- The integer minor version component.
-
getPatch
public int getPatch()
Return the patch version component of the protocol version.- Returns:
- The integer patch version component.
-
atLeast
public boolean atLeast(GuacamoleProtocolVersion otherVersion)
Returns whether this GuacamoleProtocolVersion is at least as recent as (greater than or equal to) the given version.- Parameters:
otherVersion
- The version to which this GuacamoleProtocolVersion should be compared.- Returns:
- true if this object is at least as recent as the given version, false if the given version is newer.
-
parseVersion
public static GuacamoleProtocolVersion parseVersion(String version)
Parse the String format of the version provided and return the the enum value matching that version. If no value is provided, return null.- Parameters:
version
- The String format of the version to parse.- Returns:
- The enum value that matches the specified version, VERSION_1_0_0 if no match is found, or null if no comparison version is provided.
-
-