Class ContainerIntegrityHealthCheck

  • All Implemented Interfaces:
    HealthCheck

    public class ContainerIntegrityHealthCheck
    extends Object
    implements HealthCheck
    Verifies the integrity of the container. This is achieved by iterating over all bundles and checking its state. Every bundle which is not ACTIVE is considered failed. The only exceptions are: - fragment bundles as those never reach ACTIVE state and are considered successful if they are RESOLVED. - stopped bundles as they are very likely manually stopped or installed but not automatically started
    Author:
    mvrueden
    • Constructor Detail

      • ContainerIntegrityHealthCheck

        public ContainerIntegrityHealthCheck​(org.osgi.framework.BundleContext bundleContext,
                                             org.apache.karaf.bundle.core.BundleService bundleService,
                                             String ignoreBundleList)
    • Method Detail

      • getDescription

        public String getDescription()
        Description copied from interface: HealthCheck
        The description of the HealthCheck, e.g. "Connecting to OpenNMS ReST API". This is used when visualizing the progress or result of the checks.
        Specified by:
        getDescription in interface HealthCheck
        Returns:
        The string, describing the check.
      • getTags

        public List<String> getTags()
        Description copied from interface: HealthCheck
        A tag to indicate the category of the health-check.
        Specified by:
        getTags in interface HealthCheck
        Returns:
        The HealthTag type, describing category of the health-check.
      • perform

        public Response perform​(Context context)
        Description copied from interface: HealthCheck
        Implements the check itself, e.g. Connecting to a HTTP Endpoint. As the method is called by the HealthCheckService, it is advised that all timeout restrictions etc are handled by the service instead of the HealthCheck implementation. Implementations might throw an Exception, which should be handled by the HealthCheckService as well. The response indicates if the check was successful, or encountered other problems. If null is returned, the HealthCheckService should consider this as Status.Unknown.
        Specified by:
        perform in interface HealthCheck
        Returns:
        The response indicating the Success/Failure/Timeout/etc of the check
        See Also:
        HealthCheckService