Package org.rhq.core.domain.alert

Examples of org.rhq.core.domain.alert.AlertDampeningEvent


        /*
         * The AlertDampeningEvents keep a running log of when all conditions have become true, as well as when they
         * become untrue (if they were most recently known to be true)
         */
        AlertDampeningEvent latestEvent = alertDampeningManager.getLatestEventByAlertDefinitionId(alertDefinitionId);
        AlertDampeningEvent.Type type = getNextEventType(latestEvent, conditionSetResult);
        if (log.isDebugEnabled()) {
            log.debug("Latest event was " + latestEvent + ", " + "next AlertDampeningEvent.Type is " + type);
        }

        /*
         * Finally, operate on the new type event
         */
        if (type != AlertDampeningEvent.Type.UNCHANGED) {
            /*
             * But only if it represents a type of event we need to act on
             */
            AlertDefinition flyWeightDefinition = new AlertDefinition();
            flyWeightDefinition.setId(alertDefinitionId);
            AlertDampeningEvent alertDampeningEvent = new AlertDampeningEvent(flyWeightDefinition, type);
            entityManager.persist(alertDampeningEvent);

            if (log.isDebugEnabled()) {
                log.debug("Need to process AlertDampeningEvent.Type of " + type + " " + "for AlertDefinition[ id="
                    + alertDefinitionId + " ]");
View Full Code Here


            alertConditionLogManager.removeUnmatchedLogByAlertConditionId(conditionMessage.getAlertConditionId());

            // then create a NEGATIVE dampening event, to breakup any contiguous POSITIVE events for correct processing
            AlertDefinition flyWeightDefinition = new AlertDefinition();
            flyWeightDefinition.setId(definitionId);
            AlertDampeningEvent event = new AlertDampeningEvent(flyWeightDefinition, AlertDampeningEvent.Type.NEGATIVE);
            entityManager.persist(event);

        } else {
            log.error("Unsupported message type sent to consumer for processing: "
                + conditionMessage.getClass().getSimpleName());
View Full Code Here

    public AlertDampeningEvent getLatestEventByAlertDefinitionId(int alertDefinitionId) {
        Query latestEventQuery = entityManager
            .createNamedQuery(AlertDampeningEvent.QUERY_FIND_LATEST_BY_ALERT_DEFINITION_ID);
        latestEventQuery.setParameter("alertDefinitionId", alertDefinitionId);
        try {
            AlertDampeningEvent latestEvent = (AlertDampeningEvent) latestEventQuery.getSingleResult();
            return latestEvent;
        } catch (NoResultException nre) {
            return null; // expected a good deal of the time
        }
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.alert.AlertDampeningEvent

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.