com.atlassian.confluence.upgrade.impl
Class DefaultUpgradeManager

java.lang.Object
  extended by com.atlassian.confluence.upgrade.AbstractUpgradeManager
      extended by com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager
All Implemented Interfaces:
UpgradeManager, UpgradeTaskInfoService, org.springframework.beans.factory.InitializingBean

public class DefaultUpgradeManager
extends AbstractUpgradeManager


Field Summary
 
Fields inherited from interface com.atlassian.confluence.upgrade.UpgradeManager
MINIMUM_SUPPORTED_UPGRADE_BUILD_NUMBER, MINIMUM_SUPPORTED_UPGRADE_VERSION
 
Constructor Summary
DefaultUpgradeManager()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void beforeUpgrade()
           
 void entireUpgradeFinished()
          Called when all immediate and deferred upgrade actions have been performed *if* an upgrade was needed.
protected  String getDatabaseBuildNumber()
           
protected  String getRealBuildNumber()
           
protected  void initialUpgradeFinished()
          Update the pluginFrameworkDependent upgrade status based on whether there are any plugin framework dependent upgrade tasks to run.
 boolean needUpgrade()
          This method has a side effect of putting an entry into the published cache indicating whether an upgrade is required or not.
protected  boolean permitDatabaseUpgrades()
          If we are in a clustered setup, only one node should be allowed to perform upgrades that affect the database.
protected  void postUpgrade()
           
protected  List<UpgradeError> runUpgradePrerequisites()
          Runs all upgrade prerequisites.
protected  void runUpgradeTasks(List<UpgradeTask> upgradeTasks)
           
 void setCacheManager(com.atlassian.cache.CacheManager cacheManager)
           
 void setClusterManager(ClusterManager clusterManager)
           
 void setCoreFeaturesManager(CoreFeaturesManager coreFeaturesManager)
           
 void setDatabaseBuildNumber()
          Once installation is complete, we'll need to set the database build number in the database, so that a subsequent startup of Confluence is able to check that the home directory build number matches the database build number (see https://jira.atlassian.com/browse/CONF-13798).
protected  void setDatabaseBuildNumber(String databaseBuildNumber)
          Once the upgrade is complete, we'll need to set the new database build number in the database.
 void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
           
 void setLicenseService(LicenseService licenseService)
           
 void setLicenseValidator(LicenseValidator licenseValidator)
           
 void setRecoveryFileGenerator(RecoveryFileGenerator recoveryFileGenerator)
           
 void setSidManager(ConfluenceSidManager sidManager)
           
 void setUpgradeGate(UpgradeGate upgradeGate)
           
 void setVersionHistoryDao(VersionHistoryDao versionHistoryDao)
           
 
Methods inherited from class com.atlassian.confluence.upgrade.AbstractUpgradeManager
configuredBuildNumberNewerThan, getAllUpgradeTasks, getAllUpgradeTasksInfo, getConfiguredBuildNumber, getErrors, getExportBuildNumber, getOldestSpaceImportAllowed, getPluginDependentUpgradeTasks, getPluginExportCompatibility, getPreSchemaUpgradeTasks, getSchemaUpgradeTasks, getUpgradeTasks, getUpgradeTasksToRun, isUpgraded, setApplicationConfig, setConfiguredBuildNumber, setPluginAccessor, setPluginDependentUpgradeTasks, setPreSchemaUpgradeTasks, setSchemaHelper, setSchemaUpgradeTasks, setUpgradeTasks, taskNewerThan, upgrade, upgradeStarted, upgradeTaskSucceeded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUpgradeManager

public DefaultUpgradeManager()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class AbstractUpgradeManager

getRealBuildNumber

protected String getRealBuildNumber()
Specified by:
getRealBuildNumber in class AbstractUpgradeManager
Returns:
The build number of the new version of Confluence being upgraded to. This number can be found in the default.properties of the new expanded WAR

getDatabaseBuildNumber

protected String getDatabaseBuildNumber()
Specified by:
getDatabaseBuildNumber in class AbstractUpgradeManager
Returns:
The build number of the data in the database. If the version of the database data can not be determined, this method should return the same value as AbstractUpgradeManager.getConfiguredBuildNumber().

