Skip to content

class HealthCheckResult

cangjie
public class HealthCheckResult

功能:表示单个健康检查的执行结果。

成员概览

成员功能
init(HealthStatus, ?String, ?Exception, HashMap<String, Object>)创建健康检查结果。
prop status返回当前健康检查状态。
prop data返回健康检查附带的数据集合。
prop exception返回健康检查过程中捕获的异常。
prop description返回健康检查结果描述。
func healthy(?String)创建一个健康状态的检查结果。
func healthy(?String, HashMap<String, Object>)创建一个带附加数据的健康状态检查结果。
func degraded(?String, ?Exception, HashMap<String, Object>)创建一个降级状态的检查结果。
func degraded(?String, ?Exception)创建一个降级状态的检查结果。
func unhealthy(?String, ?Exception, HashMap<String, Object>)创建一个不健康状态的检查结果。
func unhealthy(?String, ?Exception)创建一个不健康状态的检查结果。

init(HealthStatus, ?String, ?Exception, HashMap<String, Object>)

cangjie
public init(status: HealthStatus, description: ?String, exception: ?Exception, data: HashMap<String, Object>)

功能:创建健康检查结果。

参数:

  • status: HealthStatus - 健康检查状态。
  • description: ?String - 健康检查结果描述。
  • exception: ?Exception - 健康检查过程中捕获的异常。
  • data: HashMap<String, Object> - 健康检查附带的数据集合。

prop status

cangjie
public prop status: HealthStatus

功能:返回当前健康检查状态。

类型:HealthStatus

prop data

cangjie
public prop data: ReadOnlyMap<String, Object>

功能:返回健康检查附带的数据集合。

类型:ReadOnlyMap<String, Object>

prop exception

cangjie
public prop exception: ?Exception

功能:返回健康检查过程中捕获的异常。

类型:?Exception

prop description

cangjie
public prop description: ?String

功能:返回健康检查结果描述。

类型:?String

func healthy(?String)

cangjie
public static func healthy(description!: ?String = None): HealthCheckResult

功能:创建一个健康状态的检查结果。

参数:

  • description: ?String - 健康检查结果描述。

返回值:

func healthy(?String, HashMap<String, Object>)

cangjie
public static func healthy(description!: ?String = None, data!: HashMap<String, Object>): HealthCheckResult

功能:创建一个带附加数据的健康状态检查结果。

参数:

  • description: ?String - 健康检查结果描述。
  • data: HashMap<String, Object> - 健康检查附带的数据集合。

返回值:

func degraded(?String, ?Exception, HashMap<String, Object>)

cangjie
public static func degraded(description!: ?String = None, exception!: ?Exception = None,
data!: HashMap<String, Object>): HealthCheckResult

功能:创建一个降级状态的检查结果。

参数:

  • description: ?String - 健康检查结果描述。
  • exception: ?Exception - 健康检查过程中捕获的异常。
  • data: HashMap<String, Object> - 健康检查附带的数据集合。

返回值:

func degraded(?String, ?Exception)

cangjie
public static func degraded(description!: ?String = None, exception!: ?Exception = None): HealthCheckResult

功能:创建一个降级状态的检查结果。

参数:

  • description: ?String - 健康检查结果描述。
  • exception: ?Exception - 健康检查过程中捕获的异常。

返回值:

func unhealthy(?String, ?Exception, HashMap<String, Object>)

cangjie
public static func unhealthy(description!: ?String = None, exception!: ?Exception = None,
data!: HashMap<String, Object>): HealthCheckResult

功能:创建一个不健康状态的检查结果。

参数:

  • description: ?String - 健康检查结果描述。
  • exception: ?Exception - 健康检查过程中捕获的异常。
  • data: HashMap<String, Object> - 健康检查附带的数据集合。

返回值:

func unhealthy(?String, ?Exception)

cangjie
public static func unhealthy(description!: ?String = None, exception!: ?Exception = None): HealthCheckResult

功能:创建一个不健康状态的检查结果。

参数:

  • description: ?String - 健康检查结果描述。
  • exception: ?Exception - 健康检查过程中捕获的异常。

返回值: