Package liquibase.configuration
Class LiquibaseConfiguration
- java.lang.Object
-
- liquibase.configuration.LiquibaseConfiguration
-
- All Implemented Interfaces:
SingletonObject
public class LiquibaseConfiguration extends Object implements 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
Fields Modifier and Type Field Description static String
REGISTERED_VALUE_PROVIDERS_KEY
-
Constructor Summary
Constructors Modifier Constructor Description protected
LiquibaseConfiguration()
-
Method Summary
-
-
-
Field Detail
-
REGISTERED_VALUE_PROVIDERS_KEY
public static final String REGISTERED_VALUE_PROVIDERS_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static LiquibaseConfiguration getInstance()
Deprecated.
-
init
public void init(Scope scope)
Finishes configuration of this service. Called as the root scope is set up, should not be called elsewhere.
-
registerProvider
public void registerProvider(ConfigurationValueProvider valueProvider)
Adds a newConfigurationValueProvider
to the active collection of providers.
-
unregisterProvider
public boolean unregisterProvider(ConfigurationValueProvider valueProvider)
Removes the givenConfigurationValueProvider
from the active collection of providers.- Returns:
- true if the given provider was previously registered.
-
removeProvider
public boolean removeProvider(ConfigurationValueProvider provider)
Removes a specificConfigurationValueProvider
from the active collection of providers.- Returns:
- true if the provider was removed.
-
getConfiguration
public <T extends ConfigurationContainer> T getConfiguration(Class<T> type)
Deprecated.useConfigurationDefinition
instances directly
-
getProviders
public SortedSet<ConfigurationValueProvider> getProviders()
-
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
public void registerDefinition(ConfigurationDefinition<?> definition)
Registers aConfigurationDefinition
so it will be returned bygetRegisteredDefinitions(boolean)
-
getRegisteredDefinitions
public SortedSet<ConfigurationDefinition<?>> getRegisteredDefinitions(boolean includeInternal)
Returns all registeredConfigurationDefinition
s. Registered definitions are used for generated help documentation.- Parameters:
includeInternal
- if true, includeConfigurationDefinition.isInternal()
definitions.
-
getRegisteredDefinition
public ConfigurationDefinition<?> getRegisteredDefinition(String key)
- Returns:
- the registered
ConfigurationDefinition
associated with this key. Null if none match.
-
-