/** * Returns the nodes registered in a datacenter * @param options options used to request nodes * @param resultHandler will be provided with list of nodes * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient catalogNodesWithOptions(NodeQueryOptions options, Handler<AsyncResult<NodeList>> resultHandler) { delegate.catalogNodesWithOptions(options, resultHandler); return this; }
@Override public ConsulService catalogNodesWithOptions(NodeQueryOptions options, Handler<AsyncResult<NodeList>> resultHandler) { consulClient.catalogNodesWithOptions(options, resultHandler); return this; }
/** * Returns the nodes registered in a datacenter * @param options options used to request nodes * @param resultHandler will be provided with list of nodes * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient catalogNodesWithOptions(NodeQueryOptions options, Handler<AsyncResult<NodeList>> resultHandler) { delegate.catalogNodesWithOptions(options, resultHandler); return this; }
public static io.vertx.ext.consul.ConsulClient catalogNodesWithOptions(io.vertx.ext.consul.ConsulClient j_receiver, java.util.Map<String, Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.catalogNodesWithOptions(options != null ? new io.vertx.ext.consul.NodeQueryOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.consul.NodeList>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.ext.consul.NodeList> ar) { resultHandler.handle(ar.map(event -> event != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(event.toJson()) : null)); } } : null)); return j_receiver; } public static io.vertx.ext.consul.ConsulClient healthChecks(io.vertx.ext.consul.ConsulClient j_receiver, java.lang.String service, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) {
@Override void wait(long index, Handler<AsyncResult<State<NodeList>>> handler) { BlockingQueryOptions bOpts = new BlockingQueryOptions().setWait(BLOCKING_WAIT).setIndex(index); NodeQueryOptions qOpts = new NodeQueryOptions().setBlockingOptions(bOpts); consulClient.catalogNodesWithOptions(qOpts, h -> handler.handle(h.map(nodes -> new State<NodeList>(nodes, nodes.getIndex())))); } }
NodeQueryOptions blockingQueryOptions1 = new NodeQueryOptions() .setBlockingOptions(new BlockingQueryOptions().setIndex(nodes1.getIndex())); ctx.readClient().catalogNodesWithOptions(blockingQueryOptions1, h -> { System.out.println(">>>>>>> new node event received"); List<String> names = h.result().getList().stream().map(Node::getName).collect(Collectors.toList()); .setBlockingOptions(new BlockingQueryOptions().setIndex(nodes2.getIndex())); System.out.println(">>>>>>> wait for new node detaching"); ctx.readClient().catalogNodesWithOptions(blockingQueryOptions2, tc.asyncAssertSuccess()); vertx.executeBlocking(b2 -> ctx.detachAgent(attached), detached -> System.out.println(">>>>>>> new node detached")); }));