com.atlassian.jira.upgrade
Class UpgradeManagerImpl

java.lang.Object
  extended by com.atlassian.jira.upgrade.UpgradeManagerImpl
All Implemented Interfaces:
Startable, UpgradeManager

public class UpgradeManagerImpl
extends Object
implements UpgradeManager, Startable


Constructor Summary
UpgradeManagerImpl(JiraLicenseService jiraLicenseService, BuildUtilsInfo buildUtilsInfo, I18nHelper.BeanFactory i18HelperFactory, ApplicationProperties applicationProperties, BuildVersionRegistry buildVersionRegistry, com.atlassian.event.api.EventPublisher eventPublisher, OfBizDelegator ofBizDelegator)
           
 
Method Summary
 Collection<String> doSetupUpgrade()
          

Performs any upgrades that may be needed as a result of the Setup procedure of JIRA

Get the set of setupUpgradeNumbers which are to be performed for this setup.

 Collection<String> doUpgradeIfNeededAndAllowed(String backupPath)
          Performs the upgrade if one is required and the license is not too old to proceed with the upgrade.
protected  AutoExport getAutoExport(String defaultBackupPath)
           
 String getExportFilePath()
          Export path of the last backup performed by this manager
 List<UpgradeHistoryItem> getUpgradeHistory()
           
 void onClearCache(ClearCacheEvent event)
           
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpgradeManagerImpl

public UpgradeManagerImpl(JiraLicenseService jiraLicenseService,
                          BuildUtilsInfo buildUtilsInfo,
                          I18nHelper.BeanFactory i18HelperFactory,
                          ApplicationProperties applicationProperties,
                          BuildVersionRegistry buildVersionRegistry,
                          com.atlassian.event.api.EventPublisher eventPublisher,
                          OfBizDelegator ofBizDelegator)
Method Detail

start

public void start()
           throws Exception
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable
Throws:
Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

doUpgradeIfNeededAndAllowed

public Collection<String> doUpgradeIfNeededAndAllowed(@Nullable
                                                      String backupPath)
                                               throws IllegalXMLCharactersException
Description copied from interface: UpgradeManager
Performs the upgrade if one is required and the license is not too old to proceed with the upgrade.

Specified by:
doUpgradeIfNeededAndAllowed in interface UpgradeManager
Parameters:
backupPath - - a path to the default location of the export, may be null, in which case no auto export will be performed
Returns:
a list of errors that occurred during the upgrade
Throws:
IllegalXMLCharactersException - if backup was impossible due to invalid XML characters

getAutoExport

protected AutoExport getAutoExport(String defaultBackupPath)

doSetupUpgrade

public Collection<String> doSetupUpgrade()
Description copied from interface: UpgradeManager

Performs any upgrades that may be needed as a result of the Setup procedure of JIRA

Get the set of setupUpgradeNumbers which are to be performed for this setup.

Iterate over these numbers and if either of the standard, professional or enterprise upgrade maps contains an UpgradeTask with this number then do the upgrade

If errors are found, it will cancel the upgrade, and return the list of errors.

For each upgrade that happens successfully, it will increment the build number in the database, so that if one fails, you do not have to repeat all the upgrades that have already run.

If there are no errors from the upgrade, the build number in the database is incremented to the current build number. This is because there may be no upgrades for a particular version & needUpgrade() checks build no in database.

Specified by:
doSetupUpgrade in interface UpgradeManager
Returns:
list of errors that occured during the upgrade process

getExportFilePath

public String getExportFilePath()
Description copied from interface: UpgradeManager
Export path of the last backup performed by this manager

Specified by:
getExportFilePath in interface UpgradeManager
Returns:
path to the last backup file

getUpgradeHistory

public List<UpgradeHistoryItem> getUpgradeHistory()
Specified by:
getUpgradeHistory in interface UpgradeManager
Returns:
the history of upgrades performed on this instance of JIRA in reverse chronological order


Copyright © 2002-2011 Atlassian. All Rights Reserved.