Examples of AlertWithLatestConditionLog


Examples of org.rhq.core.domain.alert.composite.AlertWithLatestConditionLog

            for (Alert alert : alerts) {
                Resource res = alert.getAlertDefinition().getResource();
                String recoveryInfo = AlertDefUtil.getAlertRecoveryInfo(alert, res.getId());

                if (alert.getConditionLogs().size() > 1) {
                    results.add(new AlertWithLatestConditionLog(alert, "Multiple Conditions", "--", recoveryInfo));
                } else if (alert.getConditionLogs().size() == 1) {
                    AlertConditionLog log = alert.getConditionLogs().iterator().next();
                    AlertCondition condition = log.getCondition();
                    String displayText = AlertDefUtil.formatAlertConditionForDisplay(condition, request);

                    String firedValue = log.getValue();
                    if (condition.getMeasurementDefinition() != null) {
                        firedValue = MeasurementConverter.format(Double.valueOf(log.getValue()), condition
                            .getMeasurementDefinition().getUnits(), true);
                    }

                    results.add(new AlertWithLatestConditionLog(alert, displayText, firedValue, recoveryInfo));
                } else {
                    results.add(new AlertWithLatestConditionLog(alert, "No Conditions", "--", recoveryInfo));
                }

            }

            return new PageList<AlertWithLatestConditionLog>(results, alerts.getTotalSize(), pc);
View Full Code Here

Examples of org.rhq.core.domain.alert.composite.AlertWithLatestConditionLog

            HttpServletRequest request = FacesContextUtility.getRequest();
            for (Alert alert : alerts) {
                String recoveryInfo = AlertDefUtil.getAlertRecoveryInfo(alert, resource.getId());

                if (alert.getConditionLogs().size() > 1) {
                    results.add(new AlertWithLatestConditionLog(alert, "Multiple Conditions", "--", recoveryInfo));
                } else if (alert.getConditionLogs().size() == 1) {
                    AlertConditionLog log = alert.getConditionLogs().iterator().next();
                    AlertCondition condition = log.getCondition();
                    String displayText = AlertDefUtil.formatAlertConditionForDisplay(condition, request);

                    String firedValue = log.getValue();
                    if (isPureNumeric(condition)) {
                        firedValue = MeasurementConverter.format(Double.valueOf(log.getValue()), condition
                            .getMeasurementDefinition().getUnits(), true);
                    }

                    results.add(new AlertWithLatestConditionLog(alert, displayText, firedValue, recoveryInfo));
                } else {
                    results.add(new AlertWithLatestConditionLog(alert, "No Conditions", "--", recoveryInfo));
                }

            }

            return new PageList<AlertWithLatestConditionLog>(results, alerts.getTotalSize(), pc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.