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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribe, unsubscribe, unsubscribeAllpublic static final String ALLOWLIST_PATTERN_CONFIG
public static final String ALLOWLIST_PATTERN_CONFIG_DOC
public void configure(Map<String,?> configs)
Configurableconfigure in interface Configurablepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic ConfigData get(String path)
ConfigProviderget in interface ConfigProviderpath - unusedpublic ConfigData get(String path, Set<String> keys)
ConfigProviderget in interface ConfigProviderpath - path, not used for environment variableskeys - the keys whose values will be retrieved.