java.lang.Object
org.firebirdsql.gds.impl.GDSServerVersion
- All Implemented Interfaces:
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>[-<revision>] <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:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
int
int
int
getType()
int
int
hashCode()
boolean
isEqualOrAbove
(int requiredMajorVersion) Convenience method to check if the major of this version is equal to or larger than the specified required version.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
isEqualOrAbove
(int requiredMajorVersion, int requiredMinorVersion, int requiredVariant) Convenience method to check if the major.minor.variant of this version is equal to or larger than the specified required version.boolean
boolean
static GDSServerVersion
parseRawVersion
(String... versionStrings) Parse the raw version string and create a GDSServerVersion object.toString()
-
Field Details
-
TYPE_PRODUCTION
- See Also:
-
TYPE_BETA
- See Also:
-
TYPE_DEVELOPMENT
- See Also:
-
CONNECTION_OPTION_ENCRYPTED
- See Also:
-
CONNECTION_OPTION_COMPRESSION
- See Also:
-
INVALID_VERSION
GDSServerVersion that can be used as a dummy/invalid object when a version object is required, but none is available.
-
-
Method Details
-
getBuildNumber
public int getBuildNumber() -
getMajorVersion
public int getMajorVersion() -
getMinorVersion
public int getMinorVersion() -
getPlatform
-
getServerName
-
getType
-
getVariant
public int getVariant() -
getExtendedServerName
-
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() -
equals
-
toString
-
parseRawVersion
public static GDSServerVersion parseRawVersion(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) Convenience method to check if the major of this version is equal to or larger than the specified required version.- Parameters:
requiredMajorVersion
- Required major version- Returns:
true
when current major is equal to or larger than required- Since:
- 6
-
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 versionrequiredMinorVersion
- 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
-
isEqualOrAbove
public boolean isEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion, int requiredVariant) Convenience method to check if the major.minor.variant of this version is equal to or larger than the specified required version.- Parameters:
requiredMajorVersion
- Required major versionrequiredMinorVersion
- Required minor versionrequiredVariant
- Required variant version- Returns:
true
when current major is larger than required, or major is same and minor is equal to required and variant equal to or larger than required, or major is same and minor is larger than required
-