public class

DefaultUpgradeManager

extends AbstractUpgradeManager
java.lang.Object
   ↳ com.atlassian.confluence.upgrade.AbstractUpgradeManager
     ↳ com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager

Summary

Constants
String CLUSTER_UPGRADE_LOCK
[Expand]
Inherited Fields
From class com.atlassian.confluence.upgrade.AbstractUpgradeManager
Public Constructors
DefaultUpgradeManager()
Public Methods
void entireUpgradeFinished()
Called when all immediate and deferred upgrade actions have been performed *if* an upgrade was needed.
boolean needUpgrade()
This method has a side affect of putting an entry into the published cache indicating whether an upgrade is required or not.
void setCacheManager(CacheManager cacheManager)
void setClusterManager(ClusterManager clusterManager)
void setEventPublisher(EventPublisher eventPublisher)
void setSidManager(ConfluenceSidManager sidManager)
void setSystemInformationService(SystemInformationService systemInformationService)
void setUpgradeGate(UpgradeGate upgradeGate)
void setVersionHistoryDao(VersionHistoryDao versionHistoryDao)
Protected Methods
String getDatabaseBuildNumber()
String getRealBuildNumber()
void initialUpgradeFinished()
Update the pluginFrameworkDependent upgrade status based on whether there are any plugin framework dependent upgrade tasks to run.
boolean permitDatabaseUpgrades()
If we are in a clustered setup, only one node should be allowed to perform upgrades that affect the database.
void postUpgrade()
List<UpgradeError> runUpgradePrerequisites()
Runs all upgrade prerequisites.
void setDatabaseBuildNumber(String databaseBuildNumber)
Once the upgrade is complete, we'll need to set the new database build number in the database.
[Expand]
Inherited Methods
From class com.atlassian.confluence.upgrade.AbstractUpgradeManager
From class java.lang.Object
From interface com.atlassian.confluence.upgrade.UpgradeManager

Constants

public static final String CLUSTER_UPGRADE_LOCK

Constant Value: "cluster.upgrade.lock"

Public Constructors

public DefaultUpgradeManager ()

Public Methods

public void entireUpgradeFinished ()

Called when all immediate and deferred upgrade actions have been performed *if* an upgrade was needed.

public boolean needUpgrade ()

This method has a side affect of putting an entry into the published cache indicating whether an upgrade is required or not.

public void setCacheManager (CacheManager cacheManager)

public void setClusterManager (ClusterManager clusterManager)

public void setEventPublisher (EventPublisher eventPublisher)

public void setSidManager (ConfluenceSidManager sidManager)

public void setSystemInformationService (SystemInformationService systemInformationService)

public void setUpgradeGate (UpgradeGate upgradeGate)

public void setVersionHistoryDao (VersionHistoryDao versionHistoryDao)

Protected Methods

protected String getDatabaseBuildNumber ()

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

protected String getRealBuildNumber ()

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

protected void initialUpgradeFinished ()

Update the pluginFrameworkDependent upgrade status based on whether there are any plugin framework dependent upgrade tasks to run.

Throws
Exception

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:

  • 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
Returns
  • True by default. Is overridden for cluster upgrades.

protected void postUpgrade ()

protected List<UpgradeError> 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 setDatabaseBuildNumber (String databaseBuildNumber)

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

Parameters
databaseBuildNumber The new database build number
Throws
Exception