Class Watch<T>
java.lang.Object
io.vertx.reactivex.ext.consul.Watch<T>
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
Watches are a way of specifying a view of data (e.g. list of nodes, KV pairs, health checks)
which is monitored for updates. When an update is detected, an
Handler with WatchResult is invoked.
All errors, except java.util.concurrent.TimeoutException, will be handled, with resubscribing with a progressive delay.
All timeout errors will be ignored, with resubscribing without any delay.
As an example, you could watch the status of health checks and notify when a check is critical.
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreatesWatchto monitoring the custom user events.events(String event, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the custom user events.inthashCode()CreatesWatchto monitoring a specific key in the KV store.key(String key, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring a specific key in the KV store.static Watch<KeyValueList> CreatesWatchto monitoring a prefix of keys in the KV store.static Watch<KeyValueList> keyPrefix(String keyPrefix, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring a prefix of keys in the KV store.static <T> Watch<T> newInstance(Watch arg) static <T> Watch<T> newInstance(Watch arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T) nodeHealthChecks(String node, CheckQueryOptions opt, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the health checks of the nodes.CreatesWatchto monitoring the list of available nodes.nodes(Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the list of available nodes.static Watch<ServiceEntryList> CreatesWatchto monitoring the nodes providing the service.static Watch<ServiceEntryList> service(String service, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the nodes providing the service.serviceHealthChecks(String service, CheckQueryOptions checkQueryOptions, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the health checks of the nodes.static Watch<ServiceList> CreatesWatchto monitoring the list of available services.static Watch<ServiceList> services(Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the list of available services.setHandler(Handler<WatchResult<T>> handler) Set the result handler.start()Start thisWatchvoidstop()Stop the watch and release its resourcestoString()
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
Watch
-
Watch
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
key
CreatesWatchto monitoring a specific key in the KV store. The underlying Consul client will be created with default options. This maps to the /v1/kv/ API internally.- Parameters:
key- the keyvertx- theVertxinstance- Returns:
- the
Watchinstance
-
key
CreatesWatchto monitoring a specific key in the KV store. This maps to the /v1/kv/ API internally.- Parameters:
key- the keyvertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
keyPrefix
CreatesWatchto monitoring a prefix of keys in the KV store. The underlying Consul client will be created with default options. This maps to the /v1/kv/ API internally.- Parameters:
keyPrefix- the keyvertx- theVertxinstance- Returns:
- the
Watchinstance
-
keyPrefix
public static Watch<KeyValueList> keyPrefix(String keyPrefix, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring a prefix of keys in the KV store. This maps to the /v1/kv/ API internally.- Parameters:
keyPrefix- the keyvertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
services
CreatesWatchto monitoring the list of available services. The underlying Consul client will be created with default options. This maps to the /v1/catalog/services API internally.- Parameters:
vertx- theVertxinstance- Returns:
- the
Watchinstance
-
services
CreatesWatchto monitoring the list of available services. This maps to the /v1/catalog/services API internally.- Parameters:
vertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
service
CreatesWatchto monitoring the nodes providing the service. Nodes will be sorted by distance from the consul agent. The underlying Consul client will be created with default options. This maps to the /v1/health/service/<service> API internally.- Parameters:
service- the service namevertx- theVertxinstance- Returns:
- the
Watchinstance
-
service
public static Watch<ServiceEntryList> service(String service, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the nodes providing the service. Nodes will be sorted by distance from the consul agent. This maps to the /v1/health/service/<service> API internally.- Parameters:
service- the service namevertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
events
CreatesWatchto monitoring the custom user events. The underlying Consul client will be created with default options. This maps to the /v1/event/list API internally.- Parameters:
event- the event namevertx- theVertxinstance- Returns:
- the
Watchinstance
-
events
CreatesWatchto monitoring the custom user events. This maps to the /v1/event/list API internally.- Parameters:
event- the event namevertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
nodes
CreatesWatchto monitoring the list of available nodes. The underlying Consul client will be created with default options. This maps to the /v1/catalog/nodes API internally.- Parameters:
vertx- theVertxinstance- Returns:
- the
Watchinstance
-
nodes
CreatesWatchto monitoring the list of available nodes. This maps to the /v1/catalog/nodes API internally.- Parameters:
vertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
nodeHealthChecks
public static Watch<CheckList> nodeHealthChecks(String node, CheckQueryOptions opt, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the health checks of the nodes.- Parameters:
node- node name or IDopt- options like namespace, datacenter and filtervertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
serviceHealthChecks
public static Watch<CheckList> serviceHealthChecks(String service, CheckQueryOptions checkQueryOptions, Vertx vertx, ConsulClientOptions options) CreatesWatchto monitoring the health checks of the nodes.- Parameters:
service- the service namecheckQueryOptions- options used to request checksvertx- theVertxinstanceoptions- the options to create underlying Consul client- Returns:
- the
Watchinstance
-
setHandler
Set the result handler. As data is changed, the handler will be called with the result.- Parameters:
handler- the result handler- Returns:
- reference to this, for fluency
-
start
-
stop
public void stop()Stop the watch and release its resources -
newInstance
-
newInstance
-