public class BuildVersion extends Object implements Comparable<BuildVersion>
Constructor and Description |
---|
BuildVersion(int major,
int minor,
int point,
long rev)
Creates a new build version using the provided version information.
|
Modifier and Type | Method and Description |
---|---|
static BuildVersion |
binaryVersion(org.forgerock.opendj.ldap.Connection connection)
Returns the build version as specified in the entry "cn=Version,cn=monitor".
|
static void |
checkVersionMismatch(org.forgerock.opendj.ldap.Connection connection)
Checks if the binary version is the same than the instance version.
|
int |
compareTo(BuildVersion version) |
boolean |
equals(Object obj) |
int |
getMajorVersion()
Returns the major release version number.
|
int |
getMinorVersion()
Returns the minor release version number.
|
int |
getPointVersion()
Returns the point release version number.
|
long |
getRevisionNumber()
Returns the VCS revision number.
|
int |
hashCode() |
static BuildVersion |
instanceVersion()
Reads the instance version from config/buildinfo.
|
String |
toString()
Returns the string representation of the version.
|
static BuildVersion |
valueOf(String s)
Parses the string argument as a build version.
|
public BuildVersion(int major, int minor, int point, long rev)
major
- Major release version number.minor
- Minor release version number.point
- Point release version number.rev
- VCS revision number.public static BuildVersion binaryVersion(org.forgerock.opendj.ldap.Connection connection) throws ConfigException
connection
- The connection to use to read the entry.ConfigException
- Sends an exception if it is impossible to retrieve the version configuration entry.public static void checkVersionMismatch(org.forgerock.opendj.ldap.Connection connection) throws ConfigException
connection
- The connection to use to read the configuration entry.ConfigException
- Sends an exception if the version mismatch.public static BuildVersion instanceVersion() throws ConfigException
ConfigException
- If an error occurred while reading or parsing the version.public static BuildVersion valueOf(String s)
major.minor.point.rev
s
- The string to be parsed as a build version.IllegalArgumentException
- If the string does not contain a parsable build version.public int getMajorVersion()
public int getMinorVersion()
public int getPointVersion()
public int compareTo(BuildVersion version)
compareTo
in interface Comparable<BuildVersion>
public long getRevisionNumber()
Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.