|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> services >> [ info overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.iapi.services.info
Class ProductVersionHolder

java.lang.Objectorg.apache.derby.iapi.services.info.ProductVersionHolder
- All Implemented Interfaces:
- java.security.PrivilegedAction
- public final class ProductVersionHolder
- extends java.lang.Object
- implements java.security.PrivilegedAction
- extends java.lang.Object
Class to hold a cloudscape Product version. This class includes the following product version features.
- Save the product version information this holds as a String. We call the string a 'product version string'.
- Construct a ProductVersionHolder from a valid 'product version string'.
- Determine if two product versions are feature compatible. This means products of these versions may interoperate with ***NO*** compatibility problems.
- Determine if two product versions are the same. This is a stronger test than the test for feature compatibility.
productVendorName - ProductName - majorVersion.minorVersion.maintVersion [beta] - (buildNumber)
| Field Summary | |
private static java.lang.String |
ALPHA
|
private static int |
BAD_NUMBER
|
private static java.lang.String |
BETA
|
private java.lang.String |
buildNumber
|
private int |
drdaMaintVersion
|
private java.lang.Boolean |
isBeta
|
private static int |
MAINT_ENCODING
|
private int |
maintVersion
|
private int |
majorVersion
|
private int |
minorVersion
|
private java.lang.String |
productGenus
|
private java.lang.String |
productName
|
private java.lang.String |
productTechnologyName
|
private java.lang.String |
productVendorName
|
| Constructor Summary | |
private |
ProductVersionHolder()
|
private |
ProductVersionHolder(java.lang.String productVendorName,
java.lang.String productName,
java.lang.String productTechnologyName,
int majorVersion,
int minorVersion,
int maintVersion,
int drdaMaintVersion,
java.lang.String buildNumber,
java.lang.Boolean isBeta)
Create a ProductVersionHolder |
| Method Summary | |
static java.lang.String |
fullVersionString(int major,
int minor,
int maint,
boolean isBeta,
java.lang.String build)
|
java.lang.String |
getBuildNumber()
Return the build number for this product. |
int |
getBuildNumberAsInt()
Return the build number as an integer if possible, mapping from the SVN number. |
int |
getDrdaMaintVersion()
Return the drda protocol maintenance version for this minor release. |
int |
getFixPackVersion()
Return the fix pack version from the maintence encoding. |
int |
getMaintVersion()
Return the encoded maintainence version number. |
int |
getMajorVersion()
Return the major version number. |
int |
getMinorVersion()
Return the minor version number. |
java.lang.String |
getProductName()
Return the external product name. |
java.lang.String |
getProductTechnologyName()
|
java.lang.String |
getProductVendorName()
Return the product vendor name. |
static ProductVersionHolder |
getProductVersionHolder(java.util.Properties p)
Get a ProductVersionHolder based on the information in the Properties object provided. |
static ProductVersionHolder |
getProductVersionHolder(java.lang.String productVendorName,
java.lang.String productName,
java.lang.String productTechnologyName,
int majorVersion,
int minorVersion,
int maintVersion,
int drdaMaintVersion,
java.lang.String buildNumber,
java.lang.Boolean isBeta)
Create a valid ProductVersionHolder. |
static ProductVersionHolder |
getProductVersionHolderFromMyEnv(java.io.InputStream propertiesStream)
Load the version info from the already opened properties files. |
static ProductVersionHolder |
getProductVersionHolderFromMyEnv(java.lang.String productGenus)
Get a ProductVersionHolder for a product of a given genus, that is available in the caller's environment. |
java.lang.String |
getSimpleVersionString()
Return the feature version string, ie. |
java.lang.String |
getVersionBuildString(boolean withBuild)
Returns a short-hand value for the product version string. |
boolean |
isAlpha()
Return true if this is a alpha product. |
boolean |
isBeta()
Return true if this is a beta product. |
private java.util.Properties |
loadProperties(java.lang.String productGenus)
|
private static int |
parseInt(java.lang.String s)
Parse a string containing a non-negative integer. |
java.lang.Object |
run()
This method performs an operation that requires higher privileges to perform. |
static java.lang.String |
simpleVersionString(int major,
int minor,
boolean isBeta)
Convert a major and minor number with beta status into a string. |
java.lang.String |
toString()
Return a string representation of this ProductVersion. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
BAD_NUMBER
private static final int BAD_NUMBER
- See Also:
- Constant Field Values
ALPHA
private static final java.lang.String ALPHA
- See Also:
- Constant Field Values
BETA
private static final java.lang.String BETA
- See Also:
- Constant Field Values
MAINT_ENCODING
private static final int MAINT_ENCODING
- See Also:
- Constant Field Values
productVendorName
private java.lang.String productVendorName
productName
private java.lang.String productName
productTechnologyName
private java.lang.String productTechnologyName
majorVersion
private int majorVersion
minorVersion
private int minorVersion
maintVersion
private int maintVersion
drdaMaintVersion
private int drdaMaintVersion
buildNumber
private java.lang.String buildNumber
isBeta
private java.lang.Boolean isBeta
productGenus
private java.lang.String productGenus
| Constructor Detail |
ProductVersionHolder
private ProductVersionHolder()
ProductVersionHolder
private ProductVersionHolder(java.lang.String productVendorName, java.lang.String productName, java.lang.String productTechnologyName, int majorVersion, int minorVersion, int maintVersion, int drdaMaintVersion, java.lang.String buildNumber, java.lang.Boolean isBeta)
- Create a ProductVersionHolder
Please see the documentation for the varient of getProductVesionHolder that takes the same parameters as this for a description of the parameters.
| Method Detail |
getProductVersionHolder
public static ProductVersionHolder getProductVersionHolder(java.lang.String productVendorName, java.lang.String productName, java.lang.String productTechnologyName, int majorVersion, int minorVersion, int maintVersion, int drdaMaintVersion, java.lang.String buildNumber, java.lang.Boolean isBeta)
- Create a valid ProductVersionHolder. If any of the
parameters provided is invalid, this returns null.
getProductVersionHolderFromMyEnv
public static ProductVersionHolder getProductVersionHolderFromMyEnv(java.lang.String productGenus)
- Get a ProductVersionHolder for a product of a given genus,
that is available in the caller's environment.
Even though this uses a priv bock, it may stil fail when
the jar the version is being fetched from, is different to the
one that loaded this class, AND the jars are in different security contexts.
getProductVersionHolderFromMyEnv
public static ProductVersionHolder getProductVersionHolderFromMyEnv(java.io.InputStream propertiesStream)
- Load the version info from the already opened properties files.
We need to do this because if the jar files (e.g. db2jtools and db2j)
are in different security contexts (entries in the policy files) then
we cannot load the version information for one of them correctly.
This is because the this class will either have been loaded from
only one of the jars and hence can only access the resource in its own jar.
By making code specific to the jar open the resource we are guaranteed it will work.
getProductVersionHolder
public static ProductVersionHolder getProductVersionHolder(java.util.Properties p)
- Get a ProductVersionHolder based on the information in
the Properties object provided.
getProductVendorName
public java.lang.String getProductVendorName()
- Return the product vendor name.
getProductName
public java.lang.String getProductName()
- Return the external product name.
getProductTechnologyName
public java.lang.String getProductTechnologyName()
getMajorVersion
public int getMajorVersion()
- Return the major version number.
getMinorVersion
public int getMinorVersion()
- Return the minor version number.
getMaintVersion
public int getMaintVersion()
- Return the encoded maintainence version number.
getDrdaMaintVersion
public int getDrdaMaintVersion()
- Return the drda protocol maintenance version for this minor release.
Starts at 0 for each minor release and only incremented
when client behaviour changes based on the server version.
getFixPackVersion
public int getFixPackVersion()
- Return the fix pack version from the maintence encoding.
isBeta
public boolean isBeta()
- Return true if this is a beta product.
isAlpha
public boolean isAlpha()
- Return true if this is a alpha product.
getBuildNumber
public java.lang.String getBuildNumber()
- Return the build number for this product.
getBuildNumberAsInt
public int getBuildNumberAsInt()
- Return the build number as an integer if possible,
mapping from the SVN number.
nnnnn -> returns nnnnn
nnnnnM -> returns -nnnnn indicates a modified code base
nnnnn:mmmmm -> returns -nnnnn
anything else -> returns -1
parseInt
private static int parseInt(java.lang.String s)
- Parse a string containing a non-negative integer. Return
a negative integer is the String is invalid.
toString
public java.lang.String toString()
- Return a string representation of this ProductVersion. The
difference between this and createProductVersionString, is
that this method retruns a String when this ProductVersionHolder
holds invalid version information.
getSimpleVersionString
public java.lang.String getSimpleVersionString()
- Return the feature version string, ie. major.minor. (e.g. 5.2)
simpleVersionString
public static java.lang.String simpleVersionString(int major, int minor, boolean isBeta)
- Convert a major and minor number with beta status into a string.
fullVersionString
public static java.lang.String fullVersionString(int major, int minor, int maint, boolean isBeta, java.lang.String build)
getVersionBuildString
public java.lang.String getVersionBuildString(boolean withBuild)
- Returns a short-hand value for the product version string.
Used by Sysinfo.
Includes the optional
designation
run
public java.lang.Object run()
- Description copied from interface:
java.security.PrivilegedAction - This method performs an operation that requires higher privileges to
perform. It is called when a section of code invokes
AccessController.doPrivileged().- Specified by:
runin interfacejava.security.PrivilegedAction
loadProperties
private java.util.Properties loadProperties(java.lang.String productGenus)
|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> services >> [ info overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.derby.iapi.services.info.ProductVersionHolder