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 java.lang.Object
implements UpgradeManager, Startable


Constructor Summary
UpgradeManagerImpl(JiraLicenseService jiraLicenseService, BuildUtilsInfo buildUtilsInfo, I18nHelper.BeanFactory i18HelperFactory, ApplicationProperties applicationProperties, BuildVersionRegistry buildVersionRegistry, com.atlassian.event.api.EventPublisher eventPublisher)
          This constructor adds all the upgrade tasks and is used by PICO
 
Method Summary
 java.util.Collection<java.lang.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.

 java.util.Collection<java.lang.String> doUpgradeIfNeededAndAllowed(java.lang.String backupPath)
          Performs the upgrade if one is required and the license is not too old to proceed with the upgrade.
 java.lang.String getExportFilePath()
           
 java.util.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)
This constructor adds all the upgrade tasks and is used by PICO

Method Detail

start

public void start()
           throws java.lang.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:
java.lang.Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

doUpgradeIfNeededAndAllowed

public java.util.Collection<java.lang.String> doUpgradeIfNeededAndAllowed(java.lang.String backupPath)
                                                                   throws IllegalXMLCharactersException
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
Returns:
a list of errors that occurred during the upgrade
Throws:
IllegalXMLCharactersException

doSetupUpgrade

public java.util.Collection<java.lang.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.

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

getExportFilePath

public java.lang.String getExportFilePath()
Specified by:
getExportFilePath in interface UpgradeManager

getUpgradeHistory

public java.util.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.