com.atlassian.bamboo.upgrade
Class UpgradeManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.upgrade.UpgradeManagerImpl
All Implemented Interfaces:
UpgradeManager

public class UpgradeManagerImpl
extends java.lang.Object
implements UpgradeManager


Constructor Summary
UpgradeManagerImpl()
           
UpgradeManagerImpl(java.lang.String fileName)
           
UpgradeManagerImpl(java.lang.String newBuildNumber, java.lang.String fileName)
           
 
Method Summary
protected  UpgradeTask createUpgradeTask(java.lang.String className)
           
 java.util.Collection doUpgrade(boolean partOfSetup)
          Method to fire off the upgrade process
 com.atlassian.config.ApplicationConfiguration getApplicationConfig()
           
 java.lang.String getBuildNumber()
          This gets the pre-build number
 java.lang.String getFileName()
           
 java.lang.String getNewBuildNumber()
           
protected  org.dom4j.Document getUpgradeDocument()
           
 java.util.SortedMap getUpgrades()
          Gets a map of upgrade tasks which need to run.
 boolean isFullReindexWhenUpgradesFinish()
           
 boolean needUpgrade()
          Determines whether we need to run the upgrade or not.
protected  void populateRelevantUpgrades()
           
 void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig)
           
 void setBuildNumber(java.lang.String buildNumber)
           
 void setBuildResultsIndexer(BuildResultsIndexer buildResultsIndexer)
           
 void setFileName(java.lang.String fileName)
           
 void setFullReindexWhenUpgradesFinish(boolean fullReindexWhenUpgradesFinish)
          Marks that the UpgradeManger should do a full reindex when all upgrades have finished successfully
 void setNewBuildNumber(java.lang.String newBuildNumber)
           
 void setSystemStatisticsBean(SystemStatisticsBean systemStatisticsBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpgradeManagerImpl

public UpgradeManagerImpl(java.lang.String newBuildNumber,
                          java.lang.String fileName)

UpgradeManagerImpl

public UpgradeManagerImpl(java.lang.String fileName)

UpgradeManagerImpl

public UpgradeManagerImpl()
Method Detail

needUpgrade

public boolean needUpgrade()
Description copied from interface: UpgradeManager
Determines whether we need to run the upgrade or not.

Specified by:
needUpgrade in interface UpgradeManager
Returns:
boolean whether the build was successful or not

doUpgrade

public java.util.Collection doUpgrade(boolean partOfSetup)
                               throws java.lang.Exception
Description copied from interface: UpgradeManager
Method to fire off the upgrade process

Specified by:
doUpgrade in interface UpgradeManager
Parameters:
partOfSetup - - whether or not the upgrade is being run as part of the setup
Returns:
Collection a string collection of error messages. Collection not empty denotes error occured on upgrade
Throws:
java.lang.Exception

populateRelevantUpgrades

protected void populateRelevantUpgrades()

createUpgradeTask

protected UpgradeTask createUpgradeTask(java.lang.String className)
                                 throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getUpgradeDocument

protected org.dom4j.Document getUpgradeDocument()
                                         throws org.dom4j.DocumentException
Throws:
org.dom4j.DocumentException

getBuildNumber

public java.lang.String getBuildNumber()
Description copied from interface: UpgradeManager
This gets the pre-build number

Specified by:
getBuildNumber in interface UpgradeManager
Returns:
the current build number (in application config file)

setBuildNumber

public void setBuildNumber(java.lang.String buildNumber)
                    throws com.atlassian.config.ConfigurationException
Throws:
com.atlassian.config.ConfigurationException

getUpgrades

public java.util.SortedMap getUpgrades()
Description copied from interface: UpgradeManager
Gets a map of upgrade tasks which need to run.

Specified by:
getUpgrades in interface UpgradeManager
Returns:
SortedMap map of upgrade tasks, keys are the string representations of the build number.

getNewBuildNumber

public java.lang.String getNewBuildNumber()

setNewBuildNumber

public void setNewBuildNumber(java.lang.String newBuildNumber)

getApplicationConfig

public com.atlassian.config.ApplicationConfiguration getApplicationConfig()

setApplicationConfig

public void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig)

getFileName

public java.lang.String getFileName()

setFileName

public void setFileName(java.lang.String fileName)

isFullReindexWhenUpgradesFinish

public boolean isFullReindexWhenUpgradesFinish()
Specified by:
isFullReindexWhenUpgradesFinish in interface UpgradeManager

setFullReindexWhenUpgradesFinish

public void setFullReindexWhenUpgradesFinish(boolean fullReindexWhenUpgradesFinish)
Description copied from interface: UpgradeManager
Marks that the UpgradeManger should do a full reindex when all upgrades have finished successfully

Specified by:
setFullReindexWhenUpgradesFinish in interface UpgradeManager

setBuildResultsIndexer

public void setBuildResultsIndexer(BuildResultsIndexer buildResultsIndexer)

setSystemStatisticsBean

public void setSystemStatisticsBean(SystemStatisticsBean systemStatisticsBean)


Copyright © 2010 Atlassian. All Rights Reserved.