Class HealthStatus
java.lang.Object
io.micronaut.health.HealthStatus
- All Implemented Interfaces:
Comparable<HealthStatus>
The status of a health indicator.
- Since:
- 1.0
- Author:
- James Kleeh, Graeme Rocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HealthStatusIndicates the service is down and unavailable.static final StringThe default name to use for anDOWNstatus.static final StringThe default name to use for anUPstatus.static final HealthStatusIndicates the service status is unknown.static final HealthStatusIndicates the service is operational. -
Constructor Summary
ConstructorsConstructorDescriptionHealthStatus(String name) HealthStatus(String name, @Nullable String description, @Nullable Boolean operational, @Nullable Integer severity) -
Method Summary
Modifier and TypeMethodDescriptionintSorts statuses in order of "functioning level".Describe an existingHealthStatus.booleangetName()Whether the status represents a functioning service.The severity of the status.inthashCode()toString()
-
Field Details
-
NAME_UP
-
NAME_DOWN
-
UP
Indicates the service is operational. -
DOWN
Indicates the service is down and unavailable. -
UNKNOWN
Indicates the service status is unknown.
-
-
Constructor Details
-
HealthStatus
public HealthStatus(String name, @Nullable String description, @Nullable Boolean operational, @Nullable Integer severity) - Parameters:
name- The name of the statusdescription- The detailed information about the statusoperational- If it's operationalseverity- The severity, the higher the value, the more sever is situation.
-
HealthStatus
- Parameters:
name- The name of the status
-
-
Method Details
-
describe
Describe an existingHealthStatus.- Parameters:
description- The description- Returns:
- The new health status
-
getName
- Returns:
- The name of the status
-
getDescription
-
getOperational
-
getSeverity
-
equals
-
hashCode
-
compareTo
Sorts statuses in order of "functioning level". The most functional will appear first and the least functional will appear last.Operation is sorted (true, null, false). For statuses with matching operations, severity is sorted ascending, with nulls first.
- Specified by:
compareToin interfaceComparable<HealthStatus>- Parameters:
o- The status to compare- Returns:
- -1, 1, or 0
-
toString
-