Interface UpgradeableAutomationConfigStore
- All Known Implementing Classes:
JiraAutomationConfigStore
public interface UpgradeableAutomationConfigStore
Provides extra methods available only in the server implementation to allow upgrading of third party
component configs via the pluggable
ComponentUpgradeTask
mechanism.-
Method Summary
Modifier and TypeMethodDescriptionOptional<com.codebarrel.automation.api.config.ComponentConfigBean> getComponentConfigForUprade(TenantContext context, long id) Returns a component config that will be passed to the component upgrade task.getComponentConfigsForUpgrade(TenantContext context, String moduleKey, int highestSchemaVersion) Returns a list of config ids that match the moduleKey and currently have a schema version less than the schemaversion provided (therefore need to be upgraded).com.codebarrel.automation.api.config.ComponentConfigBeanstoreUpgradedComponentConfig(TenantContext context, long configToUpgrade, int newSchemaVersion, com.codebarrel.automation.api.thirdparty.upgrade.ComponentUpgrade upgrades) Performs the actual upgrade and returns the upgraded component config (so it can be used for subsequent upgrades)
-
Method Details
-
getComponentConfigsForUpgrade
List<Long> getComponentConfigsForUpgrade(TenantContext context, String moduleKey, int highestSchemaVersion) Returns a list of config ids that match the moduleKey and currently have a schema version less than the schemaversion provided (therefore need to be upgraded).- Parameters:
context- the tenant contextmoduleKey- the module key (component type) to upgrade)highestSchemaVersion- the highest schema version that we'll upgrade to as part of this upgrade run- Returns:
- List of component ids that need to be upgraded.
-
getComponentConfigForUprade
Optional<com.codebarrel.automation.api.config.ComponentConfigBean> getComponentConfigForUprade(TenantContext context, long id) Returns a component config that will be passed to the component upgrade task.This differs slightly from a normal lookup of component config, because it wont retrieve children/conditions of a component.
- Parameters:
context- the tenant contextid- the id of the config to lookup.- Returns:
- The component config or empty.
-
storeUpgradedComponentConfig
com.codebarrel.automation.api.config.ComponentConfigBean storeUpgradedComponentConfig(TenantContext context, long configToUpgrade, int newSchemaVersion, com.codebarrel.automation.api.thirdparty.upgrade.ComponentUpgrade upgrades) Performs the actual upgrade and returns the upgraded component config (so it can be used for subsequent upgrades)- Parameters:
context- the tenant contextconfigToUpgrade- the id of the config to updatenewSchemaVersion- the new schema version to setupgrades- new values to store for the config- Returns:
- the upgraded config
-