@Override public ConsulService healthServiceNodesWithOptions(String service, boolean passing, ServiceQueryOptions options, Handler<AsyncResult<ServiceEntryList>> resultHandler) { consulClient.healthServiceNodesWithOptions(service, passing, options, resultHandler); return this; }
/** * Returns the nodes providing the service. This endpoint is very similar to the {@link io.vertx.rxjava.ext.consul.ConsulClient#catalogServiceNodesWithOptions} endpoint; * however, this endpoint automatically returns the status of the associated health check as well as any system level health checks. * @param service the service name * @param passing if true, filter results to only nodes with all checks in the passing state * @param options options used to request services * @param resultHandler will be provided with list of services * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient healthServiceNodesWithOptions(String service, boolean passing, ServiceQueryOptions options, Handler<AsyncResult<ServiceEntryList>> resultHandler) { delegate.healthServiceNodesWithOptions(service, passing, options, resultHandler); return this; }
/** * Returns the nodes providing the service. This endpoint is very similar to the {@link io.vertx.rxjava.ext.consul.ConsulClient#catalogServiceNodesWithOptions} endpoint; * however, this endpoint automatically returns the status of the associated health check as well as any system level health checks. * @param service the service name * @param passing if true, filter results to only nodes with all checks in the passing state * @param options options used to request services * @param resultHandler will be provided with list of services * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient healthServiceNodesWithOptions(String service, boolean passing, ServiceQueryOptions options, Handler<AsyncResult<ServiceEntryList>> resultHandler) { delegate.healthServiceNodesWithOptions(service, passing, options, resultHandler); return this; }
public static io.vertx.ext.consul.ConsulClient healthServiceNodesWithOptions(io.vertx.ext.consul.ConsulClient j_receiver, java.lang.String service, boolean passing, 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.healthServiceNodesWithOptions(service, passing, options != null ? new io.vertx.ext.consul.ServiceQueryOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.consul.ServiceEntryList>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.ext.consul.ServiceEntryList> 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 catalogServices(io.vertx.ext.consul.ConsulClient j_receiver, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) {
@Override void wait(long index, Handler<AsyncResult<State<ServiceEntryList>>> handler) { BlockingQueryOptions bOpts = new BlockingQueryOptions().setWait(BLOCKING_WAIT).setIndex(index); ServiceQueryOptions sOpts = new ServiceQueryOptions().setBlockingOptions(bOpts); consulClient.healthServiceNodesWithOptions(service, false, sOpts, h -> handler.handle(h.map(services -> new State<ServiceEntryList>(services, services.getIndex())))); } }
ServiceEntryList list2 = getAsync(h -> ctx.readClient().healthServiceNodesWithOptions("service", true, opts2, h)); assertEquals(list2.getList().size(), 1); assertEquals(list2.getList().get(0).getService().getId(), "id2"); ServiceQueryOptions options = new ServiceQueryOptions() .setBlockingOptions(new BlockingQueryOptions().setIndex(idx)); ctx.readClient().healthServiceNodesWithOptions("service", true, options, h -> { waitComplete(vertx, fut, h.result().getIndex(), h.result().getList().size() == 1); });