Class PropertyFileConfigurationSource
- All Implemented Interfaces:
- ConfigurationSource,- DefaultableConfigurationSource
A configuration source that looks up properties in a regular property file.
This source supports parameterized configuration properties defined in a configuration file as follows:
 web.server_port=8080
 web.server_port[profile="ssl"]=8443
 db.url[env="dev"]=jdbc:oracle:thin:@dev.db.server:1521:sid
 db.url[env="prod",zone="eu"]=jdbc:oracle:thin:@prod_eu.db.server:1521:sid
 db.url[env="prod",zone="us"]=jdbc:oracle:thin:@prod_us.db.server:1521:sid
 - Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class io.inverno.mod.configuration.internal.AbstractHashConfigurationSourceio.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashConfigurationQuery<A,B extends io.inverno.mod.configuration.internal.AbstractHashConfigurationSource<A, B>>, io.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashConfigurationQueryResult<A, B extends io.inverno.mod.configuration.internal.AbstractHashConfigurationSource<A, B>>, io.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashExecutableConfigurationQuery<A, B extends io.inverno.mod.configuration.internal.AbstractHashConfigurationSource<A, B>>, io.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashListConfigurationQuery<A, B extends io.inverno.mod.configuration.internal.AbstractHashConfigurationSource<A, B>> 
- 
Field SummaryFields inherited from class io.inverno.mod.configuration.internal.AbstractHashConfigurationSourcedefaultingStrategyFields inherited from class io.inverno.mod.configuration.internal.AbstractConfigurationSourcedecoder, defaultParameters, original
- 
Constructor SummaryConstructorsConstructorDescriptionPropertyFileConfigurationSource(Resource propertyResource) Creates a property file configuration source with the specified resourcePropertyFileConfigurationSource(Resource propertyResource, SplittablePrimitiveDecoder<String> decoder) Creates a property file configuration source with the specified resource and string value decoder.PropertyFileConfigurationSource(InputStream propertyInput) Creates a property file configuration source with the specified input stream.PropertyFileConfigurationSource(InputStream propertyInput, SplittablePrimitiveDecoder<String> decoder) Creates a property file configuration source with the specified input stream and string value decoder.PropertyFileConfigurationSource(Path propertyFile) Creates a property file configuration source with the.propertiesfile at the specified path.PropertyFileConfigurationSource(Path propertyFile, SplittablePrimitiveDecoder<String> decoder) Creates a property file configuration source with the.propertiesfile at the specified path and the specified string value decoder.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the time-to-live duration of the properties loaded withload().protected Mono<List<ConfigurationProperty>> load()Loads the configuration properties.voidsetPropertiesTTL(Duration ttl) Sets the time-to-live duration of the properties loaded withload().withDefaultingStrategy(DefaultingStrategy defaultingStrategy) Returns a proxy of the defaultable configuration source instance using the specified defaulting strategy.withParameters(List<ConfigurationKey.Parameter> parameters) Defines parameters that specify the context in which configuration properties are to be retrieved.Methods inherited from class io.inverno.mod.configuration.internal.AbstractHashConfigurationSourceget, listMethods inherited from class io.inverno.mod.configuration.internal.AbstractConfigurationSourcegetDecoder, setDecoder, unwrap, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParametersMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.configuration.ConfigurationSourceunwrap, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters, withParameters
- 
Constructor Details- 
PropertyFileConfigurationSourceCreates a property file configuration source with the .propertiesfile at the specified path.- Parameters:
- propertyFile- the path to the- .propertiesfile
 
- 
PropertyFileConfigurationSourcepublic PropertyFileConfigurationSource(Path propertyFile, SplittablePrimitiveDecoder<String> decoder) Creates a property file configuration source with the .propertiesfile at the specified path and the specified string value decoder.- Parameters:
- propertyFile- the path to the- .propertiesfile
- decoder- a string decoder
 
- 
PropertyFileConfigurationSourceCreates a property file configuration source with the specified input stream. - Parameters:
- propertyInput- the- .propertiesinput
 
- 
PropertyFileConfigurationSourcepublic PropertyFileConfigurationSource(InputStream propertyInput, SplittablePrimitiveDecoder<String> decoder) Creates a property file configuration source with the specified input stream and string value decoder. - Parameters:
- propertyInput- the- .propertiesinput
- decoder- a string decoder
 
- 
PropertyFileConfigurationSourceCreates a property file configuration source with the specified resource - Parameters:
- propertyResource- the- .propertiesresource
 
- 
PropertyFileConfigurationSourcepublic PropertyFileConfigurationSource(Resource propertyResource, SplittablePrimitiveDecoder<String> decoder) Creates a property file configuration source with the specified resource and string value decoder. - Parameters:
- propertyResource- the- .propertiesresource
- decoder- a string decoder
 
 
- 
- 
Method Details- 
withParameterspublic PropertyFileConfigurationSource withParameters(List<ConfigurationKey.Parameter> parameters) throws IllegalArgumentException Description copied from interface:ConfigurationSourceDefines parameters that specify the context in which configuration properties are to be retrieved. - Specified by:
- withParametersin interface- ConfigurationSource
- Specified by:
- withParametersin class- io.inverno.mod.configuration.internal.AbstractConfigurationSource<io.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashConfigurationQuery<String,- PropertyFileConfigurationSource>, - io.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashExecutableConfigurationQuery<String, - PropertyFileConfigurationSource>, - io.inverno.mod.configuration.internal.AbstractHashConfigurationSource.HashListConfigurationQuery<String, - PropertyFileConfigurationSource>, - String, - PropertyFileConfigurationSource> 
- Parameters:
- parameters- a list of parameters
- Returns:
- the executable configuration query
- Throws:
- IllegalArgumentException- if parameters were specified more than once
 
- 
withDefaultingStrategypublic PropertyFileConfigurationSource withDefaultingStrategy(DefaultingStrategy defaultingStrategy) Description copied from interface:DefaultableConfigurationSourceReturns a proxy of the defaultable configuration source instance using the specified defaulting strategy. - Parameters:
- defaultingStrategy- a defaulting strategy
- Returns:
- a new defaultable configuration source
 
- 
setPropertiesTTLSets the time-to-live duration of the properties loaded with load().If set to null, which is the default, properties are cached indefinitely. Note that this ttl doesn't apply to a source created with an InputStreamwhich is cached indefinitely since the steam can't be read twice.- Parameters:
- ttl- the properties time-to-live or null to cache properties indefinitely
 
- 
getPropertiesTTLReturns the time-to-live duration of the properties loaded with load().- Returns:
- the properties time-to-live or null if properties are cached indefinitely
 
- 
loadDescription copied from class:io.inverno.mod.configuration.internal.AbstractHashConfigurationSourceLoads the configuration properties. - Specified by:
- loadin class- io.inverno.mod.configuration.internal.AbstractHashConfigurationSource<String,- PropertyFileConfigurationSource> 
- Returns:
- A mono emitting the list of configuration properties
 
 
-