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 |
|---|---|
EtcdConfigSource |
build()
Builds new instance of Etcd ConfigSource.
|
static EtcdConfigSourceBuilder |
create(Config metaConfig)
Initializes config source instance from meta configuration properties,
see
ConfigSources.load(Config). |
static EtcdConfigSourceBuilder |
create(URI uri,
String key,
EtcdConfigSourceBuilder.EtcdApi api)
Create new instance of builder with specified mandatory Etcd endpoint remote descriptor.
|
protected EtcdConfigSourceBuilder |
init(Config metaConfig)
Initialize builder from specified configuration properties.
|
protected EtcdConfigSourceBuilder.EtcdEndpoint |
target()
Returns key source attributes (target).
|
mediaType, mediaType, parser, parserget, mediaTypeMapping, mediaTypeMapping, parserMapping, parserMappingchangesExecutor, changesExecutor, changesMaxBuffer, changesMaxBuffer, isMandatory, optional, pollingStrategy, pollingStrategy, pollingStrategy, retryPolicy, retryPolicy, thisBuilderpublic static EtcdConfigSourceBuilder create(URI uri, 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.create(Config)public static EtcdConfigSourceBuilder create(Config metaConfig) throws ConfigMappingException, MissingValueException
ConfigSources.load(Config).
Mandatory properties, see create(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.create(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 target()
AbstractSource.Buildertarget in class AbstractSource.Builder<EtcdConfigSourceBuilder,EtcdConfigSourceBuilder.EtcdEndpoint,ConfigSource>public EtcdConfigSource 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 interface Builder<ConfigSource>build in class AbstractSource.Builder<EtcdConfigSourceBuilder,EtcdConfigSourceBuilder.EtcdEndpoint,ConfigSource>Copyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.