/** * {@inheritDoc} */ @Override public ServiceReference getReferenceWithConfiguration(Record record, JsonObject configuration) { return unmanagedDiscoveryInstance.getReferenceWithConfiguration(record, configuration); }
public ServiceReference lookupForAReferenceWithConfiguration(Record record, JsonObject configuration) { return serviceDiscovery.getReferenceWithConfiguration(record, configuration); }
/** * Gets a service reference from the given record, the reference is configured with the given json object. * @param record the chosen record * @param configuration the configuration * @return the service reference, that allows retrieving the service object. Once called the service reference is cached, and need to be released. */ public io.vertx.rxjava.servicediscovery.ServiceReference getReferenceWithConfiguration(Record record, JsonObject configuration) { io.vertx.rxjava.servicediscovery.ServiceReference ret = io.vertx.rxjava.servicediscovery.ServiceReference.newInstance(delegate.getReferenceWithConfiguration(record, configuration)); return ret; }
/** * Gets a service reference from the given record, the reference is configured with the given json object. * @param record the chosen record * @param configuration the configuration * @return the service reference, that allows retrieving the service object. Once called the service reference is cached, and need to be released. */ public io.vertx.rxjava.servicediscovery.ServiceReference getReferenceWithConfiguration(Record record, JsonObject configuration) { io.vertx.rxjava.servicediscovery.ServiceReference ret = io.vertx.rxjava.servicediscovery.ServiceReference.newInstance(delegate.getReferenceWithConfiguration(record, configuration)); return ret; }
/** * Convenient method that looks for a Redis data source and provides the configured {@link io.vertx.redis.RedisClient}. * The async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, optional * @param consumerConfiguration The additional consumer configuration * @param resultHandler The result handler */ static void getRedisClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<RedisClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<RedisClient>getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); }
/** * Convenient method that looks for a JDBC datasource source and provides the configured {@link io.vertx.ext.jdbc.JDBCClient}. The * async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, optional * @param consumerConfiguration the consumer configuration * @param resultHandler the result handler */ static void getJDBCClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<JDBCClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<JDBCClient>getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link WebClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client * * @param discovery The service discovery instance * @param filter The filter, optional * @param conf the configuration of the client * @param resultHandler The result handler */ static void getWebClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf, Handler<AsyncResult<WebClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture(discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf) .getAs(WebClient.class))); } }); }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link HttpClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client * * @param discovery The service discovery instance * @param filter The filter, optional * @param conf the configuration of the client * @param resultHandler The result handler */ static void getClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf, Handler<AsyncResult<HttpClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture(discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf).get ())); } }); }
/** * Convenient method that looks for a Mongo datasource source and provides the configured {@link io.vertx.ext.mongo.MongoClient}. The * async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, optional * @param consumerConfiguration the consumer configuration * @param resultHandler the result handler */ static void getMongoClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<MongoClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); } }
/** * Convenient method that looks for a JDBC datasource source and provides the configured {@link io.vertx.ext.jdbc.JDBCClient}. The * async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, optional * @param consumerConfiguration the consumer configuration * @param resultHandler the result handler */ static void getJDBCClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<JDBCClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<JDBCClient>getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); }
/** * Convenient method that looks for a Redis data source and provides the configured {@link io.vertx.redis.RedisClient}. * The async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, cannot be {@code null} * @param consumerConfiguration The additional consumer configuration * @param resultHandler The result handler */ static void getRedisClient(ServiceDiscovery discovery, Function<Record, Boolean> filter, JsonObject consumerConfiguration, Handler<AsyncResult<RedisClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<RedisClient>getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); } }
/** * Convenient method that looks for a Mongo datasource source and provides the configured {@link io.vertx.ext.mongo.MongoClient}. The * async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, optional * @param consumerConfiguration the consumer configuration * @param resultHandler the result handler */ static void getMongoClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<MongoClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); } }
/** * Convenient method that looks for a Redis data source and provides the configured {@link io.vertx.redis.RedisClient}. * The async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, optional * @param consumerConfiguration The additional consumer configuration * @param resultHandler The result handler */ static void getRedisClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<RedisClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<RedisClient>getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link HttpClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client. * * @param discovery The service discovery instance * @param filter The filter * @param conf the configuration of the client * @param resultHandler The result handler */ static void getClient(ServiceDiscovery discovery, Function<Record, Boolean> filter, JsonObject conf, Handler<AsyncResult<HttpClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf).get())); } }); }
/** * Convenient method that looks for a JDBC datasource source and provides the configured {@link io.vertx.ext.jdbc.JDBCClient}. The * async result is marked as failed is there are no matching services, or if the lookup fails. * * @param discovery The service discovery instance * @param filter The filter, must not be {@code null} * @param consumerConfiguration the consumer configuration * @param resultHandler the result handler */ static void getJDBCClient(ServiceDiscovery discovery, Function<Record, Boolean> filter, JsonObject consumerConfiguration, Handler<AsyncResult<JDBCClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<JDBCClient>getReferenceWithConfiguration(ar.result(), consumerConfiguration).get())); } }); } }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link WebClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client. * * @param discovery The service discovery instance * @param filter The filter * @param conf the configuration of the client * @param resultHandler The result handler */ static void getWebClient(ServiceDiscovery discovery, Function<Record, Boolean> filter, JsonObject conf, Handler<AsyncResult<WebClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf).getAs(WebClient.class))); } }); } }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link HttpClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client * * @param discovery The service discovery instance * @param filter The filter, optional * @param conf the configuration of the client * @param resultHandler The result handler */ static void getClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf, Handler<AsyncResult<HttpClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture(discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf).get ())); } }); }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link WebClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client * * @param discovery The service discovery instance * @param filter The filter, optional * @param conf the configuration of the client * @param resultHandler The result handler */ static void getWebClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf, Handler<AsyncResult<WebClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture(discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf) .getAs(WebClient.class))); } }); }
/** * Convenient method that looks for a HTTP endpoint and provides the configured {@link HttpClient}. The async result * is marked as failed is there are no matching services, or if the lookup fails. This method accepts a * configuration for the HTTP client. * * @param discovery The service discovery instance * @param filter The filter * @param conf the configuration of the client * @param resultHandler The result handler */ static void getClient(ServiceDiscovery discovery, Function<Record, Boolean> filter, JsonObject conf, Handler<AsyncResult<HttpClient>> resultHandler) { discovery.getRecord(filter, ar -> { if (ar.failed() || ar.result() == null) { resultHandler.handle(Future.failedFuture("No matching record")); } else { resultHandler.handle(Future.succeededFuture( discovery.<HttpClient>getReferenceWithConfiguration(ar.result(), conf).get())); } }); }
public static io.vertx.servicediscovery.ServiceReference getReferenceWithConfiguration(io.vertx.servicediscovery.ServiceDiscovery j_receiver, java.util.Map<String, Object> record, java.util.Map<String, Object> configuration) { return io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.getReferenceWithConfiguration(record != null ? new io.vertx.servicediscovery.Record(io.vertx.core.impl.ConversionHelper.toJsonObject(record)) : null, configuration != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(configuration) : null)); } public static io.vertx.servicediscovery.ServiceDiscovery registerServiceImporter(io.vertx.servicediscovery.ServiceDiscovery j_receiver, io.vertx.servicediscovery.spi.ServiceImporter importer, java.util.Map<String, Object> configuration) {