Package io.micronaut.health
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
Modifier and TypeFieldDescriptionstatic final HealthStatus
Indicates the service is down and unavailable.static final String
The default name to use for anDOWN
status.static final String
The default name to use for anUP
status.static final HealthStatus
Indicates the service status is unknown.static final HealthStatus
Indicates the service is operational. -
Constructor Summary
ConstructorDescriptionHealthStatus
(@NonNull String name) HealthStatus
(String name, String description, Boolean operational, Integer severity) -
Method Summary
Modifier and TypeMethodDescriptionint
Sorts statuses in order of "functioning level".Describe an existingHealthStatus
.boolean
getName()
Whether the status represents a functioning service.The severity of the status.int
hashCode()
toString()
-
Field Details
-
Constructor Details
-
HealthStatus
- 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
- Returns:
- The description of the status
-
getOperational
Whether the status represents a functioning service.- Returns:
- Empty if partially operational.
-
getSeverity
The severity of the status. A higher severity indicates a more severe error.- Returns:
- Empty if no severity specified.
-
equals
-
hashCode
public int 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:
compareTo
in interfaceComparable<HealthStatus>
- Parameters:
o
- The status to compare- Returns:
- -1, 1, or 0
-
toString
-