org.firebirdsql.gds.impl

## Class GDSServerVersion

- java.lang.Object
- - org.firebirdsql.gds.impl.GDSServerVersion

- All Implemented Interfaces:
    java.io.Serializable

      public final class GDSServerVersion
      extends java.lang.Object
      implements java.io.Serializable

  Object representing a Firebird server version. The version string is returned in response to the `isc_info_firebird_version` information call. Expected version format is:

  `<platform>-<type><majorVersion>.<minorVersion>.<variant>.<buildNum> <serverName>`, and additional version string elements if present.

  where `platform` is a two-character platform identification string, Windows for example is "WI", `type` is one of the three characters: "V" - production version, "T" - beta version, "X" - development version.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CONNECTION_OPTION_COMPRESSION`
    `static java.lang.String` | `CONNECTION_OPTION_ENCRYPTED`
    `static GDSServerVersion` | `INVALID_VERSION` GDSServerVersion that can be used as a dummy/invalid object when a version object is required, but none is available.
    `static java.lang.String` | `TYPE_BETA`
    `static java.lang.String` | `TYPE_DEVELOPMENT`
    `static java.lang.String` | `TYPE_PRODUCTION`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `int` | `getBuildNumber()`
    `java.lang.String` | `getExtendedServerName()`
    `java.lang.String` | `getFullVersion()`
    `int` | `getMajorVersion()`
    `int` | `getMinorVersion()`
    `java.lang.String` | `getPlatform()`
    `int` | `getProtocolVersion()`
    `java.lang.String` | `getServerName()`
    `java.lang.String` | `getType()`
    `int` | `getVariant()`
    `int` | `hashCode()`
    `boolean` | `isEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion)` Convenience method to check if the major.minor of this version is equal to or larger than the specified required version.
    `boolean` | `isWireCompressionUsed()`
    `boolean` | `isWireEncryptionUsed()`
    `static GDSServerVersion` | `parseRawVersion(java.lang.String... versionStrings)` Parse the raw version string and create a GDSServerVersion object.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### TYPE_PRODUCTION

          public static final java.lang.String TYPE_PRODUCTION

      See Also:
        Constant Field Values

    - #### TYPE_BETA

          public static final java.lang.String TYPE_BETA

      See Also:
        Constant Field Values

    - #### TYPE_DEVELOPMENT

          public static final java.lang.String TYPE_DEVELOPMENT

      See Also:
        Constant Field Values

    - #### CONNECTION_OPTION_ENCRYPTED

          public static final java.lang.String CONNECTION_OPTION_ENCRYPTED

      See Also:
        Constant Field Values

    - #### CONNECTION_OPTION_COMPRESSION

          public static final java.lang.String CONNECTION_OPTION_COMPRESSION

      See Also:
        Constant Field Values

    - #### INVALID_VERSION

          public static final GDSServerVersion INVALID_VERSION

      GDSServerVersion that can be used as a dummy/invalid object when a version object is required, but none is available.

  - ### Method Detail

    - #### getBuildNumber

          public int getBuildNumber()

    - #### getMajorVersion

          public int getMajorVersion()

    - #### getMinorVersion

          public int getMinorVersion()

    - #### getPlatform

          public java.lang.String getPlatform()

    - #### getServerName

          public java.lang.String getServerName()

    - #### getType

          public java.lang.String getType()

    - #### getVariant

          public int getVariant()

    - #### getExtendedServerName

          public java.lang.String getExtendedServerName()

    - #### getFullVersion

          public java.lang.String getFullVersion()

    - #### getProtocolVersion

          public int getProtocolVersion()

      Returns:
        Protocol version of the connection, or `-1` if this information is not available.

    - #### isWireEncryptionUsed

          public boolean isWireEncryptionUsed()

      Returns:
        `true` if encryption is used, `false` if no encryption is used or if this information is not available

    - #### isWireCompressionUsed

          public boolean isWireCompressionUsed()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### parseRawVersion

          public static GDSServerVersion parseRawVersion(java.lang.String... versionStrings)
                                                  throws GDSServerVersionException

      Parse the raw version string and create a GDSServerVersion object.
      Parameters:
        `versionStrings` - strings to parse, expects a non-empty array with at least 1, and usually 2 version strings
      Throws:
        `GDSServerVersionException` - if versionString does not match expected pattern

    - #### isEqualOrAbove

          public boolean isEqualOrAbove(int requiredMajorVersion,
                                        int requiredMinorVersion)

      Convenience method to check if the major.minor of this version is equal to or larger than the specified required version.
      Parameters:
        `requiredMajorVersion` - Required major version
        `requiredMinorVersion` - Required minor version
      Returns:
        `true` when current major is larger than required, or major is same and minor is equal to or larger than required

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.