Package io.micronaut.discovery
Interface ServiceInstance
- All Known Subinterfaces:
EmbeddedServerInstance
public interface ServiceInstance
Represents a remote service discovered by the underlying discovery implementation.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A builder for buildingServiceInstance
references. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant to represent the group of the service contained withgetMetadata()
.static final String
Constant to represent the region of the service contained withgetMetadata()
.static final String
Constant to represent the zone of the service contained withgetMetadata()
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceInstance.Builder
A builder to builder aServiceInstance
.getGroup()
Returns the application group.default HealthStatus
default String
getHost()
getId()
default ConvertibleValues<String>
default int
getPort()
Returns the region to use.getURI()
getZone()
Returns the availability zone to use.default boolean
isSecure()
static ServiceInstance
Construct a newServiceInstance
for the given ID, host and port using the HTTP scheme.static ServiceInstance
Construct a newServiceInstance
for the given ID and URL.static ServiceInstance
Construct a newServiceInstance
for the given ID and URL.default URI
Resolve a URI relative to this service instance.
-
Field Details
-
GROUP
Constant to represent the group of the service contained withgetMetadata()
.- See Also:
-
ZONE
Constant to represent the zone of the service contained withgetMetadata()
.- See Also:
-
REGION
Constant to represent the region of the service contained withgetMetadata()
.- See Also:
-
-
Method Details
-
getId
String getId()- Returns:
- The identifier of the service used for purposes of service discovery
-
getURI
URI getURI()- Returns:
- The service URI
-
getHealthStatus
- Returns:
- The
HealthStatus
of the instance
-
getInstanceId
- Returns:
- The ID of the instance
-
getZone
Returns the availability zone to use. A zone is, for example, the AWS availability zone.- Returns:
- The zone to use
-
getRegion
Returns the region to use. A region is, for example, the AWS region- Returns:
- The region
-
getGroup
Returns the application group. For example, the AWS auto-scaling group.- Returns:
- The group to use
-
getMetadata
- Returns:
- The service metadata
-
getHost
- Returns:
- The service host
-
isSecure
default boolean isSecure()- Returns:
- Is the service instance available over a secure connection
-
getPort
default int getPort()- Returns:
- The service port
-
resolve
Resolve a URI relative to this service instance.- Parameters:
relativeURI
- The relative URI- Returns:
- The relative URI
-
of
Construct a newServiceInstance
for the given ID and URL.- Parameters:
id
- The IDurl
- The URL- Returns:
- The instance
-
of
Construct a newServiceInstance
for the given ID and URL.- Parameters:
id
- The IDuri
- The URI- Returns:
- The instance
-
of
Construct a newServiceInstance
for the given ID, host and port using the HTTP scheme.- Parameters:
id
- The IDhost
- The hostport
- The port- Returns:
- The instance
-
builder
A builder to builder aServiceInstance
.- Parameters:
id
- The iduri
- The URI- Returns:
- The builder
-