Class DefaultUpgradeManager
java.lang.Object
com.atlassian.confluence.upgrade.AbstractUpgradeManager
com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager
- All Implemented Interfaces:
UpgradeManager
,UpgradeTaskInfoService
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.InitializingBean
-
Field Summary
Fields inherited from class com.atlassian.confluence.upgrade.AbstractUpgradeManager
MAXIMUM_CLOUD_BUILD_VERSION_NUMBER, UPGRADE_TASK_COMPARATOR
Fields inherited from interface com.atlassian.confluence.upgrade.UpgradeManager
MINIMUM_SUPPORTED_UPGRADE_BUILD_NUMBER, MINIMUM_SUPPORTED_UPGRADE_VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
void
Called when all immediate and deferred upgrade actions have been performed *if* an upgrade was needed.protected void
protected String
protected String
protected void
Update the pluginFrameworkDependent upgrade status based on whether there are any plugin framework dependent upgrade tasks to run.boolean
This method has a side effect of putting an entry into the published cache indicating whether an upgrade is required or not.protected boolean
If we are in a clustered setup, only one node should be allowed to perform upgrades that affect the database.protected void
protected void
protected List<UpgradeError>
Runs all upgrade prerequisites.protected void
runUpgradeTasks
(List<UpgradeTask> upgradeTasks) void
setCacheFlusher
(CacheFlusher cacheFlusher) void
setClusterConfigurationHelper
(ClusterConfigurationHelperInternal clusterConfigurationHelper) Setter method for clusterConfigurationHelpervoid
setClusterLockService
(com.atlassian.beehive.ClusterLockService clusterLockService) void
setClusterManager
(ClusterManager clusterManager) void
setConfluenceHome
(com.atlassian.dc.filestore.api.compat.FilesystemPath confluenceHome) void
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
setFinalizationManager
(UpgradeFinalizationManager finalizationManager) void
setGlobalSettingsManager
(GlobalSettingsManager globalSettingsManager) void
setLicenseService
(LicenseService licenseService) void
setRecoveryFileGenerator
(RecoveryFileGenerator recoveryFileGenerator) void
setSchemaHelper
(ConfluenceSchemaHelper schemaHelper) void
setUpgradeGate
(UpgradeGate upgradeGate) void
setVersionHistoryDao
(VersionHistoryDao versionHistoryDao) protected void
protected void
Methods inherited from class com.atlassian.confluence.upgrade.AbstractUpgradeManager
assertNoDuplicateBuildNumbers, configuredBuildNumberNewerThan, getAllUpgradeTasks, getAllUpgradeTasksInfo, getConfiguredBuildNumber, getErrors, getExportBuildNumber, getOldestSpaceImportAllowed, getPluginDependentUpgradeTasks, getPluginExportCompatibility, getPreSchemaUpgradeTasks, getSchemaUpgradeTasks, getUpgradeTasks, getUpgradeTasksToRun, isUpgraded, neededSchemaUpgrade, setApplicationConfig, setBeanFactory, setConfiguredBuildNumber, setPluginAccessor, setPluginDependentUpgradeTaskNames, setPluginDependentUpgradeTasks, setPreSchemaUpgradeTaskNames, setPreSchemaUpgradeTasks, setSchemaUpgradeTaskNames, setSchemaUpgradeTasks, setUpgradedFlag, setUpgradeTaskNames, setUpgradeTasks, taskNewerThan, upgrade, upgradeStarted, upgradeTaskSucceeded
-
Constructor Details
-
DefaultUpgradeManager
public DefaultUpgradeManager()
-
-
Method Details
-
setFinalizationManager
-
setLicenseService
-
setGlobalSettingsManager
-
setSchemaHelper
-
validateSchemaUpdateIfNeeded
protected void validateSchemaUpdateIfNeeded() throws com.atlassian.config.ConfigurationException- Specified by:
validateSchemaUpdateIfNeeded
in classAbstractUpgradeManager
- Throws:
com.atlassian.config.ConfigurationException
-
updateSchemaIfNeeded
protected void updateSchemaIfNeeded() throws com.atlassian.config.ConfigurationException- Specified by:
updateSchemaIfNeeded
in classAbstractUpgradeManager
- Throws:
com.atlassian.config.ConfigurationException
-
releaseSchemaReferences
protected void releaseSchemaReferences()- Specified by:
releaseSchemaReferences
in classAbstractUpgradeManager
-
finalizeIfNeeded
- Specified by:
finalizeIfNeeded
in classAbstractUpgradeManager
- Throws:
UpgradeException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classAbstractUpgradeManager
-
getRealBuildNumber
- Specified by:
getRealBuildNumber
in classAbstractUpgradeManager
- 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
- Specified by:
getDatabaseBuildNumber
in classAbstractUpgradeManager
- 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
Description copied from class:AbstractUpgradeManager
Runs all upgrade prerequisites.- Specified by:
runUpgradePrerequisites
in classAbstractUpgradeManager
- 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 interfaceUpgradeManager
- Overrides:
needUpgrade
in classAbstractUpgradeManager
-
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
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 classAbstractUpgradeManager
- 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 classAbstractUpgradeManager
-
postUpgrade
protected void postUpgrade()- Overrides:
postUpgrade
in classAbstractUpgradeManager
-
initialUpgradeFinished
Update the pluginFrameworkDependent upgrade status based on whether there are any plugin framework dependent upgrade tasks to run.- Overrides:
initialUpgradeFinished
in classAbstractUpgradeManager
- 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 interfaceUpgradeManager
- Overrides:
entireUpgradeFinished
in classAbstractUpgradeManager
-
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:- 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)
- Overrides:
permitDatabaseUpgrades
in classAbstractUpgradeManager
- Returns:
- True by default. Is overridden for cluster upgrades.
-
runUpgradeTasks
- Overrides:
runUpgradeTasks
in classAbstractUpgradeManager
- Throws:
UpgradeException
-
setCacheFlusher
- Since:
- 5.10
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) -
setVersionHistoryDao
-
setClusterManager
-
setClusterLockService
public void setClusterLockService(com.atlassian.beehive.ClusterLockService clusterLockService) -
setUpgradeGate
-
setRecoveryFileGenerator
-
setClusterConfigurationHelper
public void setClusterConfigurationHelper(ClusterConfigurationHelperInternal clusterConfigurationHelper) Setter method for clusterConfigurationHelper- Parameters:
clusterConfigurationHelper
- the injected Spring bean- Since:
- 6.10.1
-
setConfluenceHome
public void setConfluenceHome(com.atlassian.dc.filestore.api.compat.FilesystemPath confluenceHome)
-