com.atlassian.jira.upgrade
Class AAddOnUpgradeManager

java.lang.Object
  extended by com.atlassian.jira.upgrade.AAddOnUpgradeManager
All Implemented Interfaces:
IAddOnUpgradeManager
Direct Known Subclasses:
KAAMUpgradeManager

public abstract class AAddOnUpgradeManager
extends java.lang.Object
implements IAddOnUpgradeManager

Version:
$Id$
Author:
BNP Paribas - SIG/CGI/SFRI - 2005 Description :

Constructor Summary
protected AAddOnUpgradeManager()
           
protected AAddOnUpgradeManager(java.util.Collection addOnUpgrades)
           
  AAddOnUpgradeManager(java.lang.String addOnFileName)
           
 
Method Summary
protected  void addAllUpgrades(java.util.Map upgradeSet, java.lang.String fileName)
          Reads an upgrade XML file to get a list of all the upgrades specified in this file and adds these upgrades the upgradeSet accordingly

For every upgrade element, load the class specified by the class element.

 void addToUpgradeHistory(java.lang.Class upgradeClass)
           
 java.util.Collection doUpgradeIfNeeded()
           
 java.lang.String getAddOnBuildNumber()
          Get the current build number from the database.
 java.util.SortedMap getAllAddOnUpgrades()
           
abstract  java.lang.String getCurrentAddOnBuildNumber()
          Get Current AddOn Build Number provided by release
abstract  java.lang.String getKeyParameter()
           
 java.util.SortedMap getRelevantUpgradesFromList(java.util.Map upgradeMap)
          For each upgrade in the upgradeMap, test whether it is needed (ie upgrade version is greater than the version in the database), and then add to set.
abstract  java.lang.String getRequiredJiraBuildNumber()
          Get the Required JIRA Build Number to perform provided Upgrades
 boolean isUpgradable()
          Returns true if the current build number is not equal to the build number in the database.
 boolean needUpgrade()
          Returns true if the current build number is not equal to the build number in the database.
 void printErrors(java.util.Collection errors)
          Print errors to log4j at error level
 void setAddOnBuildNumber(java.lang.String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.upgrade.IAddOnUpgradeManager
getAddOnFileName
 

Constructor Detail

AAddOnUpgradeManager

protected AAddOnUpgradeManager()

AAddOnUpgradeManager

protected AAddOnUpgradeManager(java.util.Collection addOnUpgrades)

AAddOnUpgradeManager

public AAddOnUpgradeManager(java.lang.String addOnFileName)
Method Detail

addAllUpgrades

protected void addAllUpgrades(java.util.Map upgradeSet,
                              java.lang.String fileName)
Reads an upgrade XML file to get a list of all the upgrades specified in this file and adds these upgrades the upgradeSet accordingly

For every upgrade element, load the class specified by the class element. Put this class into the upgradeSet Map with the build attribute as the key.


getRelevantUpgradesFromList

public java.util.SortedMap getRelevantUpgradesFromList(java.util.Map upgradeMap)
For each upgrade in the upgradeMap, test whether it is needed (ie upgrade version is greater than the version in the database), and then add to set.

Specified by:
getRelevantUpgradesFromList in interface IAddOnUpgradeManager
Returns:
set of UpgradeTasks that need to be run.

doUpgradeIfNeeded

public java.util.Collection doUpgradeIfNeeded()
Specified by:
doUpgradeIfNeeded in interface IAddOnUpgradeManager
See Also:
doUpgradeIfNeeded()

addToUpgradeHistory

public void addToUpgradeHistory(java.lang.Class upgradeClass)
                         throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

getAllAddOnUpgrades

public java.util.SortedMap getAllAddOnUpgrades()
Specified by:
getAllAddOnUpgrades in interface IAddOnUpgradeManager
See Also:
getAllAddOnUpgrades()

isUpgradable

public boolean isUpgradable()
Returns true if the current build number is not equal to the build number in the database. NB - There may not be any upgrades to run. However, you will need to run doUpgrade() to increment the build number in the database.


needUpgrade

public boolean needUpgrade()
Returns true if the current build number is not equal to the build number in the database. NB - There may not be any upgrades to run. However, you will need to run doUpgrade() to increment the build number in the database.

Specified by:
needUpgrade in interface IAddOnUpgradeManager

getAddOnBuildNumber

public java.lang.String getAddOnBuildNumber()
Get the current build number from the database. This represents the level that this application is patched to. This may be different to the current version if there are patches waiting to be applied.

Specified by:
getAddOnBuildNumber in interface IAddOnUpgradeManager
Returns:
The version information from the database

setAddOnBuildNumber

public void setAddOnBuildNumber(java.lang.String version)

getCurrentAddOnBuildNumber

public abstract java.lang.String getCurrentAddOnBuildNumber()
Get Current AddOn Build Number provided by release

Specified by:
getCurrentAddOnBuildNumber in interface IAddOnUpgradeManager

getRequiredJiraBuildNumber

public abstract java.lang.String getRequiredJiraBuildNumber()
Get the Required JIRA Build Number to perform provided Upgrades


printErrors

public void printErrors(java.util.Collection errors)
Print errors to log4j at error level

Specified by:
printErrors in interface IAddOnUpgradeManager
Parameters:
errors - A collection of strings, describing all the errors that occurred.
See Also:
printErrors(java.util.Collection)

getKeyParameter

public abstract java.lang.String getKeyParameter()
Specified by:
getKeyParameter in interface IAddOnUpgradeManager
Returns:


Copyright © 2007-2008 Kaamelot Plugins. All Rights Reserved.