Package org.opends.server.monitors
Record Class HealthStatus
java.lang.Object
java.lang.Record
org.opends.server.monitors.HealthStatus
- Record Components:
aliveErrors- the list of serious errorshealthyErrors- the list of transient errors
public record HealthStatus(List<LocalizableMessage> aliveErrors, List<LocalizableMessage> healthyErrors)
extends Record
Represent health diagnostic information.
-
Constructor Summary
ConstructorsConstructorDescriptionHealthStatus(List<LocalizableMessage> aliveErrors, List<LocalizableMessage> healthyErrors) Creates an instance of aHealthStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthStatusReturns the ALIVE and HEALTHYHealthStatus.Returns the value of thealiveErrorsrecord component.static HealthStatuscombine(HealthStatus healthStatus1, HealthStatus healthStatus2) Creates a newHealthStatusby combining the providedHealthStatuserrors.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 thehealthyErrorsrecord component.booleanisAlive()booleanReturnstrueif there are no serious errors as provided byaliveErrors()nor transient errors as provided byhealthyErrors(),falseotherwise.static HealthStatusnotAlive(List<LocalizableMessage> errors) Returns a NOT_ALIVEHealthStatus.static HealthStatusnotAlive(LocalizableMessage error) Returns a NOT_ALIVEHealthStatus.static HealthStatusnotHealthy(List<LocalizableMessage> errors) Returns a NOT_HEALTHYHealthStatus.static HealthStatusnotHealthy(LocalizableMessage error) Returns a NOT_HEALTHYHealthStatus.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HealthStatus
Creates an instance of aHealthStatusrecord class.- Parameters:
aliveErrors- the value for thealiveErrorsrecord componenthealthyErrors- the value for thehealthyErrorsrecord component
-
-
Method Details
-
aliveAndHealthy
Returns the ALIVE and HEALTHYHealthStatus.- Returns:
- the ALIVE and HEALTHY
HealthStatus.
-
notAlive
Returns a NOT_ALIVEHealthStatus.- Parameters:
error- ALocalizableMessagedescribing the serious error.- Returns:
- A NOT_ALIVE
HealthStatus.
-
notHealthy
Returns a NOT_HEALTHYHealthStatus.- Parameters:
error- ALocalizableMessagedescribing the transient error.- Returns:
- A NOT_HEALTHY
HealthStatus.
-
notAlive
Returns a NOT_ALIVEHealthStatus.- Parameters:
errors- A non-empty list of messages describing the serious errors.- Returns:
- A NOT_ALIVE
HealthStatus.
-
notHealthy
Returns a NOT_HEALTHYHealthStatus.- Parameters:
errors- A non-empty list of messages describing the transient errors.- Returns:
- A NOT_HEALTHY
HealthStatus.
-
combine
Creates a newHealthStatusby combining the providedHealthStatuserrors.- 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:
trueif there are no serious errors,falseotherwise.
-
isHealthy
public boolean isHealthy()Returnstrueif there are no serious errors as provided byaliveErrors()nor transient errors as provided byhealthyErrors(),falseotherwise.- Returns:
trueif there are no serious errors nor transient errors,falseotherwise.
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
aliveErrors
Returns the value of thealiveErrorsrecord component.- Returns:
- the value of the
aliveErrorsrecord component
-
healthyErrors
Returns the value of thehealthyErrorsrecord component.- Returns:
- the value of the
healthyErrorsrecord component
-