Package org.opennms.core.health.api
Class Health
- java.lang.Object
-
- org.opennms.core.health.api.Health
-
public class Health extends java.lang.Object
Represents the "Health", by holding a list ofResponse
s. It allows accessing the responses and also provides some helper methods (e.g. to get the worst response).- Author:
- mvrueden
-
-
Constructor Summary
Constructors Constructor Description Health()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(HealthCheck healthCheck, Response response)
java.lang.String
getErrorMessage()
java.util.List<org.apache.commons.lang3.tuple.Pair<HealthCheck,Response>>
getResponses()
java.util.Optional<org.apache.commons.lang3.tuple.Pair<HealthCheck,Response>>
getWorst()
boolean
isSuccess()
void
setError(java.lang.String errorMessage)
Health
withResponse(HealthCheck healthCheck, Response response)
-
-
-
Method Detail
-
withResponse
public Health withResponse(HealthCheck healthCheck, Response response)
-
isSuccess
public boolean isSuccess()
-
getWorst
public java.util.Optional<org.apache.commons.lang3.tuple.Pair<HealthCheck,Response>> getWorst()
-
add
public void add(HealthCheck healthCheck, Response response)
-
setError
public void setError(java.lang.String errorMessage)
-
getErrorMessage
public java.lang.String getErrorMessage()
-
getResponses
public java.util.List<org.apache.commons.lang3.tuple.Pair<HealthCheck,Response>> getResponses()
-
-