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 ConfigurationValueProvider
s. Standard value providers are auto-loaded on startup, but more can be added/removed at runtime.
-
Field Summary
-
Constructor Summary
-
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.static LiquibaseConfiguration
Deprecated.getProvider
(ConfigurationValueProvider provider) getRegisteredDefinitions
(boolean includeInternal) Returns all registeredConfigurationDefinition
s.void
Finishes configuration of this service.void
registerDefinition
(ConfigurationDefinition<?> definition) Registers aConfigurationDefinition
so it will be returned bygetRegisteredDefinitions(boolean)
void
registerProvider
(ConfigurationValueProvider valueProvider) Adds a newConfigurationValueProvider
to the active collection of providers.boolean
removeProvider
(ConfigurationValueProvider provider) Removes a specificConfigurationValueProvider
from the active collection of providers.boolean
unregisterProvider
(ConfigurationValueProvider valueProvider) Removes the givenConfigurationValueProvider
from the active collection of providers.
-
Field Details
-
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 newConfigurationValueProvider
to the active collection of providers. -
unregisterProvider
Removes the givenConfigurationValueProvider
from the active collection of providers.- Returns:
- true if the given provider was previously registered.
-
removeProvider
Removes a specificConfigurationValueProvider
from the active collection of providers.- Returns:
- true if the provider was removed.
-
getConfiguration
Deprecated.useConfigurationDefinition
instances directly -
getProviders
-
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:
keyAndAliases
- The first element should be the canonical key name, with later elements being aliases. At least one element must be provided.additionalValueProviders
- additionalConfigurationValueProvider
s to use with higher priority than the ones registered inLiquibaseConfiguration
. The higher the array index, the higher the priority. Can be null.- Returns:
- the value for the key, or null if not configured.
-
registerDefinition
Registers aConfigurationDefinition
so it will be returned bygetRegisteredDefinitions(boolean)
-
getRegisteredDefinitions
Returns all registeredConfigurationDefinition
s. Registered definitions are used for generated help documentation.- Parameters:
includeInternal
- if true, includeConfigurationDefinition.isInternal()
definitions.
-
getRegisteredDefinition
- Returns:
- the registered
ConfigurationDefinition
associated with this key. Null if none match.
-
ConfigurationDefinition
instances directly