Class 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 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.
      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object