org.apache.qpid.common
Class QpidProperties

java.lang.Object
  extended by org.apache.qpid.common.QpidProperties

public class QpidProperties
extends Object

QpidProperties captures the project name, version number, and source code repository revision number from a properties file which is generated as part of the build process. Normally, the name and version number are pulled from the module name and version number of the Maven build POM, but could come from other sources if the build system is changed. The idea behind this, is that every build has these values incorporated directly into its jar file, so that code in the wild can be identified, should its origination be forgotten.

To get the build version of any Qpid code call the main(java.lang.String[]) method. This version string is usually also printed to the console on broker start up.

CRC Card
Load build versioning information into the runtime, for code identification purposes.

Todo:
Code to locate/load/log properties can be factored into a reusable properties utils class. Avoid having this same snippet of loading code scattered in many places., Could also add a build number property for a sequential build number assigned by an automated build system, for build reproducability purposes.

Field Summary
static String BUILD_VERSION_PROPERTY
          Defines the name of the source code revision property.
static String PRODUCT_NAME_PROPERTY
          Defines the name of the product property.
static String RELEASE_VERSION_PROPERTY
          Defines the name of the version property.
static String VERSION_RESOURCE
          The name of the version properties file to load from the class path.
 
Constructor Summary
QpidProperties()
           
 
Method Summary
static String getBuildVersion()
          Gets the source code revision.
static String getProductName()
          Gets the product name.
static String getReleaseVersion()
          Gets the product version.
static String getVersionString()
          Extracts all of the version information as a printable string.
static void main(String[] args)
          Prints the versioning information to the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_RESOURCE

public static final String VERSION_RESOURCE
The name of the version properties file to load from the class path.

See Also:
Constant Field Values

PRODUCT_NAME_PROPERTY

public static final String PRODUCT_NAME_PROPERTY
Defines the name of the product property.

See Also:
Constant Field Values

RELEASE_VERSION_PROPERTY

public static final String RELEASE_VERSION_PROPERTY
Defines the name of the version property.

See Also:
Constant Field Values

BUILD_VERSION_PROPERTY

public static final String BUILD_VERSION_PROPERTY
Defines the name of the source code revision property.

See Also:
Constant Field Values
Constructor Detail

QpidProperties

public QpidProperties()
Method Detail

getProductName

public static String getProductName()
Gets the product name.

Returns:
The product name.

getReleaseVersion

public static String getReleaseVersion()
Gets the product version.

Returns:
The product version.

getBuildVersion

public static String getBuildVersion()
Gets the source code revision.

Returns:
The source code revision.

getVersionString

public static String getVersionString()
Extracts all of the version information as a printable string.

Returns:
All of the version information as a printable string.

main

public static void main(String[] args)
Prints the versioning information to the console. This is extremely usefull for identifying Qpid code in the wild, where the origination of the code has been forgotten.

Parameters:
args - Does not require any arguments.


Licensed to the Apache Software Foundation