uPortal 2.4.1
API Documentation

org.jasig.portal.tools.versioning
Class VersionsManager

java.lang.Object
  extended byorg.jasig.portal.tools.versioning.VersionsManager

public class VersionsManager
extends java.lang.Object

Provides access to and persistence of version information for pieces of code installed in the portal. Identification of pieces of code is by functional name. Version is represented by three integers. In most significant order these are Major, Minor, and Micro.

Version:
$Revision: 1.2 $
Author:
Mark Boyd

Method Summary
static VersionsManager getInstance()
          Returns the singleton instance of the VersionsManager.
 Version getVersion(java.lang.String fname)
          Returns the version for a specified functional name or null if no version information is available.
 Version[] getVersions()
          Returns an array of Versions representing all version information registered with the VersionsManager.
 boolean removeVersion(java.lang.String fname)
          Removes version information for the specified functional name.
 boolean setVersion(java.lang.String fname, java.lang.String description, int major, int minor, int micro)
          Updates the version information for the indicated functional name to the passed in values only if: a) a version already exists and the values in the database match those obtained via getVersion(fname).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final VersionsManager getInstance()
Returns the singleton instance of the VersionsManager.

Returns:
VersionManager

getVersions

public Version[] getVersions()
Returns an array of Versions representing all version information registered with the VersionsManager.

Returns:
Version[]

getVersion

public Version getVersion(java.lang.String fname)
Returns the version for a specified functional name or null if no version information is available.

Parameters:
fname - java.lang.String
Returns:
Version

removeVersion

public boolean removeVersion(java.lang.String fname)
Removes version information for the specified functional name. Returns true if version information existed and was removed.

Parameters:
fname - java.lang.String
Returns:
boolean

setVersion

public boolean setVersion(java.lang.String fname,
                          java.lang.String description,
                          int major,
                          int minor,
                          int micro)
Updates the version information for the indicated functional name to the passed in values only if: a) a version already exists and the values in the database match those obtained via getVersion(fname). A database update is performed in this case. b) a version does not already exist for this functional name. A database insert is performed in this case. Returns true if this call resulted in a database change. Use of primary keys in the database table is critical for (b) in the scenario where more than one portal is running against the same database to prevent two inserts to the table from succeeding and masking which portal successfully changed the version.

Parameters:
fname -
major -
minor -
micro -
Returns:
boolean

uPortal 2.4.1
API Documentation