Class StudioUpgradeManagerImpl
java.lang.Object
org.craftercms.commons.upgrade.impl.AbstractUpgradeManager<String>
org.craftercms.studio.impl.v2.upgrade.StudioUpgradeManagerImpl
- All Implemented Interfaces:
org.craftercms.commons.upgrade.UpgradeManager<String>,StudioUpgradeManager,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class StudioUpgradeManagerImpl
extends org.craftercms.commons.upgrade.impl.AbstractUpgradeManager<String>
implements StudioUpgradeManager
Default implementation for
StudioUpgradeManager.- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.craftercms.commons.upgrade.UpgradePipelineFactory<String> protected org.craftercms.commons.upgrade.impl.configuration.YamlConfigurationProviderprotected ContentRepositoryprotected DataSourceprotected org.craftercms.commons.upgrade.UpgradePipelineFactory<String> protected org.craftercms.commons.upgrade.VersionProviderprotected InstanceServiceprotected org.craftercms.commons.entitlements.validator.DbIntegrityValidatorprotected RetryingRepositoryOperationFacadestatic final Stringstatic final Stringprotected StudioConfigurationFields inherited from class org.craftercms.commons.upgrade.impl.AbstractUpgradeManager
applicationContext, continueOnFailure -
Constructor Summary
ConstructorsConstructorDescriptionStudioUpgradeManagerImpl(org.craftercms.commons.upgrade.VersionProvider dbVersionProvider, org.craftercms.commons.upgrade.UpgradePipelineFactory<String> dbPipelineFactory, org.craftercms.commons.upgrade.UpgradePipelineFactory<String> bpPipelineFactory, org.craftercms.commons.upgrade.impl.configuration.YamlConfigurationProvider configurationProvider, DataSource dataSource, org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator, ContentRepository contentRepository, StudioConfiguration studioConfiguration, InstanceService instanceService, RetryingRepositoryOperationFacade retryingRepositoryOperationFacade) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckIfSiteRepoExists(String site) protected org.craftercms.commons.upgrade.impl.UpgradeContext<String> createUpgradeContext(String site) voidReturns all existing environments for the given siteprotected org.craftercms.commons.upgrade.UpgradePipelineFactory<String> getPipelineFactory(String factoryName) voidObtains the current version and starts the upgrade process.voidExecutes all required upgrades for the blueprints.voidExecutes all required upgrades for the system.voidExecutes the upgrades for all existing sites.voidExecutes the upgrades for all managed configurations in the given site.Methods inherited from class org.craftercms.commons.upgrade.impl.AbstractUpgradeManager
executePipeline, getTargets, setApplicationContext, setContinueOnFailure, upgrade, upgradeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.craftercms.commons.upgrade.UpgradeManager
getTargets, upgrade, upgrade
-
Field Details
-
SQL_QUERY_SITES_3_0_0
- See Also:
-
SQL_QUERY_SITES
- See Also:
-
dbVersionProvider
protected org.craftercms.commons.upgrade.VersionProvider dbVersionProvider -
dbPipelineFactory
-
bpPipelineFactory
-
configurationProvider
protected org.craftercms.commons.upgrade.impl.configuration.YamlConfigurationProvider configurationProvider -
dataSource
-
integrityValidator
protected org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator -
contentRepository
-
studioConfiguration
-
instanceService
-
retryingRepositoryOperationFacade
-
-
Constructor Details
-
StudioUpgradeManagerImpl
@ConstructorProperties({"dbVersionProvider","dbPipelineFactory","bpPipelineFactory","configurationProvider","dataSource","integrityValidator","contentRepository","studioConfiguration","instanceService","retryingRepositoryOperationFacade"}) public StudioUpgradeManagerImpl(org.craftercms.commons.upgrade.VersionProvider dbVersionProvider, org.craftercms.commons.upgrade.UpgradePipelineFactory<String> dbPipelineFactory, org.craftercms.commons.upgrade.UpgradePipelineFactory<String> bpPipelineFactory, org.craftercms.commons.upgrade.impl.configuration.YamlConfigurationProvider configurationProvider, DataSource dataSource, org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator, ContentRepository contentRepository, StudioConfiguration studioConfiguration, InstanceService instanceService, RetryingRepositoryOperationFacade retryingRepositoryOperationFacade)
-
-
Method Details
-
upgradeDatabaseAndConfiguration
public void upgradeDatabaseAndConfiguration() throws org.craftercms.commons.upgrade.exception.UpgradeException, org.craftercms.commons.config.ConfigurationExceptionExecutes all required upgrades for the system.- Specified by:
upgradeDatabaseAndConfigurationin interfaceStudioUpgradeManager- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException- if any of the upgrades failsorg.craftercms.commons.config.ConfigurationException
-
getPipelineFactory
-
doUpgrade
public void doUpgrade(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context) throws org.craftercms.commons.upgrade.exception.UpgradeException, org.craftercms.commons.config.ConfigurationException - Specified by:
doUpgradein classorg.craftercms.commons.upgrade.impl.AbstractUpgradeManager<String>- Throws:
org.craftercms.commons.upgrade.exception.UpgradeExceptionorg.craftercms.commons.config.ConfigurationException
-
doGetTargets
-
createUpgradeContext
protected org.craftercms.commons.upgrade.impl.UpgradeContext<String> createUpgradeContext(String site) - Specified by:
createUpgradeContextin classorg.craftercms.commons.upgrade.impl.AbstractUpgradeManager<String>
-
upgradeSiteConfiguration
public void upgradeSiteConfiguration(StudioUpgradeContext context) throws org.craftercms.commons.upgrade.exception.UpgradeException Executes the upgrades for all managed configurations in the given site.- Specified by:
upgradeSiteConfigurationin interfaceStudioUpgradeManager- Parameters:
context- the context for the upgrades- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException- if any of the upgrades fails
-
upgradeExistingSites
public void upgradeExistingSites() throws org.craftercms.commons.upgrade.exception.UpgradeExceptionExecutes the upgrades for all existing sites.- Specified by:
upgradeExistingSitesin interfaceStudioUpgradeManager- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException- if any of the upgrades fails
-
checkIfSiteRepoExists
-
upgradeBlueprints
public void upgradeBlueprints() throws org.craftercms.commons.upgrade.exception.UpgradeException, org.craftercms.commons.config.ConfigurationExceptionExecutes all required upgrades for the blueprints.- Specified by:
upgradeBlueprintsin interfaceStudioUpgradeManager- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException- if any of the upgrades failsorg.craftercms.commons.config.ConfigurationException
-
getExistingEnvironments
Returns all existing environments for the given site- Specified by:
getExistingEnvironmentsin interfaceStudioUpgradeManager- Parameters:
site- the id of the site- Returns:
- the list of environments
-
startUpgrade
@EventListener(StartUpgradeEvent.class) public void startUpgrade() throws org.craftercms.commons.upgrade.exception.UpgradeException, org.craftercms.commons.entitlements.exception.EntitlementException, org.craftercms.commons.config.ConfigurationExceptionObtains the current version and starts the upgrade process.- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException- if there is any error in the upgrade processorg.craftercms.commons.entitlements.exception.EntitlementException- if there is any validation error after the upgrade processorg.craftercms.commons.config.ConfigurationException
-