Class ServiceInstance


  • public class ServiceInstance
    extends Object
    Model containing information about a running service
    • Constructor Detail

      • ServiceInstance

        public ServiceInstance()
    • Method Detail

      • fromServiceInfo

        public static ServiceInstance fromServiceInfo​(ServiceInfo serviceInfo)
        Returns a new ServiceInstanceBuilder built from a given ServiceInfo.

        Note that a copy of ServiceInfo.getMetadata() is made using Map.copyOf(Map), so the metadata is unmodifiable.

        Parameters:
        serviceInfo - The information about the service used to initialize the ServiceInstanceBuilder
        Returns:
        a ServiceInstanceBuilder with values copied from the given ServiceInfo
      • getUpSince

        public Instant getUpSince()
        Returns the Instant this service has been up since, or Instant.EPOCH if no value was provided when this instance was created.
        Returns:
        a non-null Instant representing the instant this service was started, or the epoch if no value provided
      • getUpSinceMillis

        public long getUpSinceMillis()
        Returns the time since the epoch this service has been up since, or zero (the epoch), if no value was provided when this instance was created.
        Returns:
        the number of milliseconds since the epoch that this service was started, or zero if no value provided