Class EtcdConfigSourceBuilder

  • All Implemented Interfaces:
    Builder<ConfigSource>, Supplier<ConfigSource>

    public final class EtcdConfigSourceBuilder
    extends AbstractParsableConfigSource.Builder<EtcdConfigSourceBuilder,​EtcdConfigSourceBuilder.EtcdEndpoint>
    Etcd ConfigSource builder.

    It allows to configure following properties:

    • uri - etcd endpoint
    • key - an etcd key that is associated to value with configuration
    • version - an etcd API version
    • mandatory - 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.