Record Class ConnectionHealthMonitor.ConnectionHealth

java.lang.Object
java.lang.Record
com.loomcache.server.network.ConnectionHealthMonitor.ConnectionHealth
Record Components:
connectionId - unique identifier for the connection
status - current health status
latencyMs - current latency in milliseconds
errorRate - current error rate (0.0 to 1.0)
lastActivityTime - timestamp of last activity
checkCount - number of health checks performed
Enclosing class:
ConnectionHealthMonitor

public static record ConnectionHealthMonitor.ConnectionHealth(String connectionId, ConnectionHealthMonitor.HealthStatus status, long latencyMs, double errorRate, Instant lastActivityTime, int checkCount) extends Record
Immutable record containing health information for a single connection.
Version:
1.0
Author:
ConnectionHealthMonitor Implementation
  • Constructor Details

    • ConnectionHealth

      public ConnectionHealth(String connectionId, ConnectionHealthMonitor.HealthStatus status, long latencyMs, double errorRate, Instant lastActivityTime, int checkCount)
      Creates an instance of a ConnectionHealth record class.
      Parameters:
      connectionId - the value for the connectionId record component
      status - the value for the status record component
      latencyMs - the value for the latencyMs record component
      errorRate - the value for the errorRate record component
      lastActivityTime - the value for the lastActivityTime record component
      checkCount - the value for the checkCount record component
  • 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.
    • connectionId

      public String connectionId()
      Returns the value of the connectionId record component.
      Returns:
      the value of the connectionId record component
    • status

      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • latencyMs

      public long latencyMs()
      Returns the value of the latencyMs record component.
      Returns:
      the value of the latencyMs record component
    • errorRate

      public double errorRate()
      Returns the value of the errorRate record component.
      Returns:
      the value of the errorRate record component
    • lastActivityTime

      public Instant lastActivityTime()
      Returns the value of the lastActivityTime record component.
      Returns:
      the value of the lastActivityTime record component
    • checkCount

      public int checkCount()
      Returns the value of the checkCount record component.
      Returns:
      the value of the checkCount record component