类 Health
java.lang.Object
org.springframework.boot.actuate.health.HealthComponent
org.springframework.boot.actuate.health.Health
- 所有已实现的接口:
OperationResponseBody
Carries information about the health of a component or subsystem. Extends
HealthComponent so that additional contextual details about the system can be
returned along with the Status.
Health instances can be created by using Health.Builder's fluent API. Typical
usage in a HealthIndicator would be:
try {
// do some test to determine state of component
return Health.up().withDetail("version", "1.1.2").build();
}
catch (Exception ex) {
return Health.down(ex).build();
}
- 从以下版本开始:
- 1.1.0
- 作者:
- Christian Dupuis, Phillip Webb, Michael Pratt
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static Health.Builderdown()Create a newHealth.Builderinstance with aStatus.DOWNstatus.static Health.BuilderCreate a newHealth.Builderinstance with anStatus.DOWNstatus and the specified exception details.booleanReturn the details of the health.Return the status of the health.inthashCode()static Health.BuilderCreate a newHealth.Builderinstance with anStatus.OUT_OF_SERVICEstatus.static Health.BuilderCreate a newHealth.Builderinstance with a specific status code.static Health.BuilderCreate a newHealth.Builderinstance with a specificStatus.toString()static Health.Builderunknown()Create a newHealth.Builderinstance with anStatus.UNKNOWNstatus.static Health.Builderup()Create a newHealth.Builderinstance with anStatus.UPstatus.
-
方法详细资料
-
getStatus
Return the status of the health.- 指定者:
getStatus在类中HealthComponent- 返回:
- the status (never
null)
-
getDetails
Return the details of the health.- 返回:
- the details (or an empty map)
-
equals
-
hashCode
public int hashCode() -
toString
-
unknown
Create a newHealth.Builderinstance with anStatus.UNKNOWNstatus.- 返回:
- a new
Health.Builderinstance
-
up
Create a newHealth.Builderinstance with anStatus.UPstatus.- 返回:
- a new
Health.Builderinstance
-
down
Create a newHealth.Builderinstance with anStatus.DOWNstatus and the specified exception details.- 参数:
ex- the exception- 返回:
- a new
Health.Builderinstance
-
down
Create a newHealth.Builderinstance with aStatus.DOWNstatus.- 返回:
- a new
Health.Builderinstance
-
outOfService
Create a newHealth.Builderinstance with anStatus.OUT_OF_SERVICEstatus.- 返回:
- a new
Health.Builderinstance
-
status
Create a newHealth.Builderinstance with a specific status code.- 参数:
statusCode- the status code- 返回:
- a new
Health.Builderinstance
-
status
Create a newHealth.Builderinstance with a specificStatus.- 参数:
status- the status- 返回:
- a new
Health.Builderinstance
-