Examples of AlertNotification


Examples of org.jsmpp.bean.AlertNotification

        assertSame(ExchangePattern.InOnly, exchange.getPattern());
    }

    @Test
    public void createOnAcceptAlertNotificationExchangeWithExchangePattern() {
        AlertNotification alertNotification = createMock(AlertNotification.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(alertNotification)).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(alertNotification, binding, message);
View Full Code Here

Examples of org.jsmpp.bean.AlertNotification

        assertTrue(message.getHeaders().isEmpty());
    }

    @Test
    public void alertNotificationConstructorShouldReturnAnInstanceWithACommandAndHeaderAttributes() {
        AlertNotification command = new AlertNotification();
        message = new SmppMessage(command, new SmppConfiguration());
       
        assertTrue(message.getCommand() instanceof AlertNotification);
        assertTrue(message.getHeaders().isEmpty());
        assertTrue(message.isAlertNotification());
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

        }

        // copy notifications
        List<AlertNotification> copiedNotifications = new ArrayList<AlertNotification>();
        for (AlertNotification oldNotification : alertDef.getAlertNotifications()) {
            AlertNotification newNotification = new AlertNotification(oldNotification);
            newNotification.setAlertDefinition(this);
            copiedNotifications.add(newNotification);
        }
        this.removeAllAlertNotifications();
        this.getAlertNotifications().addAll(copiedNotifications);
    }
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

        setFields(formItems.toArray(new FormItem[formItems.size()]));
    };

    private void saveNewNotification() {
        AlertNotification notif;

        if (notificationToEdit == null) {
            // we are adding a new notification - we just add it to the end of the list
            String selectedSender = notificationSenderSelectItem.getValue().toString();
            notif = new AlertNotification(selectedSender);
            notif.setAlertDefinition(alertDefinition);
            notifications.add(notif);
        } else {
            notif = notificationToEdit;
        }

        AbstractNotificationSenderForm senderForm = (AbstractNotificationSenderForm) senderCanvasItem.getCanvas();
        notif.setConfiguration(senderForm.getConfiguration());
        notif.setExtraConfiguration(senderForm.getExtraConfiguration());
    }
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

        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));
                if (notification.getExtraConfiguration() != null) {
                    bean.setExtraParameters(notification.getExtraConfiguration().deepCopy(true));
                }
            }
        }
        return bean;
    }
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

        return notifications;
    }

    public AlertNotification getAlertNotification(Subject user, int alertNotificationId) {
        AlertNotification notification = entityManager.find(AlertNotification.class, alertNotificationId);
        if (notification == null) {
            return null;
        }
        notification.getConfiguration().getProperties().size(); // eager load the alert properties
        if (notification.getExtraConfiguration() != null) {
            notification.getExtraConfiguration().getProperties().size(); // eager load the extra alert properties
        }
        return notification;
    }
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

                    .<AlertNotification> emptyList() : persistedAlertDefinition.getAlertNotifications();

                if (persistedNotifications.size() > 0) {
                    Iterator<AlertNotification> it = notifications.iterator();
                    while (it.hasNext()) {
                        AlertNotification newNotification = it.next();

                        if (newNotification.getId() == 0) {
                            //this is a fresh, not persisted notif. These guys have to be always finalized.
                            continue;
                        }

                        for (AlertNotification persistedNotification : persistedNotifications) {
                            //ignore the ids on the notifications as they may vary if we are comparing parent alert def with its children
                            //it's enough for us they they are semantically the same.
                            if (newNotification.getSenderName().equals(persistedNotification.getSenderName())
                                && newNotification.equalsData(persistedNotification)) {
                                it.remove();
                                break;
                            }
                        }
                    }
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

                newSenderConfig = configDefinition.getDefaultTemplate().createConfiguration();
            } else {
                newSenderConfig = new Configuration();
            }

            AlertNotification newNotification = new AlertNotification(this.selectedNewSender, newSenderConfig);

            AlertNotification newlyCreated = this.alertNotificationManager.addAlertNotification(getSubject(),
                this.contextId, newNotification);

            reloadAlertNotifications();
            this.activeNotification = newlyCreated;
            this.selectedNotifications.clear();
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

    public void init() {
        if (alertNotificationId == null) {
            return;
        }

        AlertNotification activeNotification = alertNotificationManager.getAlertNotification(getSubject(),
            alertNotificationId);
        if (activeNotification == null) {
            return; // this was just removed on the previous request
        }
        String senderName = activeNotification.getSenderName();

        AlertSenderInfo info = alertNotificationManager.getAlertInfoForSender(senderName);

        if (info != null && info.getUiSnippetUrl() != null) {
            this.contentUrl = info.getUiSnippetUrl().toString();
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

    public String saveConfiguration() {
        try {
            customBackingBean.saveView();

            int notificationId = customBackingBean.getAlertNotificationId();
            AlertNotification notification = alertNotificationManager
                .getAlertNotification(getSubject(), notificationId);

            if (customBackingBean.getExtraParameters() != null) {
                notification.setExtraConfiguration(customBackingBean.getExtraParameters());
            } else {
                notification.setExtraConfiguration(null);
            }
            int alertDefinitionId = Integer.parseInt(customBackingBean.getContextId());
            alertNotificationManager.updateAlertNotification(getSubject(), alertDefinitionId, notification);

            //            AlertNotificationsUIBean notificationsUIBean = (AlertNotificationsUIBean) Contexts
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.