org.rhq.enterprise.client
Class Version

java.lang.Object
  extended by org.rhq.enterprise.client.Version

public class Version
extends Object

Utility that can be used to determine the version of the software.

Author:
John Mazzitelli

Field Summary
static String PROP_BUILD_DATE
          Version property whose value is the date when this version of the product was built.
static String PROP_BUILD_JDK_VENDOR
          Version property whose value is the vendor of the JDK that built this version of the product.
static String PROP_BUILD_JDK_VERSION
          Version property whose value is the version of the JDK that built this version of the product.
static String PROP_BUILD_NUMBER
          Version property whose value is the source code revision number used to make the build.
static String PROP_BUILD_OS_NAME
          Version property whose value identifies the build machine's operating system.
static String PROP_BUILD_OS_VERSION
          Version property whose value is the build machine's operating system version.
static String PROP_PRODUCT_NAME
          Version property whose value is the product name.
static String PROP_PRODUCT_VERSION
          Version property whose value is the product version.
 
Constructor Summary
Version()
           
 
Method Summary
static String getBuildDate()
          Returns just the product build date.
static String getBuildNumber()
          Returns just the product build number.
static String getProductName()
          Returns just the product name.
static String getProductNameAndVersion()
          Returns the product name and its version string.
static String getProductNameAndVersionBuildInfo()
          Returns the product name and its version string, with more build details about the version.
static String getProductVersion()
          Returns just the product version.
static Properties getVersionProperties()
          Returns a set of properties that can be used to identify this version of the product.
static String getVersionPropertiesAsString()
          Returns the version properties in a single string with all properties on a single line separated with a newline.
static void main(String[] args)
          A main method that can be used to determine the version information from a command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_PRODUCT_NAME

public static final String PROP_PRODUCT_NAME
Version property whose value is the product name.

See Also:
Constant Field Values

PROP_PRODUCT_VERSION

public static final String PROP_PRODUCT_VERSION
Version property whose value is the product version.

See Also:
Constant Field Values

PROP_BUILD_NUMBER

public static final String PROP_BUILD_NUMBER
Version property whose value is the source code revision number used to make the build.

See Also:
Constant Field Values

PROP_BUILD_DATE

public static final String PROP_BUILD_DATE
Version property whose value is the date when this version of the product was built.

See Also:
Constant Field Values

PROP_BUILD_JDK_VENDOR

public static final String PROP_BUILD_JDK_VENDOR
Version property whose value is the vendor of the JDK that built this version of the product.

See Also:
Constant Field Values

PROP_BUILD_JDK_VERSION

public static final String PROP_BUILD_JDK_VERSION
Version property whose value is the version of the JDK that built this version of the product.

See Also:
Constant Field Values

PROP_BUILD_OS_NAME

public static final String PROP_BUILD_OS_NAME
Version property whose value identifies the build machine's operating system.

See Also:
Constant Field Values

PROP_BUILD_OS_VERSION

public static final String PROP_BUILD_OS_VERSION
Version property whose value is the build machine's operating system version.

See Also:
Constant Field Values
Constructor Detail

Version

public Version()
Method Detail

main

public static void main(String[] args)
A main method that can be used to determine the version information from a command line.

Parameters:
args - the version properties to print to stdout; if no arguments are given then all version properties are printed

getProductNameAndVersion

public static String getProductNameAndVersion()
Returns the product name and its version string.

Returns:
"productName Version"

getProductNameAndVersionBuildInfo

public static String getProductNameAndVersionBuildInfo()
Returns the product name and its version string, with more build details about the version.

Returns:
"productName Version"

getProductName

public static String getProductName()
Returns just the product name.

Returns:
product name

getProductVersion

public static String getProductVersion()
Returns just the product version.

Returns:
product version

getBuildDate

public static String getBuildDate()
Returns just the product build date.

Returns:
product build date

getBuildNumber

public static String getBuildNumber()
Returns just the product build number.

Returns:
product build number

getVersionProperties

public static Properties getVersionProperties()
Returns a set of properties that can be used to identify this version of the product.

Returns:
properties identifying this version
Throws:
RuntimeException - if there is no version info found in the current thread's class loader

getVersionPropertiesAsString

public static String getVersionPropertiesAsString()
Returns the version properties in a single string with all properties on a single line separated with a newline.

Returns:
the version properties in one big string


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.