Class DefaultUpgradeFinalizationManager
- java.lang.Object
-
- com.atlassian.confluence.upgrade.impl.DefaultUpgradeFinalizationManager
-
- All Implemented Interfaces:
UpgradeFinalizationManager
public class DefaultUpgradeFinalizationManager extends Object implements UpgradeFinalizationManager
- Since:
- 7.14
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultUpgradeFinalizationManager.RunImpl
-
Nested classes/interfaces inherited from interface com.atlassian.confluence.upgrade.UpgradeFinalizationManager
UpgradeFinalizationManager.Run
-
-
Field Summary
Fields Modifier and Type Field Description static String
FINALIZED_BUILD_NUMBER_CONFIG_KEY
-
Constructor Summary
Constructors Constructor Description DefaultUpgradeFinalizationManager(ZduStatusDao zduStatusDao, com.atlassian.beehive.ClusterLockService clusterLockService, VersionHistoryDao versionHistoryDao, com.atlassian.config.ApplicationConfiguration applicationConfig, com.atlassian.event.api.EventPublisher eventPublisher, SharedDataManager sharedDataManager, Supplier<List<UpgradeTask>> finalizeUpgradeTasksSupplier, int productBuildNumber)
DefaultUpgradeFinalizationManager(ZduStatusDao zduStatusDao, com.atlassian.beehive.ClusterLockService clusterLockService, VersionHistoryDao versionHistoryDao, com.atlassian.config.ApplicationConfiguration applicationConfig, com.atlassian.event.api.EventPublisher eventPublisher, SharedDataManager sharedDataManager, List<String> finalizeUpgradeTasks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
protected void
finalizeConfigureBuildNumber(int buildNumber)
void
finalizeIfNeeded()
Perform pending finalizeUpgradeTasks on the current node (no-op if none pending) if it is required, i.e.protected int
getFinalizedConfiguredBuildNumber()
Optional<UpgradeFinalizationManager.Run>
getLastRun()
Obtains the the most recent finalization run.void
init()
boolean
isPendingDatabaseFinalization()
boolean
isPendingLocalFinalization()
void
markAsFullyFinalized(boolean updateBuildNumber)
Once installation is complete, we'll need to set the finalized build number in the database and home directory with the product build number.void
onRemotelyRequested(ClusterEventWrapper e)
void
onRequested(ZduFinalizationRequestEvent e)
-
-
-
Field Detail
-
FINALIZED_BUILD_NUMBER_CONFIG_KEY
public static final String FINALIZED_BUILD_NUMBER_CONFIG_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultUpgradeFinalizationManager
public DefaultUpgradeFinalizationManager(ZduStatusDao zduStatusDao, com.atlassian.beehive.ClusterLockService clusterLockService, VersionHistoryDao versionHistoryDao, com.atlassian.config.ApplicationConfiguration applicationConfig, com.atlassian.event.api.EventPublisher eventPublisher, SharedDataManager sharedDataManager, List<String> finalizeUpgradeTasks)
-
DefaultUpgradeFinalizationManager
public DefaultUpgradeFinalizationManager(ZduStatusDao zduStatusDao, com.atlassian.beehive.ClusterLockService clusterLockService, VersionHistoryDao versionHistoryDao, com.atlassian.config.ApplicationConfiguration applicationConfig, com.atlassian.event.api.EventPublisher eventPublisher, SharedDataManager sharedDataManager, Supplier<List<UpgradeTask>> finalizeUpgradeTasksSupplier, int productBuildNumber)
-
-
Method Detail
-
isPendingDatabaseFinalization
public boolean isPendingDatabaseFinalization()
- Specified by:
isPendingDatabaseFinalization
in interfaceUpgradeFinalizationManager
- Returns:
- true if the database has not been finalized.
-
isPendingLocalFinalization
public boolean isPendingLocalFinalization()
- Specified by:
isPendingLocalFinalization
in interfaceUpgradeFinalizationManager
- Returns:
- true if the local node has not been finalization tasks on this node.
-
finalizeIfNeeded
public void finalizeIfNeeded() throws UpgradeException
Description copied from interface:UpgradeFinalizationManager
Perform pending finalizeUpgradeTasks on the current node (no-op if none pending) if it is required, i.e. when ZDU is disabled. If executed concurrently in multiple nodes in a cluster, only one node will exclusively perform databaseUpgrade tasks.- Specified by:
finalizeIfNeeded
in interfaceUpgradeFinalizationManager
- Throws:
UpgradeException
-
getLastRun
public Optional<UpgradeFinalizationManager.Run> getLastRun()
Description copied from interface:UpgradeFinalizationManager
Obtains the the most recent finalization run. Each finalization run will invalidate the previous result.- Specified by:
getLastRun
in interfaceUpgradeFinalizationManager
- Returns:
- finalization result or empty
-
markAsFullyFinalized
public void markAsFullyFinalized(boolean updateBuildNumber) throws com.atlassian.config.ConfigurationException
Description copied from interface:UpgradeFinalizationManager
Once installation is complete, we'll need to set the finalized build number in the database and home directory with the product build number.- Specified by:
markAsFullyFinalized
in interfaceUpgradeFinalizationManager
- Parameters:
updateBuildNumber
- whether the database and home directory build numbers should be updated- Throws:
com.atlassian.config.ConfigurationException
-
getFinalizedConfiguredBuildNumber
protected int getFinalizedConfiguredBuildNumber()
-
finalizeConfigureBuildNumber
protected void finalizeConfigureBuildNumber(int buildNumber) throws com.atlassian.config.ConfigurationException
- Throws:
com.atlassian.config.ConfigurationException
-
init
@PostConstruct public void init()
-
destroy
@PreDestroy public void destroy()
-
onRequested
@EventListener public void onRequested(ZduFinalizationRequestEvent e) throws UpgradeException
- Throws:
UpgradeException
-
onRemotelyRequested
@EventListener public void onRemotelyRequested(ClusterEventWrapper e) throws UpgradeException
- Throws:
UpgradeException
-
-