Package org.rhq.enterprise.server.plugin.pc.alert

Examples of org.rhq.enterprise.server.plugin.pc.alert.AlertSenderPluginManager


        String additional = (grouped ? "_multi" : "");
        return "/portal/images/icons/Events_" + color + additional + "_16.png";
    }

    public static String getAlertSenderConfigurationPreview(AlertNotification alertNotification) {
        AlertSenderPluginManager alertSenderPluginManager = LookupUtil.getAlertManager().getAlertPluginManager();
        AlertSender sender = alertSenderPluginManager.getAlertSenderForNotification(alertNotification);
        return sender.previewConfiguration();
    }
View Full Code Here


                log.debug("Sending alert notifications for " + alert.toSimpleString() + "...");
            }
            List<AlertNotification> alertNotifications = alert.getAlertDefinition().getAlertNotifications();

            if (alertNotifications != null && alertNotifications.size() > 0) {
                AlertSenderPluginManager alertSenderPluginManager = getAlertPluginManager();

                for (AlertNotification alertNotification : alertNotifications) {
                    try {
                        AlertNotificationLog notificationLog = null;

                        String senderName = alertNotification.getSenderName();
                        if (alertSenderPluginManager == null) {
                            notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE,
                                "Notification was not sent as alert sender plugins are not yet initialized ");

                        } else if (senderName == null) {
                            notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE,
                                "Sender '" + senderName + "' is not defined");

                        } else {
                            AlertSender<?> notificationSender = alertSenderPluginManager
                                .getAlertSenderForNotification(alertNotification);
                            if (notificationSender == null) {
                                notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE,
                                    "Failed to obtain a sender with given name");
                            } else {
View Full Code Here

        if (pc == null) {
            log.warn(AlertServerPluginContainer.class.getSimpleName() + " has not been loaded by the "
                + MasterServerPluginContainer.class.getSimpleName() + " yet");
            return null;
        }
        AlertSenderPluginManager manager = (AlertSenderPluginManager) pc.getPluginManager();
        return manager;
    }
View Full Code Here

        return updated;
    }

    public ConfigurationDefinition getConfigurationDefinitionForSender(String shortName) {

        AlertSenderPluginManager pluginmanager = alertManager.getAlertPluginManager();

        AlertSenderInfo senderInfo = pluginmanager.getAlertSenderInfo(shortName);
        String pluginName = senderInfo.getPluginName();
        PluginKey key = senderInfo.getPluginKey();

        try {
            AlertPluginDescriptorType descriptor = (AlertPluginDescriptorType) serverPluginsBean
View Full Code Here

    /**
     * Return a list of all available AlertSenders in the system by their shortname.
     * @return list of senders.
     */
    public List<String> listAllAlertSenders() {
        AlertSenderPluginManager pluginmanager = alertManager.getAlertPluginManager();
        List<String> senders = pluginmanager.getPluginList();
        return senders;
    }
View Full Code Here

        List<String> senders = pluginmanager.getPluginList();
        return senders;
    }

    public AlertSenderInfo getAlertInfoForSender(String shortName) {
        AlertSenderPluginManager pluginmanager = alertManager.getAlertPluginManager();
        AlertSenderInfo info = pluginmanager.getAlertSenderInfo(shortName);

        return info;
    }
View Full Code Here

     * @param alertNotificationId id of the notification we assign this sender + its backing bean to
     * @return an initialized BackingBean or null in case of error
     */
    public CustomAlertSenderBackingBean getBackingBeanForSender(String shortName, Integer alertNotificationId) {

        AlertSenderPluginManager pluginmanager = alertManager.getAlertPluginManager();
        CustomAlertSenderBackingBean bean = pluginmanager.getBackingBeanForSender(shortName);

        if (alertNotificationId != null) {
            AlertNotification notification = entityManager.find(AlertNotification.class, alertNotificationId);
            if (notification != null && bean != null) {
                bean.setAlertParameters(notification.getConfiguration().deepCopy(true));
View Full Code Here

        }
        return bean;
    }

    public String getBackingBeanNameForSender(String shortName) {
        AlertSenderPluginManager pluginmanager = alertManager.getAlertPluginManager();
        return pluginmanager.getBackingBeanNameForSender(shortName);
    }
View Full Code Here

    public boolean finalizeNotifications(Subject subject, List<AlertNotification> notifications) {
        boolean hasErrors = false;

        if (notifications != null && notifications.size() > 0) {
            AlertSenderPluginManager pluginManager = alertManager.getAlertPluginManager();

            for (AlertNotification notification : notifications) {
                AlertSender<?> sender = pluginManager.getAlertSenderForNotification(notification);

                if (sender != null) {
                    AlertSenderValidationResults validation = sender.validateAndFinalizeConfiguration(subject);

                    notification.setConfiguration(validation.getAlertParameters());
View Full Code Here

    public String[] getAlertNotificationConfigurationPreview(Subject sessionSubject, AlertNotification[] notifications) {
        if (notifications == null || notifications.length == 0) {
            return new String[0];
        }

        AlertSenderPluginManager alertPluginManager = alertManager.getAlertPluginManager();

        String[] previews = new String[notifications.length];
        int i = 0;
        for (AlertNotification notif : notifications) {
            AlertSender<?> sender = alertPluginManager.getAlertSenderForNotification(notif);
            if (sender != null) {
                String preview = null;
                try {
                    preview = sender.previewConfiguration();
                } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.plugin.pc.alert.AlertSenderPluginManager

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.