Oracle Entitlements Server for Java API Reference

com.bea.security
Class ServiceVersion

java.lang.Object
  |
  +--com.bea.security.ServiceVersion

public class ServiceVersion
extends java.lang.Object

This class identifies the version of a security service by major number, minor number, and patch level. The ServiceVersion class is used to represent a service version. The service version is encapsulation of the current version of the service and it is useful for managing compatibility within your application. A service version contains a major number, minor number, and a string for the patch number, which is represented as a string, for example 1.0sp1, or 1.1sp2, etc.

When the service type is returned by the security runtime service, the application can use this class to determine which version of the service is running on the security runtime instance. The service version can then be used by the application to determine whether the application is compatible with the service that is running. For example, if you have programmed your application to be compatible with Authentication Service version 1.0, then you can instantiate an Authentication Service version 1.0, pass it into the Authentication Service using the com.bea.security.AuthenticationService.isCompatible method and return whether or not the Authentication Service API that you just fetched is compatible with API version 1.0.

Author:
Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.

Constructor Summary
ServiceVersion()
          Constructs a ServiceVersion with version 0.0 and no patch level.
ServiceVersion(int major, int minor)
          Constructs a ServiceVersion passing in the major and minor version numbers.
ServiceVersion(int major, int minor, java.lang.String patch)
          Constructs a ServiceVersion passing in the major and minor version numbers and a patch level.
 
Method Summary
 boolean equals(ServiceVersion version)
          Overrides the default implementation to check both the major and minor number
 int getMajorVersion()
          Gets the major number of this ServiceVersion.
 int getMinorVersion()
          Gets the minor number of this ServiceVersion.
 java.lang.String getPatchLevel()
          Gets the patch level of this ServiceVersion.
 long getVersion()
          Gets the version represented as one number.
 void setMajorVersion(int major)
          Sets the major number of this ServiceVersion.
 void setMinorVersion(int minor)
          Sets the minor number of this ServiceVersion.
 void setPatchLevel(java.lang.String patch)
          Sets the patch level of this ServiceVersion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceVersion

public ServiceVersion()
Constructs a ServiceVersion with version 0.0 and no patch level.

ServiceVersion

public ServiceVersion(int major,
                      int minor)
Constructs a ServiceVersion passing in the major and minor version numbers.

Parameters:
major - the major version of this service.
minor - the minor version of this service.

ServiceVersion

public ServiceVersion(int major,
                      int minor,
                      java.lang.String patch)
Constructs a ServiceVersion passing in the major and minor version numbers and a patch level.

Parameters:
major - the major version of this service.
minor - the minor version of this service.
patch - the patch level of this version represented as a String. This string will always be converted to lower case when stored.
Method Detail

getMajorVersion

public int getMajorVersion()
Gets the major number of this ServiceVersion.

Returns:
an int that is the major version number.

getMinorVersion

public int getMinorVersion()
Gets the minor number of this ServiceVersion.

Returns:
an int that is the minor version number.

getVersion

public long getVersion()
Gets the version represented as one number.

Returns:
a long that is the major version and the minor version number masked together.

getPatchLevel

public java.lang.String getPatchLevel()
Gets the patch level of this ServiceVersion.

Returns:
the patch level as a String.

setMajorVersion

public void setMajorVersion(int major)
Sets the major number of this ServiceVersion.

Parameters:
major - The major number of this version as an int.

setMinorVersion

public void setMinorVersion(int minor)
Sets the minor number of this ServiceVersion.

Parameters:
minor - the minor number of this version as an int.

setPatchLevel

public void setPatchLevel(java.lang.String patch)
Sets the patch level of this ServiceVersion.

Parameters:
patch - the patch level of this version as a String. Patch levels are always converted to all lower case.

equals

public boolean equals(ServiceVersion version)
Overrides the default implementation to check both the major and minor number

Parameters:
version - ServiceVersion
Returns:
boolean