类 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.Builder
down()
Create a newHealth.Builder
instance with aStatus.DOWN
status.static Health.Builder
Create a newHealth.Builder
instance with anStatus.DOWN
status and the specified exception details.boolean
Return the details of the health.Return the status of the health.int
hashCode()
static Health.Builder
Create a newHealth.Builder
instance with anStatus.OUT_OF_SERVICE
status.static Health.Builder
Create a newHealth.Builder
instance with a specific status code.static Health.Builder
Create a newHealth.Builder
instance with a specificStatus
.toString()
static Health.Builder
unknown()
Create a newHealth.Builder
instance with anStatus.UNKNOWN
status.static Health.Builder
up()
Create a newHealth.Builder
instance with anStatus.UP
status.
-
方法详细资料
-
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.Builder
instance with anStatus.UNKNOWN
status.- 返回:
- a new
Health.Builder
instance
-
up
Create a newHealth.Builder
instance with anStatus.UP
status.- 返回:
- a new
Health.Builder
instance
-
down
Create a newHealth.Builder
instance with anStatus.DOWN
status and the specified exception details.- 参数:
ex
- the exception- 返回:
- a new
Health.Builder
instance
-
down
Create a newHealth.Builder
instance with aStatus.DOWN
status.- 返回:
- a new
Health.Builder
instance
-
outOfService
Create a newHealth.Builder
instance with anStatus.OUT_OF_SERVICE
status.- 返回:
- a new
Health.Builder
instance
-
status
Create a newHealth.Builder
instance with a specific status code.- 参数:
statusCode
- the status code- 返回:
- a new
Health.Builder
instance
-
status
Create a newHealth.Builder
instance with a specificStatus
.- 参数:
status
- the status- 返回:
- a new
Health.Builder
instance
-