runUpgradePrerequisites

protected List<UpgradeError> runUpgradePrerequisites()
Description copied from class: AbstractUpgradeManager
Runs all upgrade prerequisites.

Specified by:
runUpgradePrerequisites in class AbstractUpgradeManager
Returns:
an empty list if all upgrade prerequisites pass, otherwise, returns a list consisting of one or more failure messages.

needUpgrade

public boolean needUpgrade()
This method has a side effect of putting an entry into the published cache indicating whether an upgrade is required or not.

Specified by:
needUpgrade in interface UpgradeManager
Overrides:
needUpgrade in class AbstractUpgradeManager

setDatabaseBuildNumber

public void setDatabaseBuildNumber()
Description copied from interface: UpgradeManager
Once installation is complete, we'll need to set the database build number in the database, so that a subsequent startup of Confluence is able to check that the home directory build number matches the database build number (see https://jira.atlassian.com/browse/CONF-13798).


setDatabaseBuildNumber

protected void setDatabaseBuildNumber(String databaseBuildNumber)
                               throws Exception
Description copied from class: AbstractUpgradeManager
Once the upgrade is complete, we'll need to set the new database build number in the database.

Specified by:
setDatabaseBuildNumber in class AbstractUpgradeManager
Parameters:
databaseBuildNumber - The new database build number
Throws:
Exception - when there is any problem setting the database build number

beforeUpgrade

protected void beforeUpgrade()
Overrides:
beforeUpgrade in class AbstractUpgradeManager

postUpgrade

protected void postUpgrade()
Overrides:
postUpgrade in class AbstractUpgradeManager

initialUpgradeFinished

protected void initialUpgradeFinished()
                               throws Exception
Update the pluginFrameworkDependent upgrade status based on whether there are any plugin framework dependent upgrade tasks to run.

Overrides:
initialUpgradeFinished in class AbstractUpgradeManager
Throws:
Exception - when setting the database or configuration build number fails

entireUpgradeFinished

public void entireUpgradeFinished()
Description copied from interface: UpgradeManager
Called when all immediate and deferred upgrade actions have been performed *if* an upgrade was needed.

Specified by:
entireUpgradeFinished in interface UpgradeManager
Overrides:
entireUpgradeFinished in class AbstractUpgradeManager

permitDatabaseUpgrades

protected boolean permitDatabaseUpgrades()
If we are in a clustered setup, only one node should be allowed to perform upgrades that affect the database. To enforce this, nodes will need to: If the upgrade process fails before all database upgrade tasks are complete, and the user ignores those errors and restarts the server, the existing tag on the CONFVERSION table will prevent the upgrade

Overrides:
permitDatabaseUpgrades in class AbstractUpgradeManager
Returns:
True by default. Is overridden for cluster upgrades.

runUpgradeTasks

protected void runUpgradeTasks(List<UpgradeTask> upgradeTasks)
                        throws UpgradeException
Overrides:
runUpgradeTasks in class AbstractUpgradeManager
Throws:
UpgradeException

setCacheManager

public void setCacheManager(com.atlassian.cache.CacheManager cacheManager)

setEventPublisher

public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)

setVersionHistoryDao

public void setVersionHistoryDao(VersionHistoryDao versionHistoryDao)

setClusterManager

public void setClusterManager(ClusterManager clusterManager)

setSidManager

public void setSidManager(ConfluenceSidManager sidManager)

setUpgradeGate

public void setUpgradeGate(UpgradeGate upgradeGate)

setCoreFeaturesManager

public void setCoreFeaturesManager(CoreFeaturesManager coreFeaturesManager)

setRecoveryFileGenerator

public void setRecoveryFileGenerator(RecoveryFileGenerator recoveryFileGenerator)

setLicenseService

public void setLicenseService(LicenseService licenseService)

setLicenseValidator

public void setLicenseValidator(LicenseValidator licenseValidator)


Copyright © 2003–2015 Atlassian. All rights reserved.