public abstract class

AbstractUpgradeManager

extends Object
implements UpgradeManager
java.lang.Object
   ↳ com.atlassian.confluence.upgrade.AbstractUpgradeManager
Known Direct Subclasses

Summary

Fields
protected final Comparator<String> buildNumberComp
protected static final Logger log
Public Constructors
AbstractUpgradeManager()
Public Methods
List<UpgradeError> getErrors()
List<UpgradeTask> getSchemaUpgradeTasks()
List<UpgradeTask> getUpgradeTasks()
boolean isUpgraded()
boolean needUpgrade()
void setApplicationConfig(ApplicationConfiguration applicationConfig)
void setPreSchemaUpgradeTasks(List<UpgradeTask> preSchemaUpgradeTasks)
void setSchemaHelper(SchemaHelper schemaHelper)
void setSchemaUpgradeTasks(List<UpgradeTask> upgradeTasks)
void setUpgradeTasks(List<UpgradeTask> upgradeTasks)
void upgrade(JohnsonEventContainer agentJohnson)
Protected Methods
void doUpgrade()
String getConfiguredBuildNumber()
This is the build number of the current version that the user is running under.
abstract String getDatabaseBuildNumber()
This is the build number of the data in the database.
abstract String getRealBuildNumber()
The is the build number of the new version of Confluence being upgraded to.
boolean permitDatabaseUpgrades()
This is used to guard against database upgrades being performed multiple times on the same database.
void postUpgrade()
abstract List<String> runUpgradePrerequisites()
Runs all upgrade prerequisites.
void setConfiguredBuildNumber(String buildNumber)
abstract void setDatabaseBuildNumber(String databaseBuildNumber)
Once the upgrade is complete, we'll need to set the new database build number in the database.
void upgradeFinished()
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.
void upgradeSchema()
void upgradeStarted()
void upgradeTaskFailed(UpgradeTask upgradeTask, Throwable e)
void upgradeTaskSucceeded(UpgradeTask upgradeTask)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.upgrade.UpgradeManager

Fields

protected final Comparator<String> buildNumberComp

protected static final Logger log

Public Constructors

public AbstractUpgradeManager ()

Public Methods

public List<UpgradeError> getErrors ()

public List<UpgradeTask> getSchemaUpgradeTasks ()

public List<UpgradeTask> getUpgradeTasks ()

public boolean isUpgraded ()

public boolean needUpgrade ()

public void setApplicationConfig (ApplicationConfiguration applicationConfig)

public void setPreSchemaUpgradeTasks (List<UpgradeTask> preSchemaUpgradeTasks)

public void setSchemaHelper (SchemaHelper schemaHelper)

public void setSchemaUpgradeTasks (List<UpgradeTask> upgradeTasks)

public void setUpgradeTasks (List<UpgradeTask> upgradeTasks)

public void upgrade (JohnsonEventContainer agentJohnson)

Protected Methods

protected void doUpgrade ()

Throws
Throwable

protected String getConfiguredBuildNumber ()

This is the build number of the current version that the user is running under. This version is stored in their confluence home confluence.cfg.xml file

protected abstract String getDatabaseBuildNumber ()

This is 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 getConfiguredBuildNumber().

protected abstract String getRealBuildNumber ()

The is 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

protected boolean permitDatabaseUpgrades ()

This is used to guard against database upgrades being performed multiple times on the same database. By default, assume a non-clustered setup and allow database upgrades.

protected void postUpgrade ()

protected abstract List<String> runUpgradePrerequisites ()

Runs all upgrade prerequisites.

Returns
  • an empty list if all upgrade prerequisites pass, otherwise, returns a list consisting of one or more failure messages.

protected void setConfiguredBuildNumber (String buildNumber)

Throws
ConfigurationException

protected abstract void setDatabaseBuildNumber (String databaseBuildNumber)

Once the upgrade is complete, we'll need to set the new database build number in the database.

Throws
Exception

protected void upgradeFinished ()

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.

Throws
Exception

protected void upgradeSchema ()

Throws
ConfigurationException
UpgradeException

protected void upgradeStarted ()

Throws
Exception

protected void upgradeTaskFailed (UpgradeTask upgradeTask, Throwable e)

protected void upgradeTaskSucceeded (UpgradeTask upgradeTask)

Throws
ConfigurationException