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 java.lang.String |
GROUP
Constant to represent the group of the service contained with
getMetadata() . |
static java.lang.String |
REGION
Constant to represent the region of the service contained with
getMetadata() . |
static java.lang.String |
ZONE
Constant to represent the zone of the service contained with
getMetadata() . |
Modifier and Type | Method and Description |
---|---|
static ServiceInstance.Builder |
builder(java.lang.String id,
java.net.URI uri)
A builder to builder a
ServiceInstance . |
default java.util.Optional<java.lang.String> |
getGroup()
Returns the application group.
|
default HealthStatus |
getHealthStatus() |
default java.lang.String |
getHost() |
java.lang.String |
getId() |
default java.util.Optional<java.lang.String> |
getInstanceId() |
default ConvertibleValues<java.lang.String> |
getMetadata() |
default int |
getPort() |
default java.util.Optional<java.lang.String> |
getRegion()
Returns the region to use.
|
java.net.URI |
getURI() |
default java.util.Optional<java.lang.String> |
getZone()
Returns the availability zone to use.
|
default boolean |
isSecure() |
static ServiceInstance |
of(java.lang.String id,
java.lang.String host,
int port)
Construct a new
ServiceInstance for the given ID, host and port using the HTTP scheme. |
static ServiceInstance |
of(java.lang.String id,
java.net.URI uri)
Construct a new
ServiceInstance for the given ID and URL. |
static ServiceInstance |
of(java.lang.String id,
java.net.URL url)
Construct a new
ServiceInstance for the given ID and URL. |
default java.net.URI |
resolve(java.net.URI relativeURI)
Resolve a URI relative to this service instance.
|
static final java.lang.String GROUP
getMetadata()
.static final java.lang.String ZONE
getMetadata()
.static final java.lang.String REGION
getMetadata()
.java.lang.String getId()
java.net.URI getURI()
default HealthStatus getHealthStatus()
HealthStatus
of the instancedefault java.util.Optional<java.lang.String> getInstanceId()
default java.util.Optional<java.lang.String> getZone()
default java.util.Optional<java.lang.String> getRegion()
default java.util.Optional<java.lang.String> getGroup()
default ConvertibleValues<java.lang.String> getMetadata()
default java.lang.String getHost()
default boolean isSecure()
default int getPort()
default java.net.URI resolve(java.net.URI relativeURI)
relativeURI
- The relative URIstatic ServiceInstance of(java.lang.String id, java.net.URL url)
ServiceInstance
for the given ID and URL.id
- The IDurl
- The URLstatic ServiceInstance of(java.lang.String id, java.net.URI uri)
ServiceInstance
for the given ID and URL.id
- The IDuri
- The URIstatic ServiceInstance of(java.lang.String id, java.lang.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(java.lang.String id, java.net.URI uri)
ServiceInstance
.id
- The iduri
- The URI