Package org.apache.sling.hc.util

Examples of org.apache.sling.hc.util.HealthCheckMetadata


    }


    Result checkForRecursion(ServiceReference hcReference, Set<String> alreadyBannedTags) {

        HealthCheckMetadata thisCheckMetadata = new HealthCheckMetadata(hcReference);

        Set<String> bannedTagsForThisCompositeCheck = new HashSet<String>();
        bannedTagsForThisCompositeCheck.addAll(alreadyBannedTags);
        bannedTagsForThisCompositeCheck.addAll(thisCheckMetadata.getTags());

        String[] tagsForIncludedChecksArr = PropertiesUtil.toStringArray(hcReference.getProperty(PROP_FILTER_TAGS), new String[0]);
        Set<String> tagsForIncludedChecks = new HashSet<String>(Arrays.asList(tagsForIncludedChecksArr));
       
       
        log.debug("HC {} has banned tags {}", thisCheckMetadata.getName(), bannedTagsForThisCompositeCheck);
        log.debug("tagsForIncludedChecks {}", tagsForIncludedChecks);

        // is this HC ok?
        Set<String> intersection = new HashSet<String>();
        intersection.addAll(bannedTagsForThisCompositeCheck);
        intersection.retainAll(tagsForIncludedChecks);
       
        if (!intersection.isEmpty()) {
            return new Result(Status.HEALTH_CHECK_ERROR,
                    "INVALID CONFIGURATION: Cycle detected in composite health check hierarchy. Health check '" + thisCheckMetadata.getName()
                            + "' (" + hcReference.getProperty(Constants.SERVICE_PID) + ") must not have tag(s) " + intersection
                            + " as a composite check in the hierarchy is itself already tagged alike (tags assigned to composite checks: "
                            + bannedTagsForThisCompositeCheck + ")");
        }
       
View Full Code Here

TOP

Related Classes of org.apache.sling.hc.util.HealthCheckMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.