Class EC2ServiceInstance
java.lang.Object
io.micronaut.discovery.aws.servicediscovery.registration.EC2ServiceInstance
- All Implemented Interfaces:
io.micronaut.discovery.ServiceInstance
,io.micronaut.discovery.ServiceInstance.Builder
@Internal
public class EC2ServiceInstance
extends Object
implements io.micronaut.discovery.ServiceInstance, io.micronaut.discovery.ServiceInstance.Builder
Represents EC2 service instance metadata.
- Since:
- 1.0
- Author:
- Rvanderwerf, Graeme Rocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.discovery.ServiceInstance
io.micronaut.discovery.ServiceInstance.Builder
-
Field Summary
Fields inherited from interface io.micronaut.discovery.ServiceInstance
GROUP, REGION, ZONE
-
Constructor Summary
ConstructorDescriptionEC2ServiceInstance
(String id, URI uri) Container to hold AWS EC2 Instance info. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.discovery.ServiceInstance
build()
build for the builder.getGroup()
Gets group of instance.io.micronaut.health.HealthStatus
Gets the current instance health status.getId()
Same as instance id.Gets AWS ID for the instance.io.micronaut.core.convert.value.ConvertibleValues<String>
Gets the metadata information gathered from AWS for this instance.Gets the AWS Region of the instance.getURI()
URI This instance can be access via (internal).getZone()
Gets the Zone/AZ for the AWS Instance.io.micronaut.discovery.ServiceInstance.Builder
builder for group (not used).io.micronaut.discovery.ServiceInstance.Builder
instanceId
(String id) instance id (same as id).io.micronaut.discovery.ServiceInstance.Builder
Builder for metadata.io.micronaut.discovery.ServiceInstance.Builder
Builder for metadata in map format.io.micronaut.discovery.ServiceInstance.Builder
Builder for region.io.micronaut.discovery.ServiceInstance.Builder
status
(io.micronaut.health.HealthStatus status) Build for health status.io.micronaut.discovery.ServiceInstance.Builder
The availablity zone of instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.discovery.ServiceInstance
getHost, getPort, isSecure, resolve
-
Constructor Details
-
EC2ServiceInstance
Container to hold AWS EC2 Instance info.- Parameters:
id
- if of the instanceuri
- uri to access this instance
-
-
Method Details
-
getMetadata
Gets the metadata information gathered from AWS for this instance.- Specified by:
getMetadata
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- The metadata
-
getHealthStatus
public io.micronaut.health.HealthStatus getHealthStatus()Gets the current instance health status.- Specified by:
getHealthStatus
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- status
-
getInstanceId
Gets AWS ID for the instance.- Specified by:
getInstanceId
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- instanceId
-
getZone
Gets the Zone/AZ for the AWS Instance.- Specified by:
getZone
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- availability zone
-
getRegion
Gets the AWS Region of the instance.- Specified by:
getRegion
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- region
-
getGroup
Gets group of instance. Not used on AWS.- Specified by:
getGroup
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- not used
-
getId
Same as instance id.- Specified by:
getId
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- instance id
-
getURI
URI This instance can be access via (internal).- Specified by:
getURI
in interfaceio.micronaut.discovery.ServiceInstance
- Returns:
- uri to access
-
instanceId
instance id (same as id).- Specified by:
instanceId
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Parameters:
id
- The instance id- Returns:
- the instance id builder
-
zone
The availablity zone of instance.- Specified by:
zone
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Parameters:
zone
- The zone- Returns:
- the zone builder
-
region
Builder for region.- Specified by:
region
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Parameters:
region
- The region- Returns:
- builder
-
group
builder for group (not used).- Specified by:
group
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Parameters:
group
- The group- Returns:
- builder
-
status
public io.micronaut.discovery.ServiceInstance.Builder status(io.micronaut.health.HealthStatus status) Build for health status.- Specified by:
status
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Parameters:
status
- The status- Returns:
- builder
-
metadata
public io.micronaut.discovery.ServiceInstance.Builder metadata(io.micronaut.core.convert.value.ConvertibleValues<String> metadata) Builder for metadata.- Parameters:
metadata
- from aws- Returns:
- builder
-
metadata
Builder for metadata in map format.- Specified by:
metadata
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Parameters:
metadata
- The metadata in map format- Returns:
- builder
-
build
public io.micronaut.discovery.ServiceInstance build()build for the builder.- Specified by:
build
in interfaceio.micronaut.discovery.ServiceInstance.Builder
- Returns:
- the service instance
-