/** * Updates the given record. The record must has been published, and has it's registration id set. * @param record the updated record * @param resultHandler handler called when the lookup has been completed. */ public void update(Record record, Handler<AsyncResult<Record>> resultHandler) { delegate.update(record, resultHandler); }
/** * Updates the given record. The record must has been published, and has it's registration id set. * @param record the updated record * @param resultHandler handler called when the lookup has been completed. */ public void update(Record record, Handler<AsyncResult<Record>> resultHandler) { delegate.update(record, resultHandler); }
/** * {@inheritDoc} */ @Override public void update(Record record, Handler<AsyncResult<Record>> resultHandler) { unmanagedDiscoveryInstance.update(record, resultHandler); }
private void updateService(final ServiceDiscovery discovery, final Set<String> ids) { // Update service into current zero system. Observable.fromIterable(ids) .map(REGISTRITIONS::get) .subscribe(item -> discovery.update(item, result -> { if (result.succeeded()) { final Record record = result.result(); // Update successfully this.successFinished(record); } else { LOGGER.info(Info.REG_FAILURE, result.cause().getMessage(), "Update"); } })); }
private void updateService(final ServiceDiscovery discovery, final Set<String> ids) { // Update service into current zero system. Observable.fromIterable(ids) .map(REGISTRITIONS::get) .subscribe(item -> discovery.update(item, result -> { if (result.succeeded()) { final Record record = result.result(); // Update successfully this.successFinished(record); } else { LOGGER.info(Info.REG_FAILURE, result.cause().getMessage(), "Update"); } })); }
public static void update(io.vertx.servicediscovery.ServiceDiscovery j_receiver, java.util.Map<String, Object> record, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) { j_receiver.update(record != null ? new io.vertx.servicediscovery.Record(io.vertx.core.impl.ConversionHelper.toJsonObject(record)) : null, resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.servicediscovery.Record>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.servicediscovery.Record> ar) { resultHandler.handle(ar.map(event -> event != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(event.toJson()) : null)); } } : null); } public static java.util.Map<String, Object> options(io.vertx.servicediscovery.ServiceDiscovery j_receiver) {
private void update(RoutingContext routingContext) { String uuid = routingContext.request().getParam("uuid"); JsonObject json = routingContext.getBodyAsJson(); Record record = new Record(json); if (!uuid.equals(record.getRegistration())) { routingContext.fail(400); return; } discovery.update(record, ar -> { if (ar.failed()) { routingContext.fail(ar.cause()); } else { routingContext.response().setStatusCode(200) .putHeader("Content-Type", "application/json") .end(ar.result().toJson().toString()); } }); }
private void update(RoutingContext routingContext) { String uuid = routingContext.request().getParam("uuid"); JsonObject json = routingContext.getBodyAsJson(); Record record = new Record(json); if (!uuid.equals(record.getRegistration())) { routingContext.fail(400); return; } discovery.update(record, ar -> { if (ar.failed()) { routingContext.fail(ar.cause()); } else { routingContext.response().setStatusCode(200) .putHeader("Content-Type", "application/json") .end(ar.result().toJson().toString()); } }); }
discovery.update(new Record(record).setMetadata(new JsonObject().put("foo", "foo_value_2")), ar -> updated.set(true)); await().until(updated::get); assertNotSame(exporter.state.get(id), exported);
discovery.update(new Record(record).setMetadata(new JsonObject().put("foo", "foo_value_2")), ar -> updated.set(true)); await().until(updated::get); assertNotSame(exporter.state.get(id), exported);