public class DefaultUpgradeManagerImpl extends Object implements UpgradeManager, org.springframework.context.ApplicationContextAware
UpgradeManager.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
appContext |
protected UpgradePipelineFactory |
bpPipelineFactory |
static String |
CONFIG_PIPELINE_SUFFIX |
protected org.springframework.core.io.Resource |
configurationFile |
protected ContentRepository |
contentRepository |
protected DataSource |
dataSource |
protected UpgradePipelineFactory |
dbPipelineFactory |
protected VersionProvider |
dbVersionProvider |
protected org.craftercms.commons.entitlements.validator.DbIntegrityValidator |
integrityValidator |
protected String |
siteVersionFilePath
The git path of the version file.
|
static String |
SQL_QUERY_SITES |
static String |
SQL_QUERY_SITES_3_0_0 |
protected StudioConfiguration |
studioConfiguration |
| Constructor and Description |
|---|
DefaultUpgradeManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkIfSiteRepoExists(String site) |
static String |
getCurrentFile() |
List<String> |
getExistingEnvironments(String site)
Returns all existing environments for the given site
|
protected UpgradePipeline |
getPipeline(VersionProvider versionProvider,
String factoryName,
Object... args) |
protected VersionProvider |
getVersionProvider(String name,
Object... args) |
void |
init()
Obtains the current version and starts the upgrade process.
|
protected org.apache.commons.configuration2.HierarchicalConfiguration |
loadUpgradeConfiguration() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBpPipelineFactory(UpgradePipelineFactory bpPipelineFactory) |
void |
setConfigurationFile(org.springframework.core.io.Resource configurationFile) |
void |
setContentRepository(ContentRepository contentRepository) |
void |
setDataSource(DataSource dataSource) |
void |
setDbPipelineFactory(UpgradePipelineFactory dbPipelineFactory) |
void |
setDbVersionProvider(VersionProvider dbVersionProvider) |
void |
setIntegrityValidator(org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator) |
void |
setSiteVersionFilePath(String siteVersionFilePath) |
void |
setStudioConfiguration(StudioConfiguration studioConfiguration) |
void |
upgradeBlueprints()
Executes all required upgrades for the blueprints.
|
void |
upgradeDatabaseAndConfiguration()
Executes all required upgrades for the system.
|
void |
upgradeExistingSites()
Executes the upgrades for all existing sites.
|
void |
upgradeSite(String site)
Executes all required upgrades for the given site.
|
void |
upgradeSiteConfiguration(String site)
Executes the upgrades for all managed configurations in the given site.
|
public static final String SQL_QUERY_SITES_3_0_0
public static final String SQL_QUERY_SITES
public static final String CONFIG_PIPELINE_SUFFIX
protected String siteVersionFilePath
protected VersionProvider dbVersionProvider
protected UpgradePipelineFactory dbPipelineFactory
protected UpgradePipelineFactory bpPipelineFactory
protected org.springframework.core.io.Resource configurationFile
protected DataSource dataSource
protected org.springframework.context.ApplicationContext appContext
protected org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator
protected ContentRepository contentRepository
protected StudioConfiguration studioConfiguration
public static String getCurrentFile()
public void upgradeDatabaseAndConfiguration()
throws UpgradeException
upgradeDatabaseAndConfiguration in interface UpgradeManagerUpgradeException - if any of the upgrades failsprotected VersionProvider getVersionProvider(String name, Object... args)
protected UpgradePipeline getPipeline(VersionProvider versionProvider, String factoryName, Object... args) throws UpgradeException
UpgradeExceptionpublic void upgradeSite(String site)
upgradeSite in interface UpgradeManagersite - name of the sitepublic void upgradeSiteConfiguration(String site) throws UpgradeException
upgradeSiteConfiguration in interface UpgradeManagersite - name of the siteUpgradeException - if any of the upgrades failspublic void upgradeExistingSites()
throws UpgradeException
upgradeExistingSites in interface UpgradeManagerUpgradeException - if any of the upgrades failsprotected boolean checkIfSiteRepoExists(String site)
public void upgradeBlueprints()
throws UpgradeException
upgradeBlueprints in interface UpgradeManagerUpgradeException - if any of the upgrades failspublic List<String> getExistingEnvironments(String site)
getExistingEnvironments in interface UpgradeManagersite - the id of the sitepublic void init()
throws UpgradeException,
org.craftercms.commons.entitlements.exception.EntitlementException
UpgradeException - if there is any error in the upgrade processorg.craftercms.commons.entitlements.exception.EntitlementException - if there is any validation error after the upgrade processprotected org.apache.commons.configuration2.HierarchicalConfiguration loadUpgradeConfiguration()
throws UpgradeException
UpgradeExceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setDataSource(DataSource dataSource)
public void setIntegrityValidator(org.craftercms.commons.entitlements.validator.DbIntegrityValidator integrityValidator)
public void setContentRepository(ContentRepository contentRepository)
public void setDbPipelineFactory(UpgradePipelineFactory dbPipelineFactory)
public void setDbVersionProvider(VersionProvider dbVersionProvider)
public void setConfigurationFile(org.springframework.core.io.Resource configurationFile)
public void setSiteVersionFilePath(String siteVersionFilePath)
public void setBpPipelineFactory(UpgradePipelineFactory bpPipelineFactory)
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
Copyright © 2020 CrafterCMS. All rights reserved.