Package liquibase.configuration
Class LiquibaseConfiguration
java.lang.Object
liquibase.configuration.LiquibaseConfiguration
- All Implemented Interfaces:
SingletonObject
Provides unified management of configuration properties within Liquibase core and in extensions.
Because this class focuses on raw/untyped access to what is actually configured, it is usually best to interact with ConfigurationDefinition instances
which provide type safety, standardized key naming, default values, and more.
"Registered" configuration definitions will be available for generated help.
This class will search through the configured ConfigurationValueProviders. Standard value providers are auto-loaded on startup, but more can be added/removed at runtime.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends ConfigurationContainer>
TgetConfiguration(Class<T> type) Deprecated.<DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, String... keyAndAliases) Convenience method forgetCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, ConfigurationValueProvider[], String...)with no additional value providers.<DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, ConfigurationValueProvider[] additionalValueProviders, String... keyAndAliases) Searches for the given keys in the current providers and applies any applicable modifiers.Returns the globally registered providers merged with the current scope's ones, ordered byConfigurationValueProvider.getPrecedence()exactly asgetCurrentConfiguredValue(liquibase.configuration.ConfigurationValueConverter<DataType>, liquibase.configuration.ConfigurationValueObfuscator<DataType>, java.lang.String...)resolves them.static LiquibaseConfigurationDeprecated.getProvider(ConfigurationValueProvider provider) Returns only the globally registered providers.getRegisteredDefinitions(boolean includeInternal) Returns all registeredConfigurationDefinitions.voidFinishes configuration of this service.voidregisterDefinition(ConfigurationDefinition<?> definition) Registers aConfigurationDefinitionso it will be returned bygetRegisteredDefinitions(boolean)voidregisterProvider(ConfigurationValueProvider valueProvider) Adds a newConfigurationValueProviderto the active collection of providers.booleanremoveProvider(ConfigurationValueProvider provider) Removes a specificConfigurationValueProviderfrom the active collection of providers.booleanunregisterProvider(ConfigurationValueProvider valueProvider) Removes the givenConfigurationValueProviderfrom the active collection of providers.
-
Field Details
-
SCOPED_VALUE_PROVIDERS_KEY
Scope key holding aList<ConfigurationValueProvider>visible only to the current scope and its children. Integrations that run executions side by side (CLI, maven) put their per-execution providers here instead ofregisterProvider(ConfigurationValueProvider), so one execution's arguments never leak into or vanish from another running in parallel.A nested scope that sets this key shadows the outer list rather than combining with it; integrations set it once per execution.
- See Also:
-
REGISTERED_VALUE_PROVIDERS_KEY
- See Also:
-
-
Constructor Details
-
LiquibaseConfiguration
protected LiquibaseConfiguration()
-
-
Method Details
-
getInstance
Deprecated. -
init
Finishes configuration of this service. Called as the root scope is set up, should not be called elsewhere. -
registerProvider
Adds a newConfigurationValueProviderto the active collection of providers. -
unregisterProvider
Removes the givenConfigurationValueProviderfrom the active collection of providers.- Returns:
- true if the given provider was previously registered.
-
removeProvider
Removes a specificConfigurationValueProviderfrom the active collection of providers.- Returns:
- true if the provider was removed.
-
getConfiguration
Deprecated.useConfigurationDefinitioninstances directly -
getProviders
Returns only the globally registered providers. Callers that need everything resolution would see, including the current scope's per-execution providers, wantgetEffectiveProviders(). -
getEffectiveProviders
Returns the globally registered providers merged with the current scope's ones, ordered byConfigurationValueProvider.getPrecedence()exactly asgetCurrentConfiguredValue(liquibase.configuration.ConfigurationValueConverter<DataType>, liquibase.configuration.ConfigurationValueObfuscator<DataType>, java.lang.String...)resolves them. -
getProvider
-
getCurrentConfiguredValue
public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, String... keyAndAliases) Convenience method forgetCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, ConfigurationValueProvider[], String...)with no additional value providers. -
getCurrentConfiguredValue
public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, ConfigurationValueProvider[] additionalValueProviders, String... keyAndAliases) Searches for the given keys in the current providers and applies any applicable modifiers.- Parameters:
additionalValueProviders- additionalConfigurationValueProviders to use with higher priority than the ones registered inLiquibaseConfiguration. The higher the array index, the higher the priority. Can be null.keyAndAliases- The first element should be the canonical key name, with later elements being aliases. At least one element must be provided.- Returns:
- the value for the key, or null if not configured.
-
registerDefinition
Registers aConfigurationDefinitionso it will be returned bygetRegisteredDefinitions(boolean) -
getRegisteredDefinitions
Returns all registeredConfigurationDefinitions. Registered definitions are used for generated help documentation.- Parameters:
includeInternal- if true, includeConfigurationDefinition.isInternal()definitions.
-
getRegisteredDefinition
- Returns:
- the registered
ConfigurationDefinitionassociated with this key. Null if none match.
-
ConfigurationDefinitioninstances directly