Package org.opennms.features.jest.client
Class ElasticHealthCheck
- java.lang.Object
-
- org.opennms.features.jest.client.ElasticHealthCheck
-
- All Implemented Interfaces:
HealthCheck
- Direct Known Subclasses:
RequireConfigurationElasticHealthCheck
public class ElasticHealthCheck extends Object implements HealthCheck
Verifies the connection to ElasticSearch. The health check may be located in an odd place for now. The reason for this is, that multiple Modules create their own clients. In order to not configure the client for the health check module as well, thisHealthCheckis only validating if the connection to ElasticSearch from the view of the flows/elastic bundle is working.- Author:
- mvrueden
-
-
Constructor Summary
Constructors Constructor Description ElasticHealthCheck(io.searchbox.client.JestClient jestClient, String featureName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()The description of theHealthCheck, e.g.List<String>getTags()A tag to indicate the category of the health-check.Responseperform(Context context)Implements the check itself, e.g.
-
-
-
Constructor Detail
-
ElasticHealthCheck
public ElasticHealthCheck(io.searchbox.client.JestClient jestClient, String featureName)
-
-
Method Detail
-
getDescription
public String getDescription()
Description copied from interface:HealthCheckThe description of theHealthCheck, e.g. "Connecting to OpenNMS ReST API". This is used when visualizing the progress or result of the checks.- Specified by:
getDescriptionin interfaceHealthCheck- Returns:
- The string, describing the check.
-
getTags
public List<String> getTags()
Description copied from interface:HealthCheckA tag to indicate the category of the health-check.- Specified by:
getTagsin interfaceHealthCheck- Returns:
- The HealthTag type, describing category of the health-check.
-
perform
public Response perform(Context context)
Description copied from interface:HealthCheckImplements 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 theHealthCheckimplementation. Implementations might throw an Exception, which should be handled by theHealthCheckServiceas well. The response indicates if the check was successful, or encountered other problems. If null is returned, theHealthCheckServiceshould consider this asStatus.Unknown.- Specified by:
performin interfaceHealthCheck- Returns:
- The response indicating the Success/Failure/Timeout/etc of the check
- See Also:
HealthCheckService
-
-