Record Class HealthStatus

java.lang.Object
java.lang.Record
org.opends.server.monitors.HealthStatus
Record Components:
aliveErrors - the list of serious errors
healthyErrors - the list of transient errors

public record HealthStatus(List<LocalizableMessage> aliveErrors, List<LocalizableMessage> healthyErrors) extends Record
Represent health diagnostic information.
  • Constructor Details

  • Method Details

    • aliveAndHealthy

      public static HealthStatus aliveAndHealthy()
      Returns the ALIVE and HEALTHY HealthStatus.
      Returns:
      the ALIVE and HEALTHY HealthStatus.
    • notAlive

      public static HealthStatus notAlive(LocalizableMessage error)
      Returns a NOT_ALIVE HealthStatus.
      Parameters:
      error - A LocalizableMessage describing the serious error.
      Returns:
      A NOT_ALIVE HealthStatus.
    • notHealthy

      public static HealthStatus notHealthy(LocalizableMessage error)
      Returns a NOT_HEALTHY HealthStatus.
      Parameters:
      error - A LocalizableMessage describing the transient error.
      Returns:
      A NOT_HEALTHY HealthStatus.
    • notAlive

      public static HealthStatus notAlive(List<LocalizableMessage> errors)
      Returns a NOT_ALIVE HealthStatus.
      Parameters:
      errors - A non-empty list of messages describing the serious errors.
      Returns:
      A NOT_ALIVE HealthStatus.
    • notHealthy

      public static HealthStatus notHealthy(List<LocalizableMessage> errors)
      Returns a NOT_HEALTHY HealthStatus.
      Parameters:
      errors - A non-empty list of messages describing the transient errors.
      Returns:
      A NOT_HEALTHY HealthStatus.
    • combine

      public static HealthStatus combine(HealthStatus healthStatus1, HealthStatus healthStatus2)
      Creates a new HealthStatus by combining the provided HealthStatus errors.
      Parameters:
      healthStatus1 - The first health status to be combined.
      healthStatus2 - The second health status to be combined.
      Returns:
      The combination of the provided health statuses.
    • isAlive

      public boolean isAlive()
      Returns true if there are no serious errors as provided by aliveErrors(), false otherwise.
      Returns:
      true if there are no serious errors, false otherwise.
    • isHealthy

      public boolean isHealthy()
      Returns true if there are no serious errors as provided by aliveErrors() nor transient errors as provided by healthyErrors(), false otherwise.
      Returns:
      true if there are no serious errors nor transient errors, false otherwise.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • aliveErrors

      public List<LocalizableMessage> aliveErrors()
      Returns the value of the aliveErrors record component.
      Returns:
      the value of the aliveErrors record component
    • healthyErrors

      public List<LocalizableMessage> healthyErrors()
      Returns the value of the healthyErrors record component.
      Returns:
      the value of the healthyErrors record component