public class Config
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OAUTH_ACCESS_TOKEN_IS_JWT
The name of 'oauth.access.token.is.jwt' config option
|
static java.lang.String |
OAUTH_AUDIENCE
The name of 'oauth.audience' config option
|
static java.lang.String |
OAUTH_CLIENT_ID
The name of 'oauth.client.id' config option
|
static java.lang.String |
OAUTH_CLIENT_SECRET
The name of 'oauth.client.secret' config option
|
static java.lang.String |
OAUTH_CONFIG_ID
The name of 'oauth.config.id' config option
|
static java.lang.String |
OAUTH_CONNECT_TIMEOUT_SECONDS
The name of 'oauth.connect.timeout.seconds' config option
|
static java.lang.String |
OAUTH_ENABLE_METRICS
The name of 'oauth.enable.metrics' config option
|
static java.lang.String |
OAUTH_FALLBACK_USERNAME_CLAIM
The name of 'oauth.fallback.username.claim' config option
|
static java.lang.String |
OAUTH_FALLBACK_USERNAME_PREFIX
The name of 'oauth.fallback.username.prefix' config option
|
static java.lang.String |
OAUTH_HTTP_RETRIES
The name of 'oauth.http.retries' config option
|
static java.lang.String |
OAUTH_HTTP_RETRY_PAUSE_MILLIS
The name of 'oauth.http.retry.pause.millis' config option
|
static java.lang.String |
OAUTH_READ_TIMEOUT_SECONDS
The name of 'oauth.read.timeout.seconds' config option
|
static java.lang.String |
OAUTH_SCOPE
The name of 'oauth.scope' config option
|
static java.lang.String |
OAUTH_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM
The name of 'oauth.ssl.endpoint.identification.algorithm' config option
|
static java.lang.String |
OAUTH_SSL_SECURE_RANDOM_IMPLEMENTATION
The name of 'oauth.ssl.secure.random.implementation' config option
|
static java.lang.String |
OAUTH_SSL_TRUSTSTORE_CERTIFICATES
The name of 'oauth.ssl.truststore.certificates' config option
|
static java.lang.String |
OAUTH_SSL_TRUSTSTORE_LOCATION
The name of 'oauth.ssl.truststore.location' config option
|
static java.lang.String |
OAUTH_SSL_TRUSTSTORE_PASSWORD
The name of 'oauth.ssl.truststore.password' config option
|
static java.lang.String |
OAUTH_SSL_TRUSTSTORE_TYPE
The name of 'oauth.ssl.truststore.type' config option
|
static java.lang.String |
OAUTH_TOKENS_NOT_JWT
Deprecated.
|
static java.lang.String |
OAUTH_USERNAME_CLAIM
The name of 'oauth.username.claim' config option
|
| Constructor and Description |
|---|
Config()
Use this construtor if you only want to lookup configuration in system properties and env
without any default configuration.
|
Config(java.util.Map<java.lang.String,?> p)
Use this constructor to provide default values in case some configuration is not set through system properties or ENV.
|
Config(java.util.Properties p)
Use this constructor to provide default values in case some configuration is not set through system properties or ENV.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getValue(java.lang.String key)
Get value for property key or null if not found
|
java.lang.String |
getValue(java.lang.String key,
java.lang.String fallback)
Get value for property key, returning fallback value if configuration for key is not found.
|
boolean |
getValueAsBoolean(java.lang.String key,
boolean fallback)
Get value for property key as boolean or fallback value if not found
Valid values are: "true", "false", "yes", "no", "y", "n", "1", "0"
|
int |
getValueAsInt(java.lang.String key,
int fallback)
Get value for property key as int or fallback value if not found
|
long |
getValueAsLong(java.lang.String key,
long fallback)
Get value for property key as long or fallback value if not found
|
java.net.URI |
getValueAsURI(java.lang.String key)
Get value for property key as a URI
|
static boolean |
isTrue(java.lang.String result)
Helper method the test if some boolean config option is set to 'true' or 'false'
|
static java.lang.String |
toEnvName(java.lang.String key)
Convert property key to env key.
|
void |
validate()
Validate configuration by checking for unknown or missing properties.
|
public static final java.lang.String OAUTH_CLIENT_ID
public static final java.lang.String OAUTH_CLIENT_SECRET
public static final java.lang.String OAUTH_SCOPE
public static final java.lang.String OAUTH_AUDIENCE
public static final java.lang.String OAUTH_USERNAME_CLAIM
public static final java.lang.String OAUTH_FALLBACK_USERNAME_CLAIM
public static final java.lang.String OAUTH_FALLBACK_USERNAME_PREFIX
public static final java.lang.String OAUTH_SSL_TRUSTSTORE_LOCATION
public static final java.lang.String OAUTH_SSL_TRUSTSTORE_CERTIFICATES
public static final java.lang.String OAUTH_SSL_TRUSTSTORE_PASSWORD
public static final java.lang.String OAUTH_SSL_TRUSTSTORE_TYPE
public static final java.lang.String OAUTH_SSL_SECURE_RANDOM_IMPLEMENTATION
public static final java.lang.String OAUTH_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM
public static final java.lang.String OAUTH_ACCESS_TOKEN_IS_JWT
public static final java.lang.String OAUTH_CONNECT_TIMEOUT_SECONDS
public static final java.lang.String OAUTH_READ_TIMEOUT_SECONDS
public static final java.lang.String OAUTH_HTTP_RETRIES
public static final java.lang.String OAUTH_HTTP_RETRY_PAUSE_MILLIS
public static final java.lang.String OAUTH_CONFIG_ID
public static final java.lang.String OAUTH_ENABLE_METRICS
@Deprecated public static final java.lang.String OAUTH_TOKENS_NOT_JWT
public Config()
public Config(java.util.Properties p)
p - Default property valuespublic Config(java.util.Map<java.lang.String,?> p)
p - Default property valuespublic void validate()
java.lang.RuntimeException - if validation failspublic java.lang.String getValue(java.lang.String key,
java.lang.String fallback)
key - Config keyfallback - Fallback valuepublic java.lang.String getValue(java.lang.String key)
key - Config keypublic int getValueAsInt(java.lang.String key,
int fallback)
key - Config keyfallback - Fallback valuepublic long getValueAsLong(java.lang.String key,
long fallback)
key - Config keyfallback - Fallback valuepublic boolean getValueAsBoolean(java.lang.String key,
boolean fallback)
key - Config keyfallback - Fallback valuepublic java.net.URI getValueAsURI(java.lang.String key)
key - Config keypublic static boolean isTrue(java.lang.String result)
result - The configured value of the option as Stringpublic static java.lang.String toEnvName(java.lang.String key)
key - A key of a property which should be converted to environment variable nameCopyright © 2023. All rights reserved.