public class EnvVarConfigProvider extends Object implements ConfigProvider
ConfigProvider
based on environment variables.
Keys correspond to the names of the environment variables, paths are currently not being used.
Using an allowlist pattern ALLOWLIST_PATTERN_CONFIG
that supports regular expressions,
it is possible to limit access to specific environment variables. Default allowlist pattern is ".*".Modifier and Type | Field and Description |
---|---|
static String |
ALLOWLIST_PATTERN_CONFIG |
static String |
ALLOWLIST_PATTERN_CONFIG_DOC |
Constructor and Description |
---|
EnvVarConfigProvider() |
EnvVarConfigProvider(Map<String,String> envVarsAsArgument) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
configure(Map<String,?> configs)
Configure this class with the given key-value pairs
|
ConfigData |
get(String path)
Retrieves the data at the given path.
|
ConfigData |
get(String path,
Set<String> keys)
Retrieves the data with the given keys at the given path.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
subscribe, unsubscribe, unsubscribeAll
public static final String ALLOWLIST_PATTERN_CONFIG
public static final String ALLOWLIST_PATTERN_CONFIG_DOC
public void configure(Map<String,?> configs)
Configurable
configure
in interface Configurable
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public ConfigData get(String path)
ConfigProvider
get
in interface ConfigProvider
path
- unusedpublic ConfigData get(String path, Set<String> keys)
ConfigProvider
get
in interface ConfigProvider
path
- path, not used for environment variableskeys
- the keys whose values will be retrieved.