Package org.rhq.enterprise.server.alert

Examples of org.rhq.enterprise.server.alert.AlertManagerLocal.prettyPrintAlertConditions()


            AlertManagerLocal alertManager = LookupUtil.getAlertManager();

            Object[] args = new Object[3];
            args[0] = alert;
            args[1] = alertManager.prettyPrintAlertURL(alert);
            args[2] = alertManager.prettyPrintAlertConditions(alert, false);
            result = ((Invocable) engine).invokeFunction("sendAlert", args);

            if (result == null) {
                return SenderResult.getSimpleFailure("Script ]" + scriptName + "] returned null, so success is unknown");
            }
View Full Code Here


            b.append(alert.getId()).append(":'"); // Alert id
            b.append(alert.getAlertDefinition().getResource().getName());
            b.append("' (");
            b.append(alert.getAlertDefinition().getResource().getId());
            b.append("): ");
            b.append(alertManager.prettyPrintAlertConditions(alert, true));
            b.append("-by " + this.alertParameters.getSimpleValue("twittedBy", "@RHQ")); // TODO not for production :-)
            // TODO use some alert url shortening service

            String msg = b.toString();
            if (msg.length() > 140)
View Full Code Here

            b.append(". Cause is ");

            // Switch locale to english, as the voice synthesizer expects this for now
            Locale currentLocale = Locale.getDefault();
            Locale.setDefault(Locale.ENGLISH);
            b.append(alertManager.prettyPrintAlertConditions(alert, false));
            Locale.setDefault(currentLocale);

            boolean willBeDisabled = alertManager.willDefinitionBeDisabled(alert);

            if (willBeDisabled)
View Full Code Here

        b.append(" (on ");
        b.append(alert.getAlertDefinition().getResource().getName());
        b.append("):  ");
        b.append(alertManager.prettyPrintAlertURL(alert));
        b.append("\n");
        b.append(alertManager.prettyPrintAlertConditions(alert, false));

        return b.toString();
    }
}
View Full Code Here

        AlertManagerLocal alertManager = LookupUtil.getAlertManager();
        ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();

        List lineage = resourceManager.getResourceLineage(alert.getAlertDefinition().getResource().getId());
        String platformName = ((Resource)lineage.get(0)).getName();
        String conditions = alertManager.prettyPrintAlertConditions(alert, false).replace('\n', ' ');
        String alertURL = alertManager.prettyPrintAlertURL(alert);
        StringBuilder message = new StringBuilder();
        message.append("ALERT,");
        message.append(alert.getAlertDefinition().getPriority().getName());
        message.append(',');
View Full Code Here

        case ALERT_DEF_PRIO:
            return alert.getAlertDefinition().getPriority().getName();
        case ALERT_URL:
            return mgr.prettyPrintAlertURL(alert);
        case ALERT_CONDITIONS:
            return mgr.prettyPrintAlertConditions(alert, false);

        default:
            return NOT_YET_IMPLEMENTED;
        }
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.