Interface ServiceInstance

All Known Subinterfaces:
Registration
All Known Implementing Classes:
DefaultServiceInstance

public interface ServiceInstance
Represents an instance of a service in a discovery system.
Author:
Spencer Gibb, Tim Ysewyn
  • Method Details

    • getInstanceId

      default @Nullable String getInstanceId()
      Returns:
      The unique instance ID as registered.
    • getServiceId

      String getServiceId()
      Returns:
      The service ID as registered.
    • getHost

      String getHost()
      Returns:
      The hostname of the registered service instance.
    • getPort

      int getPort()
      Returns:
      The port of the registered service instance.
    • isSecure

      boolean isSecure()
      Returns:
      Whether the port of the registered service instance uses HTTPS.
    • getUri

      URI getUri()
      Returns:
      The service URI address.
    • getMetadata

      @Nullable Map<String,String> getMetadata()
      Returns:
      The key / value pair metadata associated with the service instance.
    • getScheme

      default @Nullable String getScheme()
      Returns:
      The scheme of the service instance.
    • createUri

      static URI createUri(ServiceInstance instance)
      Creates a URI from the given ServiceInstance's host:port.
      Parameters:
      instance - the ServiceInstance.
      Returns:
      URI of the form (secure)?https:http + "host:port". Scheme port default used if port not set.