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

    Constructors
    Constructor
    Description
    Container to hold AWS EC2 Instance info.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.discovery.ServiceInstance
    build for the builder.
    Gets group of instance.
    io.micronaut.health.HealthStatus
    Gets the current instance health status.
    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.
    URI This instance can be access via (internal).
    Gets the Zone/AZ for the AWS Instance.
    io.micronaut.discovery.ServiceInstance.Builder
    group(String group)
    builder for group (not used).
    io.micronaut.discovery.ServiceInstance.Builder
    instance id (same as id).
    io.micronaut.discovery.ServiceInstance.Builder
    metadata(io.micronaut.core.convert.value.ConvertibleValues<String> metadata)
    Builder for metadata.
    io.micronaut.discovery.ServiceInstance.Builder
    Builder for metadata in map format.
    io.micronaut.discovery.ServiceInstance.Builder
    region(String region)
    Builder for region.
    io.micronaut.discovery.ServiceInstance.Builder
    status(io.micronaut.health.HealthStatus status)
    Build for health status.
    io.micronaut.discovery.ServiceInstance.Builder
    zone(String zone)
    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

      public EC2ServiceInstance(String id, URI uri)
      Container to hold AWS EC2 Instance info.
      Parameters:
      id - if of the instance
      uri - uri to access this instance
  • Method Details

    • getMetadata

      public io.micronaut.core.convert.value.ConvertibleValues<String> getMetadata()
      Gets the metadata information gathered from AWS for this instance.
      Specified by:
      getMetadata in interface io.micronaut.discovery.ServiceInstance
      Returns:
      The metadata
    • getHealthStatus

      public io.micronaut.health.HealthStatus getHealthStatus()
      Gets the current instance health status.
      Specified by:
      getHealthStatus in interface io.micronaut.discovery.ServiceInstance
      Returns:
      status
    • getInstanceId

      public Optional<String> getInstanceId()
      Gets AWS ID for the instance.
      Specified by:
      getInstanceId in interface io.micronaut.discovery.ServiceInstance
      Returns:
      instanceId
    • getZone

      public Optional<String> getZone()
      Gets the Zone/AZ for the AWS Instance.
      Specified by:
      getZone in interface io.micronaut.discovery.ServiceInstance
      Returns:
      availability zone
    • getRegion

      public Optional<String> getRegion()
      Gets the AWS Region of the instance.
      Specified by:
      getRegion in interface io.micronaut.discovery.ServiceInstance
      Returns:
      region
    • getGroup

      public Optional<String> getGroup()
      Gets group of instance. Not used on AWS.
      Specified by:
      getGroup in interface io.micronaut.discovery.ServiceInstance
      Returns:
      not used
    • getId

      public String getId()
      Same as instance id.
      Specified by:
      getId in interface io.micronaut.discovery.ServiceInstance
      Returns:
      instance id
    • getURI

      public URI getURI()
      URI This instance can be access via (internal).
      Specified by:
      getURI in interface io.micronaut.discovery.ServiceInstance
      Returns:
      uri to access
    • instanceId

      public io.micronaut.discovery.ServiceInstance.Builder instanceId(String id)
      instance id (same as id).
      Specified by:
      instanceId in interface io.micronaut.discovery.ServiceInstance.Builder
      Parameters:
      id - The instance id
      Returns:
      the instance id builder
    • zone

      public io.micronaut.discovery.ServiceInstance.Builder zone(String zone)
      The availablity zone of instance.
      Specified by:
      zone in interface io.micronaut.discovery.ServiceInstance.Builder
      Parameters:
      zone - The zone
      Returns:
      the zone builder
    • region

      public io.micronaut.discovery.ServiceInstance.Builder region(String region)
      Builder for region.
      Specified by:
      region in interface io.micronaut.discovery.ServiceInstance.Builder
      Parameters:
      region - The region
      Returns:
      builder
    • group

      public io.micronaut.discovery.ServiceInstance.Builder group(String group)
      builder for group (not used).
      Specified by:
      group in interface io.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 interface io.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

      public io.micronaut.discovery.ServiceInstance.Builder metadata(Map<String,String> metadata)
      Builder for metadata in map format.
      Specified by:
      metadata in interface io.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 interface io.micronaut.discovery.ServiceInstance.Builder
      Returns:
      the service instance