Class ConfigRetriever

java.lang.Object
io.vertx.reactivex.config.ConfigRetriever
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate

public class ConfigRetriever extends Object implements io.vertx.lang.rx.RxDelegate
Defines a configuration retriever that read configuration from and tracks changes periodically.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final io.vertx.lang.rx.TypeArg<ConfigRetriever> __TYPE_ARG
  • Constructor Details

    • ConfigRetriever

      public ConfigRetriever(ConfigRetriever delegate)
    • ConfigRetriever

      public ConfigRetriever(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public ConfigRetriever getDelegate()
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
    • create

      public 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

      public 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.
    • getConfig

      public Future<JsonObject> getConfig()
      Reads the configuration from the different and computes the final configuration.
      Returns:
      a future notified the computed configuration, or a failure if the configuration cannot be retrieved
    • rxGetConfig

      public Single<JsonObject> rxGetConfig()
      Reads the configuration from the different and computes the final configuration.
      Returns:
      a future notified the computed configuration, or a failure if the configuration cannot be retrieved
    • close

      public Future<Void> close()
      Closes the retriever.
      Returns:
    • rxClose

      public Completable rxClose()
      Closes the retriever.
      Returns:
    • getCachedConfig

      public JsonObject getCachedConfig()
      Gets the last computed configuration.
      Returns:
      the last configuration
    • listen

      public 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
    • setBeforeScanHandler

      public ConfigRetriever setBeforeScanHandler(Handler<Void> handler)
      Registers a handler called before every scan. This method is mostly used for logging purpose.
      Parameters:
      handler - the handler, must not be null
      Returns:
      the current config retriever
    • setConfigurationProcessor

      public ConfigRetriever setConfigurationProcessor(Function<JsonObject, JsonObject> processor)
      Registers a handler that process the configuration before being injected into or listen(Handler). This allows the code to customize the configuration.
      Parameters:
      processor - the processor, must not be null. The method must not return null. The returned configuration is used. If the processor does not update the configuration, it must return the input configuration. If the processor throws an exception, the failure is passed to the handler.
      Returns:
      the current config retriever
    • configStream

      public ReadStream<JsonObject> configStream()
      Returns:
      the stream of configurations. It's single stream (unicast) and that delivers the last known config and the successors periodically.
    • newInstance

      public static ConfigRetriever newInstance(ConfigRetriever arg)