- All Known Implementing Classes:
EtcdConfigSourceProvider
,GitConfigSourceProvider
,OciSecretsConfigSourceProvider
public interface ConfigSourceProvider
Java service loader service to provide a config source based on meta configuration.
-
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of the meta configurable using the provided meta configuration.default List<ConfigSource>
createMulti
(String type, Config metaConfig) Create a list of configuration sources from a single configuration.Return a set of supported types.boolean
Return true if this provider supports the type of meta-configurable object.
-
Method Details
-
createMulti
Create a list of configuration sources from a single configuration.This method is called (only) when the meta configuration property
multi-source
is set totrue
.Example: for classpath config source, we may want to read all instances of the resource on classpath.
- Parameters:
type
- type of the config sourcemetaConfig
- meta configuration of the config source- Returns:
- a list of config sources, at least one MUST be returned, so we can correctly validate optional/mandatory sources.
-
supports
Return true if this provider supports the type of meta-configurable object.- Parameters:
type
- type that is supported (such asfile
forConfigSource
meta configurable)- Returns:
true
if this provider can create instances of the type
-
create
Create an instance of the meta configurable using the provided meta configuration.- Parameters:
type
- type of the meta configurablemetaConfig
- meta configuration- Returns:
- meta configurable configured from the metaConfig
-
supported
Return a set of supported types. Used for error handling.- Returns:
- a set of types supported by this provider
-