com.atlassian.confluence.upgrade.impl
Class DefaultUpgradeManager
java.lang.Object
com.atlassian.confluence.upgrade.AbstractUpgradeManager
com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager
- All Implemented Interfaces:
- UpgradeManager
public class DefaultUpgradeManager
- extends AbstractUpgradeManager
| Methods inherited from class com.atlassian.confluence.upgrade.AbstractUpgradeManager |
getConfiguredBuildNumber, getErrors, getPreSchemaUpgradeTasks, getSchemaUpgradeTasks, getUpgradeTasks, isUpgraded, needUpgrade, setApplicationConfig, setConfiguredBuildNumber, setPreSchemaUpgradeTasks, setSchemaHelper, setSchemaUpgradeTasks, setUpgradeTasks, upgradeStarted, upgradeTaskSucceeded |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLUSTER_UPGRADE_LOCK
public static final String CLUSTER_UPGRADE_LOCK
- See Also:
- Constant Field Values
DefaultUpgradeManager
public DefaultUpgradeManager()
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.
upgrade
public void upgrade(com.atlassian.johnson.JohnsonEventContainer johnson)
throws UpgradeException
- Specified by:
upgrade in interface UpgradeManager- Overrides:
upgrade in class AbstractUpgradeManager
- Throws:
UpgradeException
upgradeFinished
protected void upgradeFinished()
throws Exception
- Description copied from class:
AbstractUpgradeManager
- Once all upgrade tasks have been completed without error, make sure the build number stored in the applications
main configuration file and database now matches the build number of this version of the release.
- Overrides:
upgradeFinished in class AbstractUpgradeManager
- Throws:
Exception - when setting the database or configuration build number fails
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
postUpgrade
protected void postUpgrade()
- Overrides:
postUpgrade in class AbstractUpgradeManager
permitDatabaseUpgrades
protected boolean permitDatabaseUpgrades()
throws UpgradeException
- 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:
- successfully acquire the cluster upgrade lock AND
- successfully tag the build in the CONFVERSION table (this is a backup check, to help us detect rare cases where some cluster nodes are not communicating - producing multiple clusters)
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.
- Throws:
UpgradeException - If the implementation of this method encounters any errors.
setCacheManager
public void setCacheManager(com.atlassian.cache.CacheManager cacheManager)
setEventManager
public void setEventManager(com.atlassian.event.EventManager eventManager)
setVersionHistoryDao
public void setVersionHistoryDao(VersionHistoryDao versionHistoryDao)
setClusterManager
public void setClusterManager(ClusterManager clusterManager)
setSidManager
public void setSidManager(ConfluenceSidManager sidManager)
setSystemInformationService
public void setSystemInformationService(SystemInformationService systemInformationService)
Copyright © 2003-2011 Atlassian. All Rights Reserved.