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
ConstructorDescriptionHealthStatus
(List<LocalizableMessage> aliveErrors, List<LocalizableMessage> healthyErrors) Creates an instance of aHealthStatus
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthStatus
Returns the ALIVE and HEALTHYHealthStatus
.Returns the value of thealiveErrors
record component.static HealthStatus
combine
(HealthStatus healthStatus1, HealthStatus healthStatus2) Creates a newHealthStatus
by combining the providedHealthStatus
errors.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thehealthyErrors
record component.boolean
isAlive()
boolean
Returnstrue
if there are no serious errors as provided byaliveErrors()
nor transient errors as provided byhealthyErrors()
,false
otherwise.static HealthStatus
notAlive
(List<LocalizableMessage> errors) Returns a NOT_ALIVEHealthStatus
.static HealthStatus
notAlive
(LocalizableMessage error) Returns a NOT_ALIVEHealthStatus
.static HealthStatus
notHealthy
(List<LocalizableMessage> errors) Returns a NOT_HEALTHYHealthStatus
.static HealthStatus
notHealthy
(LocalizableMessage error) Returns a NOT_HEALTHYHealthStatus
.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
HealthStatus
Creates an instance of aHealthStatus
record class.- Parameters:
aliveErrors
- the value for thealiveErrors
record componenthealthyErrors
- the value for thehealthyErrors
record component
-
-
Method Details
-
aliveAndHealthy
Returns the ALIVE and HEALTHYHealthStatus
.- Returns:
- the ALIVE and HEALTHY
HealthStatus
.
-
notAlive
Returns a NOT_ALIVEHealthStatus
.- Parameters:
error
- ALocalizableMessage
describing the serious error.- Returns:
- A NOT_ALIVE
HealthStatus
.
-
notHealthy
Returns a NOT_HEALTHYHealthStatus
.- Parameters:
error
- ALocalizableMessage
describing 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 newHealthStatus
by combining the providedHealthStatus
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,false
otherwise.
-
isHealthy
public boolean isHealthy()Returnstrue
if there are no serious errors as provided byaliveErrors()
nor transient errors as provided byhealthyErrors()
,false
otherwise.- Returns:
true
if there are no serious errors nor transient errors,false
otherwise.
-
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 thealiveErrors
record component.- Returns:
- the value of the
aliveErrors
record component
-
healthyErrors
Returns the value of thehealthyErrors
record component.- Returns:
- the value of the
healthyErrors
record component
-