Record Class RegistryPeerStatus
java.lang.Object
java.lang.Record
org.j7m.middleware.registry.api.RegistryPeerStatus
- Record Components:
peerId- peer identifieralive- whether peer is alivestate- liveness stateoverloaded- whether peer reports overloadquality- coarse latency quality markerlocal- whether the peer is the local registrytrustStatus- placeholder trust markerlastContactMillis- last contact timestamplastLatencyNanos- last measured latencyloadScore- load score where lower is betterreliabilityScore- reliability score in the range0.0..1.0endpoints- registry endpointssupportedProtocolVersions- supported protocol versionsknownContexts- known registry contextssourcePeerId- peer that reported this statuslastSeenMillis- last seen timestampmetadata- 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 Summary
ConstructorsConstructorDescriptionRegistryPeerStatus(String peerId, boolean alive, Map<String, String> metadata) Creates a compatibility peer status with Phase 1 fields.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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanalive()Returns the value of thealiverecord component.Returns the value of theendpointsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theknownContextsrecord component.longReturns the value of thelastContactMillisrecord component.longReturns the value of thelastLatencyNanosrecord component.longReturns the value of thelastSeenMillisrecord component.doubleReturns the value of theloadScorerecord component.booleanlocal()Returns the value of thelocalrecord component.metadata()Returns the value of themetadatarecord component.booleanReturns the value of theoverloadedrecord component.peerId()Returns the value of thepeerIdrecord component.quality()Returns the value of thequalityrecord component.doubleReturns the value of thereliabilityScorerecord component.Returns the value of thesourcePeerIdrecord component.state()Returns the value of thestaterecord component.Returns the value of thesupportedProtocolVersionsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetrustStatusrecord component.
-
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
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
peerId
-
alive
-
state
-
overloaded
public boolean overloaded()Returns the value of theoverloadedrecord component.- Returns:
- the value of the
overloadedrecord component
-
quality
-
local
-
trustStatus
Returns the value of thetrustStatusrecord component.- Returns:
- the value of the
trustStatusrecord component
-
lastContactMillis
public long lastContactMillis()Returns the value of thelastContactMillisrecord component.- Returns:
- the value of the
lastContactMillisrecord component
-
lastLatencyNanos
public long lastLatencyNanos()Returns the value of thelastLatencyNanosrecord component.- Returns:
- the value of the
lastLatencyNanosrecord component
-
loadScore
-
reliabilityScore
public double reliabilityScore()Returns the value of thereliabilityScorerecord component.- Returns:
- the value of the
reliabilityScorerecord component
-
endpoints
-
supportedProtocolVersions
Returns the value of thesupportedProtocolVersionsrecord component.- Returns:
- the value of the
supportedProtocolVersionsrecord component
-
knownContexts
Returns the value of theknownContextsrecord component.- Returns:
- the value of the
knownContextsrecord component
-
sourcePeerId
Returns the value of thesourcePeerIdrecord component.- Returns:
- the value of the
sourcePeerIdrecord component
-
lastSeenMillis
public long lastSeenMillis()Returns the value of thelastSeenMillisrecord component.- Returns:
- the value of the
lastSeenMillisrecord component
-
metadata
-