public class UpgradeManagerImpl extends Object implements UpgradeManager, Startable
| Modifier and Type | Class and Description |
|---|---|
class |
UpgradeManagerImpl.Upgrades |
UpgradeManager.Status| Modifier and Type | Field and Description |
|---|---|
static com.atlassian.scheduler.config.JobId |
JOB_ID |
static com.atlassian.scheduler.config.JobRunnerKey |
JOB_RUNNER_KEY |
| Constructor and Description |
|---|
UpgradeManagerImpl(JiraLicenseService jiraLicenseService,
BuildUtilsInfo buildUtilsInfo,
I18nHelper.BeanFactory i18HelperFactory,
ApplicationProperties applicationProperties,
BuildVersionRegistry buildVersionRegistry,
com.atlassian.event.api.EventPublisher eventPublisher,
OfBizDelegator ofBizDelegator,
IndexLifecycleManager indexManager,
FeatureManager featureManager,
DowngradeUtilsImpl downgradeUtilsInfo,
ReindexMessageManager reindexMessageManager,
ReindexRequestManager reindexRequestManager,
com.atlassian.scheduler.SchedulerService schedulerService,
com.atlassian.scheduler.SchedulerHistoryService schedulerHistoryService,
EntityEngine entityEngine,
com.atlassian.beehive.ClusterLockService clusterLockService,
BuildVersionLicenseCheck licenseCheck,
UpgradeConstraints upgradeContstraints) |
| Modifier and Type | Method and Description |
|---|---|
void |
addUpgrade(UpgradeTask task) |
boolean |
areDelayedUpgradesRunning()
Returns true if a scheduled upgrade is in progress.
|
UpgradeManager.Status |
doUpgrade(UpgradeManagerParams upgradeManagerParams)
Gets all the upgrades (standard, professional and enterprise) that need to be run from the build number stored in
the database to the current build number
|
UpgradeManager.Status |
doUpgradeIfNeededAndAllowed(String backupPath,
UpgradeManagerParams upgradeManagerParams)
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
|
com.atlassian.scheduler.status.RunDetails |
getLastUpgradeResult() |
int |
getPendingDelayedUpgradeCount() |
List<UpgradeHistoryItem> |
getUpgradeHistory() |
boolean |
hasUpgradeTaskRun(Class<? extends UpgradeTask> clazz)
Return true if the upgrade task implemented in the parameter class has completed successfully..
|
void |
onClearCache(ClearCacheEvent event) |
UpgradeManager.Status |
scheduleDelayedUpgrades(int delayMins,
boolean isAllowReindex)
Schedules the execution of delayed upgrades.
|
void |
start()
This method will be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
|
public static final com.atlassian.scheduler.config.JobRunnerKey JOB_RUNNER_KEY
public static final com.atlassian.scheduler.config.JobId JOB_ID
@Inject public UpgradeManagerImpl(JiraLicenseService jiraLicenseService, BuildUtilsInfo buildUtilsInfo, I18nHelper.BeanFactory i18HelperFactory, ApplicationProperties applicationProperties, BuildVersionRegistry buildVersionRegistry, com.atlassian.event.api.EventPublisher eventPublisher, OfBizDelegator ofBizDelegator, IndexLifecycleManager indexManager, FeatureManager featureManager, DowngradeUtilsImpl downgradeUtilsInfo, ReindexMessageManager reindexMessageManager, ReindexRequestManager reindexRequestManager, com.atlassian.scheduler.SchedulerService schedulerService, com.atlassian.scheduler.SchedulerHistoryService schedulerHistoryService, EntityEngine entityEngine, com.atlassian.beehive.ClusterLockService clusterLockService, BuildVersionLicenseCheck licenseCheck, UpgradeConstraints upgradeContstraints)
public void start()
throws Exception
Startable@EventListener public void onClearCache(ClearCacheEvent event)
public UpgradeManager.Status doUpgradeIfNeededAndAllowed(@Nullable String backupPath, UpgradeManagerParams upgradeManagerParams) throws IllegalXMLCharactersException
UpgradeManagerdoUpgradeIfNeededAndAllowed in interface UpgradeManagerbackupPath - - a path to the default location of the export, may be null, in which case no auto
export will be performedupgradeManagerParams - contain information needed to upgrade processIllegalXMLCharactersException - if backup was impossible due to invalid XML
charactersprotected AutoExport getAutoExport(String defaultBackupPath)
public UpgradeManager.Status doUpgrade(UpgradeManagerParams upgradeManagerParams)
Get the set of upgradeNumbers which are to be performed for this upgrade.
Get the Maps of relevant upgrades using {#getRelevantUpgradesFromList}
Iterate over these numbers and if either of the standard, professional or enterprise maps contains an UpgradeTask with this number then do the upgrade
If errors are found, it will cancel the upgrade, and list errors to the console.
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.
upgradeManagerParams - contain information needed to upgrade processpublic int getPendingDelayedUpgradeCount()
getPendingDelayedUpgradeCount in interface UpgradeManager@Nonnull public UpgradeManager.Status scheduleDelayedUpgrades(int delayMins, boolean isAllowReindex)
UpgradeManagerscheduleDelayedUpgrades in interface UpgradeManagerdelayMins - the amount of time in minutes to wait before executing the delayed upgrades.isAllowReindex - set this to true to allow any required reindex to be done.public boolean areDelayedUpgradesRunning()
UpgradeManagerareDelayedUpgradesRunning in interface UpgradeManagerpublic com.atlassian.scheduler.status.RunDetails getLastUpgradeResult()
getLastUpgradeResult in interface UpgradeManagerpublic void addUpgrade(@Nonnull UpgradeTask task)
public String getExportFilePath()
UpgradeManagergetExportFilePath in interface UpgradeManagerpublic List<UpgradeHistoryItem> getUpgradeHistory()
getUpgradeHistory in interface UpgradeManagerpublic boolean hasUpgradeTaskRun(Class<? extends UpgradeTask> clazz)
UpgradeManagerhasUpgradeTaskRun in interface UpgradeManagerclazz - The Upgrade Task's implementing class.Copyright © 2002-2016 Atlassian. All Rights Reserved.