Package io.vertx.mutiny.config
Class ConfigRetriever
- java.lang.Object
-
- io.vertx.mutiny.config.ConfigRetriever
-
public class ConfigRetriever extends Object
Defines a configuration retriever that read configuration from and tracks changes periodically. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<ConfigRetriever>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description ConfigRetriever(io.vertx.config.ConfigRetriever delegate)ConfigRetriever(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ReadStream<io.vertx.core.json.JsonObject>configStream()static ConfigRetrievercreate(Vertx vertx)static ConfigRetrievercreate(Vertx vertx, io.vertx.config.ConfigRetrieverOptions options)booleanequals(Object o)io.vertx.core.json.JsonObjectgetCachedConfig()io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>getConfig()Reads the configuration from the different and computes the final configuration.io.vertx.core.json.JsonObjectgetConfigAndAwait()Blocking variant ofgetConfig().voidgetConfigAndForget()Variant ofgetConfig()that ignores the result of the operation.io.vertx.config.ConfigRetrievergetDelegate()inthashCode()voidlisten(Consumer<io.vertx.config.ConfigChange> listener)static ConfigRetrievernewInstance(io.vertx.config.ConfigRetriever arg)ConfigRetrieversetBeforeScanHandler(Runnable handler)ConfigRetrieversetConfigurationProcessor(Function<io.vertx.core.json.JsonObject,io.vertx.core.json.JsonObject> processor)StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<ConfigRetriever> __TYPE_ARG
-
-
Constructor Detail
-
ConfigRetriever
public ConfigRetriever(io.vertx.config.ConfigRetriever delegate)
-
ConfigRetriever
public ConfigRetriever(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.config.ConfigRetriever getDelegate()
-
create
public static ConfigRetriever create(Vertx vertx, io.vertx.config.ConfigRetrieverOptions options)
- Parameters:
vertx- the vert.x instanceoptions- the options, must not benull, must contain the list of configured store.- Returns:
- the created instance.
-
create
public static ConfigRetriever create(Vertx vertx)
- Parameters:
vertx- the vert.x instance- Returns:
- the created instance.
-
getConfig
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> getConfig()
Reads the configuration from the different and computes the final configuration.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
getConfigAndAwait
public io.vertx.core.json.JsonObject getConfigAndAwait()
Blocking variant ofgetConfig().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the JsonObject instance produced by the operation.
-
getConfigAndForget
public void getConfigAndForget()
Variant ofgetConfig()that ignores the result of the operation.This method subscribes on the result of
getConfig(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetConfig()but you don't need to compose it with other operations.
-
close
public void close()
-
getCachedConfig
public io.vertx.core.json.JsonObject getCachedConfig()
- Returns:
- the last configuration
-
listen
public void listen(Consumer<io.vertx.config.ConfigChange> listener)
- Parameters:
listener- the listener
-
setBeforeScanHandler
public ConfigRetriever setBeforeScanHandler(Runnable handler)
- Parameters:
handler- the handler, must not benull- Returns:
-
setConfigurationProcessor
public ConfigRetriever setConfigurationProcessor(Function<io.vertx.core.json.JsonObject,io.vertx.core.json.JsonObject> processor)
- Parameters:
processor- the processor, must not benull. The method must not returnnull. 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 thegetConfig()handler.- Returns:
- the current config retriever
-
configStream
public ReadStream<io.vertx.core.json.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(io.vertx.config.ConfigRetriever arg)
-
-