public interface ServiceInstance
Represents a remote service discovered by the underlying discovery implementation.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ServiceInstance.Builder
A builder for building
ServiceInstance references. |
| Modifier and Type | Field and Description |
|---|---|
static String |
GROUP
Constant to represent the group of the service contained with
getMetadata(). |
static String |
REGION
Constant to represent the region of the service contained with
getMetadata(). |
static String |
ZONE
Constant to represent the zone of the service contained with
getMetadata(). |
| Modifier and Type | Method and Description |
|---|---|
static ServiceInstance.Builder |
builder(String id,
URI uri)
A builder to builder a
ServiceInstance. |
default Optional<String> |
getGroup()
Returns the application group.
|
default HealthStatus |
getHealthStatus() |
default String |
getHost() |
String |
getId() |
default Optional<String> |
getInstanceId() |
default ConvertibleValues<String> |
getMetadata() |
default int |
getPort() |
default Optional<String> |
getRegion()
Returns the region to use.
|
URI |
getURI() |
default Optional<String> |
getZone()
Returns the availability zone to use.
|
default boolean |
isSecure() |
static ServiceInstance |
of(String id,
String host,
int port)
Construct a new
ServiceInstance for the given ID, host and port using the HTTP scheme. |
static ServiceInstance |
of(String id,
URI uri)
Construct a new
ServiceInstance for the given ID and URL. |
static ServiceInstance |
of(String id,
URL url)
Construct a new
ServiceInstance for the given ID and URL. |
default URI |
resolve(URI relativeURI)
Resolve a URI relative to this service instance.
|
static final String GROUP
getMetadata().static final String ZONE
getMetadata().static final String REGION
getMetadata().String getId()
URI getURI()
default HealthStatus getHealthStatus()
HealthStatus of the instancedefault Optional<String> getZone()
default Optional<String> getRegion()
default Optional<String> getGroup()
default ConvertibleValues<String> getMetadata()
default String getHost()
default boolean isSecure()
default int getPort()
default URI resolve(URI relativeURI)
relativeURI - The relative URIstatic ServiceInstance of(String id, URL url)
ServiceInstance for the given ID and URL.id - The IDurl - The URLstatic ServiceInstance of(String id, URI uri)
ServiceInstance for the given ID and URL.id - The IDuri - The URIstatic ServiceInstance of(String id, String host, int port)
ServiceInstance for the given ID, host and port using the HTTP scheme.id - The IDhost - The hostport - The portstatic ServiceInstance.Builder builder(String id, URI uri)
ServiceInstance.id - The iduri - The URI