Record Class RegistryPeerStatus

java.lang.Object
java.lang.Record
org.j7m.middleware.registry.api.RegistryPeerStatus
Record Components:
peerId - peer identifier
alive - whether peer is alive
state - liveness state
overloaded - whether peer reports overload
quality - coarse latency quality marker
local - whether the peer is the local registry
trustStatus - placeholder trust marker
lastContactMillis - last contact timestamp
lastLatencyNanos - last measured latency
loadScore - load score where lower is better
reliabilityScore - reliability score in the range 0.0..1.0
endpoints - registry endpoints
supportedProtocolVersions - supported protocol versions
knownContexts - known registry contexts
sourcePeerId - peer that reported this status
lastSeenMillis - last seen timestamp
metadata - public metadata

public record RegistryPeerStatus(String peerId, boolean alive, RegistryPeerState state, boolean overloaded, RegistryPeerQuality quality, boolean local, RegistryTrustStatus trustStatus, long lastContactMillis, long lastLatencyNanos, double loadScore, double reliabilityScore, List<RegistryEndpoint> endpoints, List<Integer> supportedProtocolVersions, List<String> knownContexts, String sourcePeerId, long lastSeenMillis, Map<String,String> metadata) extends Record
Immutable registry peer status used by decentralized discovery.
  • Constructor Details

    • RegistryPeerStatus

      public RegistryPeerStatus(String peerId, boolean alive, RegistryPeerState state, boolean overloaded, RegistryPeerQuality quality, boolean local, RegistryTrustStatus trustStatus, long lastContactMillis, long lastLatencyNanos, double loadScore, double reliabilityScore, List<RegistryEndpoint> endpoints, List<Integer> supportedProtocolVersions, List<String> knownContexts, String sourcePeerId, long lastSeenMillis, Map<String,String> metadata)
      Creates immutable metadata.
    • RegistryPeerStatus

      public RegistryPeerStatus(String peerId, boolean alive, Map<String,String> metadata)
      Creates a compatibility peer status with Phase 1 fields.
      Parameters:
      peerId - peer identifier
      alive - whether peer is alive
      metadata - public metadata
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • peerId

      public String peerId()
      Returns the value of the peerId record component.
      Returns:
      the value of the peerId record component
    • alive

      public boolean alive()
      Returns the value of the alive record component.
      Returns:
      the value of the alive record component
    • state

      public RegistryPeerState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • overloaded

      public boolean overloaded()
      Returns the value of the overloaded record component.
      Returns:
      the value of the overloaded record component
    • quality

      public RegistryPeerQuality quality()
      Returns the value of the quality record component.
      Returns:
      the value of the quality record component
    • local

      public boolean local()
      Returns the value of the local record component.
      Returns:
      the value of the local record component
    • trustStatus

      public RegistryTrustStatus trustStatus()
      Returns the value of the trustStatus record component.
      Returns:
      the value of the trustStatus record component
    • lastContactMillis

      public long lastContactMillis()
      Returns the value of the lastContactMillis record component.
      Returns:
      the value of the lastContactMillis record component
    • lastLatencyNanos

      public long lastLatencyNanos()
      Returns the value of the lastLatencyNanos record component.
      Returns:
      the value of the lastLatencyNanos record component
    • loadScore

      public double loadScore()
      Returns the value of the loadScore record component.
      Returns:
      the value of the loadScore record component
    • reliabilityScore

      public double reliabilityScore()
      Returns the value of the reliabilityScore record component.
      Returns:
      the value of the reliabilityScore record component
    • endpoints

      public List<RegistryEndpoint> endpoints()
      Returns the value of the endpoints record component.
      Returns:
      the value of the endpoints record component
    • supportedProtocolVersions

      public List<Integer> supportedProtocolVersions()
      Returns the value of the supportedProtocolVersions record component.
      Returns:
      the value of the supportedProtocolVersions record component
    • knownContexts

      public List<String> knownContexts()
      Returns the value of the knownContexts record component.
      Returns:
      the value of the knownContexts record component
    • sourcePeerId

      public String sourcePeerId()
      Returns the value of the sourcePeerId record component.
      Returns:
      the value of the sourcePeerId record component
    • lastSeenMillis

      public long lastSeenMillis()
      Returns the value of the lastSeenMillis record component.
      Returns:
      the value of the lastSeenMillis record component
    • metadata

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component