Package org.opennms.core.health.api
Interface HealthCheck
-
- All Known Implementing Classes:
AdapterHealthCheck
,ContainerIntegrityHealthCheck
,DaoHealthCheck
,ElasticHealthCheck
,ElasticHealthCheck
,GrpcHealthCheck
,JmsConnectionHealthCheck
,KafkaHealthCheck
,ListenerHealthCheck
,NettyDnsHealthCheck
,RequireConfigurationElasticHealthCheck
,RestConnectionHealthCheck
,SimpleHealthCheck
public interface HealthCheck
Interface to define aHealthCheck
.- Author:
- mvrueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getDescription()
The description of theHealthCheck
, e.g.Response
perform(Context context)
Implements the check itself, e.g.
-
-
-
Method Detail
-
getDescription
java.lang.String getDescription()
The description of theHealthCheck
, e.g. "Connecting to OpenNMS ReST API". This is used when visualizing the progress or result of the checks.- Returns:
- The string, describing the check.
-
perform
Response perform(Context context) throws java.lang.Exception
Implements the check itself, e.g. Connecting to a HTTP Endpoint. As the method is called by theHealthCheckService
, it is advised that all timeout restrictions etc are handled by the service instead of theHealthCheck
implementation. Implementations might throw an Exception, which should be handled by theHealthCheckService
as well. The response indicates if the check was successful, or encountered other problems. If null is returned, theHealthCheckService
should consider this asStatus.Unknown
.- Parameters:
context
-- Returns:
- The response indicating the Success/Failure/Timeout/etc of the check
- Throws:
java.lang.Exception
- In case of an error- See Also:
HealthCheckService
-
-