public interface HttpEndpoint extends ServiceType
ServiceType
for HTTP endpoint (REST api).
Consumers receive a HTTP client configured with the host and port of the endpoint.Modifier and Type | Field and Description |
---|---|
static String |
TYPE |
UNKNOWN
Modifier and Type | Method and Description |
---|---|
static Record |
createRecord(String name,
boolean ssl,
String host,
int port,
String root,
JsonObject metadata)
Same as
createRecord(String, String, int, String, JsonObject) but let you configure whether or not the
service is using https . |
static Record |
createRecord(String name,
String host)
Same as
createRecord(String, String, int, String, JsonObject) but without metadata, using the port 80
and using "/" as root. |
static Record |
createRecord(String name,
String host,
int port,
String root)
Same as
createRecord(String, String, int, String, JsonObject) but without metadata. |
static Record |
createRecord(String name,
String host,
int port,
String root,
JsonObject metadata)
Convenient method to create a record for a HTTP endpoint.
|
static Future<HttpClient> |
getClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter)
Like
getClient(ServiceDiscovery, Function, Handler) but returns a future of the result |
static void |
getClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
Handler<AsyncResult<HttpClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
HttpClient . |
static Future<HttpClient> |
getClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
JsonObject conf)
Like
getClient(ServiceDiscovery, JsonObject, JsonObject, Handler) but returns a future of the result |
static void |
getClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
JsonObject conf,
Handler<AsyncResult<HttpClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
HttpClient . |
static Future<HttpClient> |
getClient(ServiceDiscovery discovery,
JsonObject filter)
Like
getClient(ServiceDiscovery, JsonObject, Handler) but returns a future of the result |
static void |
getClient(ServiceDiscovery discovery,
JsonObject filter,
Handler<AsyncResult<HttpClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
HttpClient . |
static Future<HttpClient> |
getClient(ServiceDiscovery discovery,
JsonObject filter,
JsonObject conf)
Like
getClient(ServiceDiscovery, JsonObject, JsonObject, Handler) but returns a future of the result |
static void |
getClient(ServiceDiscovery discovery,
JsonObject filter,
JsonObject conf,
Handler<AsyncResult<HttpClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
HttpClient . |
static Future<WebClient> |
getWebClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter)
Like
getWebClient(ServiceDiscovery, Function, Handler) but returns a future of the result |
static void |
getWebClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
Handler<AsyncResult<WebClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
WebClient . |
static Future<WebClient> |
getWebClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
JsonObject conf)
Like
getWebClient(ServiceDiscovery, JsonObject, JsonObject, Handler) but returns a future of the result |
static void |
getWebClient(ServiceDiscovery discovery,
java.util.function.Function<Record,Boolean> filter,
JsonObject conf,
Handler<AsyncResult<WebClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
WebClient . |
static Future<WebClient> |
getWebClient(ServiceDiscovery discovery,
JsonObject filter)
Like
getWebClient(ServiceDiscovery, JsonObject, Handler) but returns a future of the result |
static void |
getWebClient(ServiceDiscovery discovery,
JsonObject filter,
Handler<AsyncResult<WebClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured .
|
static Future<WebClient> |
getWebClient(ServiceDiscovery discovery,
JsonObject filter,
JsonObject conf)
Like
getWebClient(ServiceDiscovery, JsonObject, JsonObject, Handler) but returns a future of the result |
static void |
getWebClient(ServiceDiscovery discovery,
JsonObject filter,
JsonObject conf,
Handler<AsyncResult<WebClient>> resultHandler)
Convenient method that looks for a HTTP endpoint and provides the configured
WebClient . |
get, name
static final String TYPE
static Record createRecord(String name, String host, int port, String root, JsonObject metadata)
name
- the service namehost
- the host (IP or DNS name), it must be the _public_ IP / nameport
- the port, it must be the _public_ portroot
- the path of the service, "/" if not setmetadata
- additional metadatastatic Record createRecord(String name, boolean ssl, String host, int port, String root, JsonObject metadata)
createRecord(String, String, int, String, JsonObject)
but let you configure whether or not the
service is using https
.name
- the service namessl
- whether or not the service is using HTTPShost
- the host (IP or DNS name), it must be the _public_ IP / nameport
- the port, it must be the _public_ portroot
- the path of the service, "/" if not setmetadata
- additional metadatastatic Record createRecord(String name, String host, int port, String root)
createRecord(String, String, int, String, JsonObject)
but without metadata.name
- the service namehost
- the host, must be publicport
- the portroot
- the root, if not set "/" is usedstatic Record createRecord(String name, String host)
createRecord(String, String, int, String, JsonObject)
but without metadata, using the port 80
and using "/" as root.name
- the namehost
- the hoststatic void getClient(ServiceDiscovery discovery, JsonObject filter, Handler<AsyncResult<HttpClient>> resultHandler)
HttpClient
. The async result
is marked as failed is there are no matching services, or if the lookup fails.discovery
- The service discovery instancefilter
- The filter, optionalresultHandler
- The result handlerstatic Future<HttpClient> getClient(ServiceDiscovery discovery, JsonObject filter)
getClient(ServiceDiscovery, JsonObject, Handler)
but returns a future of the resultstatic void getWebClient(ServiceDiscovery discovery, JsonObject filter, Handler<AsyncResult<WebClient>> resultHandler)
discovery
- The service discovery instancefilter
- The filter, optionalresultHandler
- The result handlerstatic Future<WebClient> getWebClient(ServiceDiscovery discovery, JsonObject filter)
getWebClient(ServiceDiscovery, JsonObject, Handler)
but returns a future of the resultstatic void getClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf, Handler<AsyncResult<HttpClient>> resultHandler)
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 clientdiscovery
- The service discovery instancefilter
- The filter, optionalconf
- the configuration of the clientresultHandler
- The result handlerstatic Future<HttpClient> getClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf)
getClient(ServiceDiscovery, JsonObject, JsonObject, Handler)
but returns a future of the resultstatic void getWebClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf, Handler<AsyncResult<WebClient>> resultHandler)
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 clientdiscovery
- The service discovery instancefilter
- The filter, optionalconf
- the configuration of the clientresultHandler
- The result handlerstatic Future<WebClient> getWebClient(ServiceDiscovery discovery, JsonObject filter, JsonObject conf)
getWebClient(ServiceDiscovery, JsonObject, JsonObject, Handler)
but returns a future of the resultstatic void getClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Handler<AsyncResult<HttpClient>> resultHandler)
HttpClient
. The async result
is marked as failed is there are no matching services, or if the lookup fails.discovery
- The service discovery instancefilter
- The filterresultHandler
- The result handlerstatic Future<HttpClient> getClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter)
getClient(ServiceDiscovery, Function, Handler)
but returns a future of the resultstatic void getWebClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Handler<AsyncResult<WebClient>> resultHandler)
WebClient
. The async result
is marked as failed is there are no matching services, or if the lookup fails.discovery
- The service discovery instancefilter
- The filterresultHandler
- The result handlerstatic Future<WebClient> getWebClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter)
getWebClient(ServiceDiscovery, Function, Handler)
but returns a future of the resultstatic void getClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, JsonObject conf, Handler<AsyncResult<HttpClient>> resultHandler)
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.discovery
- The service discovery instancefilter
- The filterconf
- the configuration of the clientresultHandler
- The result handlerstatic Future<HttpClient> getClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, JsonObject conf)
getClient(ServiceDiscovery, JsonObject, JsonObject, Handler)
but returns a future of the resultstatic void getWebClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, JsonObject conf, Handler<AsyncResult<WebClient>> resultHandler)
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.discovery
- The service discovery instancefilter
- The filterconf
- the configuration of the clientresultHandler
- The result handlerstatic Future<WebClient> getWebClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, JsonObject conf)
getWebClient(ServiceDiscovery, JsonObject, JsonObject, Handler)
but returns a future of the resultCopyright © 2021 Eclipse. All rights reserved.