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 SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for buildingServiceInstancereferences.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringConstant to represent the group of the service contained withgetMetadata().static final StringConstant to represent the region of the service contained withgetMetadata().static final StringConstant to represent the zone of the service contained withgetMetadata().
- 
Method SummaryModifier and TypeMethodDescriptionstatic ServiceInstance.BuilderA builder to builder aServiceInstance.getGroup()Returns the application group.default HealthStatusdefault StringgetHost()getId()default ConvertibleValues<String>default intgetPort()Returns the region to use.getURI()getZone()Returns the availability zone to use.default booleanisSecure()static ServiceInstanceConstruct a newServiceInstancefor the given ID, host and port using the HTTP scheme.static ServiceInstanceConstruct a newServiceInstancefor the given ID and URL.static ServiceInstanceConstruct a newServiceInstancefor the given ID and URL.default URIResolve a URI relative to this service instance.
- 
Field Details- 
GROUPConstant to represent the group of the service contained withgetMetadata().- See Also:
 
- 
ZONEConstant to represent the zone of the service contained withgetMetadata().- See Also:
 
- 
REGIONConstant to represent the region of the service contained withgetMetadata().- See Also:
 
 
- 
- 
Method Details- 
getIdString getId()- Returns:
- The identifier of the service used for purposes of service discovery
 
- 
getURIURI getURI()- Returns:
- The service URI
 
- 
getHealthStatus- Returns:
- The HealthStatusof the instance
 
- 
getInstanceId- Returns:
- The ID of the instance
 
- 
getZoneReturns the availability zone to use. A zone is, for example, the AWS availability zone.- Returns:
- The zone to use
 
- 
getRegionReturns the region to use. A region is, for example, the AWS region- Returns:
- The region
 
- 
getGroupReturns 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
 
- 
isSecuredefault boolean isSecure()- Returns:
- Is the service instance available over a secure connection
 
- 
getPortdefault int getPort()- Returns:
- The service port
 
- 
resolveResolve a URI relative to this service instance.- Parameters:
- relativeURI- The relative URI
- Returns:
- The relative URI
 
- 
ofConstruct a newServiceInstancefor the given ID and URL.- Parameters:
- id- The ID
- url- The URL
- Returns:
- The instance
 
- 
ofConstruct a newServiceInstancefor the given ID and URL.- Parameters:
- id- The ID
- uri- The URI
- Returns:
- The instance
 
- 
ofConstruct a newServiceInstancefor the given ID, host and port using the HTTP scheme.- Parameters:
- id- The ID
- host- The host
- port- The port
- Returns:
- The instance
 
- 
builderA builder to builder aServiceInstance.- Parameters:
- id- The id
- uri- The URI
- Returns:
- The builder
 
 
-