Package io.vertx.mutiny.config
Class ConfigRetriever
java.lang.Object
io.vertx.mutiny.config.ConfigRetriever
- All Implemented Interfaces:
MutinyDelegate
Defines a configuration retriever that read configuration from
and tracks changes periodically.
NOTE: This class has been automatically generated from the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfigRetriever
(io.vertx.config.ConfigRetriever delegate) ConfigRetriever
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
ReadStream<io.vertx.core.json.JsonObject>
static ConfigRetriever
static ConfigRetriever
boolean
io.vertx.core.json.JsonObject
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
Reads the configuration from the different and computes the final configuration.io.vertx.core.json.JsonObject
Blocking variant ofgetConfig()
.void
Variant ofgetConfig()
that ignores the result of the operation.io.vertx.config.ConfigRetriever
int
hashCode()
void
static ConfigRetriever
newInstance
(io.vertx.config.ConfigRetriever arg) setBeforeScanHandler
(Runnable handler) setConfigurationProcessor
(Function<io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject> processor) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
ConfigRetriever
public ConfigRetriever(io.vertx.config.ConfigRetriever delegate) -
ConfigRetriever
-
-
Method Details
-
getDelegate
public io.vertx.config.ConfigRetriever getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
create
- Parameters:
vertx
- the vert.x instanceoptions
- the options, must not benull
, must contain the list of configured store.- Returns:
- the created instance.
-
create
- 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
uni
firing 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
- Parameters:
listener
- the listener
-
setBeforeScanHandler
- 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
- Returns:
- the stream of configurations. It's single stream (unicast) and that delivers the last known config and the successors periodically.
-
newInstance
-