public final class EtcdConfigSourceBuilder extends AbstractParsableConfigSource.Builder<EtcdConfigSourceBuilder,EtcdConfigSourceBuilder.EtcdEndpoint>
It allows to configure following properties:
uri - etcd endpointkey - an etcd key that is associated to value with configurationversion - an etcd API versionmandatory - is existence of configuration resource mandatory (by default) or is optional?media-type - configuration content media type to be used to look for appropriate ConfigParser;parser - or directly set ConfigParser instance to be used to parse the source;
If the Etcd ConfigSource is mandatory and a uri is not responsive or key does not exist
then Source.load() throws ConfigException.
One of media-type and parser properties must be set to be clear how to parse the content. If both of them
are set, then parser has precedence.
| Modifier and Type | Class and Description |
|---|---|
static class |
EtcdConfigSourceBuilder.EtcdApi
EtcdApi determines which etcd API version will be used. |
static class |
EtcdConfigSourceBuilder.EtcdEndpoint
Etcd endpoint remote descriptor.
|
| Modifier and Type | Method and Description |
|---|---|
ConfigSource |
build()
Builds new instance of Etcd ConfigSource.
|
static EtcdConfigSourceBuilder |
from(Config metaConfig)
Initializes config source instance from meta configuration properties,
see
ConfigSources.load(Config). |
static EtcdConfigSourceBuilder |
from(java.net.URI uri,
java.lang.String key,
EtcdConfigSourceBuilder.EtcdApi api)
Create new instance of builder with specified mandatory Etcd endpoint remote descriptor.
|
protected EtcdConfigSourceBuilder.EtcdEndpoint |
getTarget()
Returns key source attributes (target).
|
protected EtcdConfigSourceBuilder |
init(Config metaConfig)
Initialize builder from specified configuration properties.
|
getMediaType, getParser, mediaType, parserget, getMediaTypeMapping, getParserMapping, mediaTypeMapping, parserMappingchangesExecutor, changesMaxBuffer, getChangesExecutor, getChangesMaxBuffer, getPollingStrategy, getRetryPolicy, isMandatory, optional, pollingStrategy, pollingStrategy, retryPolicypublic static EtcdConfigSourceBuilder from(java.net.URI uri, java.lang.String key, EtcdConfigSourceBuilder.EtcdApi api)
uri - an Etcd endpoint remote URI.key - an Etcd key with which the value containing the configuration is associated.api - an Etcd API version.from(Config)public static EtcdConfigSourceBuilder from(Config metaConfig) throws ConfigMappingException, MissingValueException
ConfigSources.load(Config).
Mandatory properties, see from(URI, String, EtcdApi):
uri - type URIkey - type Stringapi - type EtcdConfigSourceBuilder.EtcdApi, e.g. v3properties: see init(Config).metaConfig - meta-configuration used to initialize returned config source builder instance from.metaConfigMissingValueException - in case the configuration tree does not contain all expected sub-nodes
required by the mapper implementation to provide instance of Java type.ConfigMappingException - in case the mapper fails to map the (existing) configuration tree represented by the
supplied configuration node to an instance of a given Java type.from(URI, String, EtcdApi),
init(Config)protected EtcdConfigSourceBuilder init(Config metaConfig)
AbstractParsableConfigSource.Builder
Supported configuration properties:
optional - type boolean, see AbstractSource.Builder.optional()polling-strategy - see PollingStrategy for details about configuration format,
see AbstractSource.Builder.pollingStrategy(Supplier) or AbstractSource.Builder.pollingStrategy(Function)media-type-mapping - type Map - key to media type, see AbstractConfigSource.Builder.mediaTypeMapping(Function)media-type - type String, see AbstractParsableConfigSource.Builder.mediaType(String)init in class AbstractParsableConfigSource.Builder<EtcdConfigSourceBuilder,EtcdConfigSourceBuilder.EtcdEndpoint>metaConfig - configuration properties used to initialize a builder instance.protected EtcdConfigSourceBuilder.EtcdEndpoint getTarget()
AbstractSource.BuildergetTarget in class AbstractSource.Builder<EtcdConfigSourceBuilder,EtcdConfigSourceBuilder.EtcdEndpoint,ConfigSource>public ConfigSource build()
If the Etcd ConfigSource is mandatory and a uri is not responsive or key does not exist
then Source.load() throws ConfigException.
build in class AbstractSource.Builder<EtcdConfigSourceBuilder,EtcdConfigSourceBuilder.EtcdEndpoint,ConfigSource>Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.