Top Description Fields Constructors Methods
liquibase.configuration

public Class LiquibaseConfiguration

extends Object
implements SingletonObject
Class Inheritance
All Implemented Interfaces
liquibase.SingletonObject
Imports
liquibase.Scope, .SingletonObject, liquibase.exception.UnexpectedLiquibaseException, liquibase.servicelocator.ServiceLocator, liquibase.util.StringUtil, java.util.*

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

Modifier and TypeField and Description
private final SortedSet<ConfigurationValueProvider>
private final SortedSet<ConfigurationDefinition<?>>
private final Map<String, String>
lastLoggedKeyValues

Track looked up values we have logged to avoid infinite loops between this and the log system using configurations and to limit logged messages.

public static final String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public <T extends ConfigurationContainer> T
getConfiguration(Class<T> type)
Deprecated use ConfigurationDefinition instances directly

public <DataType> ConfiguredValue<DataType>
public <DataType> ConfiguredValue<DataType>

Returns:

the value for the key, or null if not configured.
getCurrentConfiguredValue
(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, ConfigurationValueProvider[]
additional ConfigurationValueProviders to use with higher priority than the ones registered in LiquibaseConfiguration. The higher the array index, the higher the priority. Can be null.
additionalValueProviders
,
String...
The first element should be the canonical key name, with later elements being aliases. At least one element must be provided.
keyAndAliases
)

Searches for the given keys in the current providers and applies any applicable modifiers.

public static LiquibaseConfiguration
public SortedSet<ConfigurationValueProvider>
public ConfigurationDefinition<?>

Returns:

the registered ConfigurationDefinition associated with this key. Null if none match.
getRegisteredDefinition
(String key)

public SortedSet<ConfigurationDefinition<?>>
getRegisteredDefinitions(boolean
if true, include ConfigurationDefinition#isInternal() definitions.
includeInternal
)

Returns all registered ConfigurationDefinitions.

public void
init(Scope scope)

Finishes configuration of this service.

public void
public void
registerProvider(ConfigurationValueProvider valueProvider)

Adds a new ConfigurationValueProvider to the active collection of providers.

public boolean

Returns:

true if the provider was removed.
removeProvider
(ConfigurationValueProvider provider)

Removes a specific ConfigurationValueProvider from the active collection of providers.

public boolean

Returns:

true if the given provider was previously registered.
unregisterProvider
(ConfigurationValueProvider valueProvider)

Removes the given ConfigurationValueProvider from the active collection of providers.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationValueProvidersback to summary
private final SortedSet<ConfigurationValueProvider> configurationValueProviders
definitionsback to summary
private final SortedSet<ConfigurationDefinition<?>> definitions
lastLoggedKeyValuesback to summary
private final Map<String, String> lastLoggedKeyValues

Track looked up values we have logged to avoid infinite loops between this and the log system using configurations and to limit logged messages. Only re-log when values changed from the last time they were logged.

REGISTERED_VALUE_PROVIDERS_KEYback to summary
public static final String REGISTERED_VALUE_PROVIDERS_KEY

Constructor Detail

LiquibaseConfigurationback to summary
protected LiquibaseConfiguration()

Method Detail

getConfigurationback to summary
public <T extends ConfigurationContainer> T getConfiguration(Class<T> type)

Deprecated

use ConfigurationDefinition instances directly

getCurrentConfiguredValueback to summary
public <DataType> ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator, String... keyAndAliases)

Convenience method for getCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, ConfigurationValueProvider[], String...) with no additional value providers.

getCurrentConfiguredValueback to summary
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:ConfigurationValueProvider[]

additional ConfigurationValueProviders to use with higher priority than the ones registered in LiquibaseConfiguration. The higher the array index, the higher the priority. Can be null.

keyAndAliases:String[]

The first element should be the canonical key name, with later elements being aliases. At least one element must be provided.

Returns:ConfiguredValue<DataType>

the value for the key, or null if not configured.

getInstanceback to summary
public static LiquibaseConfiguration getInstance()
getProvidersback to summary
public SortedSet<ConfigurationValueProvider> getProviders()
getRegisteredDefinitionback to summary
public ConfigurationDefinition<?> getRegisteredDefinition(String key)
Returns:ConfigurationDefinition<?>

the registered ConfigurationDefinition associated with this key. Null if none match.

getRegisteredDefinitionsback to summary
public SortedSet<ConfigurationDefinition<?>> getRegisteredDefinitions(boolean includeInternal)

Returns all registered ConfigurationDefinitions. Registered definitions are used for generated help documentation.

Parameters
includeInternal:boolean

if true, include ConfigurationDefinition#isInternal() definitions.

initback to summary
public void init(Scope scope)

Finishes configuration of this service. Called as the root scope is set up, should not be called elsewhere.

registerDefinitionback to summary
public void registerDefinition(ConfigurationDefinition<?> definition)

Registers a ConfigurationDefinition so it will be returned by getRegisteredDefinitions(boolean)

registerProviderback to summary
public void registerProvider(ConfigurationValueProvider valueProvider)

Adds a new ConfigurationValueProvider to the active collection of providers.

removeProviderback to summary
public boolean removeProvider(ConfigurationValueProvider provider)

Removes a specific ConfigurationValueProvider from the active collection of providers.

Returns:boolean

true if the provider was removed.

unregisterProviderback to summary
public boolean unregisterProvider(ConfigurationValueProvider valueProvider)

Removes the given ConfigurationValueProvider from the active collection of providers.

Returns:boolean

true if the given provider was previously registered.