io.vertx.config

## Interface ConfigRetriever

-     public interface ConfigRetriever

  Defines a configuration retriever that read configuration from `ConfigStore` and tracks changes periodically.
  Author:
    Clement Escoffier

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes the retriever.
    `ReadStream<JsonObject>` | `configStream()`
    `static ConfigRetriever` | `create(Vertx vertx)` Creates an instance of the default implementation of the `ConfigRetriever`, using the default settings (json file, system properties and environment variables).
    `static ConfigRetriever` | `create(Vertx vertx, ConfigRetrieverOptions options)` Creates an instance of the default implementation of the `ConfigRetriever`.
    `JsonObject` | `getCachedConfig()` Gets the last computed configuration.
    `void` | `getConfig(Handler<AsyncResult<JsonObject>> completionHandler)` Reads the configuration from the different `ConfigStore` and computes the final configuration.
    `static Future<JsonObject>` | `getConfigAsFuture(ConfigRetriever retriever)` Same as `getConfig(Handler)`, but returning a `Future` object.
    `void` | `listen(Handler<ConfigChange> listener)` Registers a listener receiving configuration changes.

- - ### Method Detail

    - #### create

          static ConfigRetriever create(Vertx vertx,
                                        ConfigRetrieverOptions options)

      Creates an instance of the default implementation of the `ConfigRetriever`.
      Parameters:
        `vertx` - the vert.x instance
        `options` - the options, must not be `null`, must contain the list of configured store.
      Returns:
        the created instance.

    - #### create

          static ConfigRetriever create(Vertx vertx)

      Creates an instance of the default implementation of the `ConfigRetriever`, using the default settings (json file, system properties and environment variables).
      Parameters:
        `vertx` - the vert.x instance
      Returns:
        the created instance.

    - #### getConfigAsFuture

          static Future<JsonObject> getConfigAsFuture(ConfigRetriever retriever)

      Same as `getConfig(Handler)`, but returning a `Future` object. The result is a `JsonObject`.
      Parameters:
        `retriever` - the config retrieve
      Returns:
        the future completed when the configuration is retrieved

    - #### getConfig

          void getConfig(Handler<AsyncResult<JsonObject>> completionHandler)

      Reads the configuration from the different `ConfigStore` and computes the final configuration.
      Parameters:
        `completionHandler` - handler receiving the computed configuration, or a failure if the configuration cannot be retrieved

    - #### close

          void close()

      Closes the retriever.

    - #### getCachedConfig

          JsonObject getCachedConfig()

      Gets the last computed configuration.
      Returns:
        the last configuration

    - #### listen

          void listen(Handler<ConfigChange> listener)

      Registers a listener receiving configuration changes. This method cannot only be called if the configuration is broadcasted.
      Parameters:
        `listener` - the listener

    - #### configStream

          ReadStream<JsonObject> configStream()

      Returns:
        the stream of configurations. It's single stream (unicast) and that delivers the last known config and the successors periodically.

Copyright © 2018 Eclipse. All rights reserved.