Package org.rhq.enterprise.server.rest.domain

Examples of org.rhq.enterprise.server.rest.domain.AlertNotificationRest


        AlertNotification notification = notificationMgr.getAlertNotification(caller,notificationId);
        if (notification==null) {
            throw new StuffNotFoundException("No notification with id " + notificationId);
        }
        AlertNotificationRest anr = notificationToNotificationRest(notification);

        return Response.ok(anr).build();
    }
View Full Code Here


                newNotifId = n.getId();
            }
        }

        AlertNotification result = notificationMgr.getAlertNotification(caller,newNotifId);
        AlertNotificationRest resultRest = notificationToNotificationRest(result);

        return Response.ok(resultRest).build(); // TODO
    }
View Full Code Here

        List<AlertNotification> notifs = updatedDefinition.getAlertNotifications();

        assert notifs.size() == existingNotificationCount +1;

        AlertNotification updatedNotification = notifs.get(existingNotificationCount);
        AlertNotificationRest updatedNotificationRest = notificationToNotificationRest(updatedNotification);

        int notificationId = updatedNotification.getId();

        UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
        uriBuilder.path("/alert/notification/{nid}");
View Full Code Here

            }
            List<AlertNotification> notifications = def.getAlertNotifications();
            if (notifications.size() > 0) {
                List<AlertNotificationRest> notificationRestList = new ArrayList<AlertNotificationRest>(notifications.size());
                for (AlertNotification notification : notifications) {
                    AlertNotificationRest anr = notificationToNotificationRest(notification);
                    notificationRestList.add(anr);
                }
                adr.setNotifications(notificationRestList);
            }
        }
View Full Code Here

        return adr;
    }

    private AlertNotificationRest notificationToNotificationRest(AlertNotification notification) {
        AlertNotificationRest anr = new AlertNotificationRest();
        anr.setId(notification.getId());
        anr.setSenderName(notification.getSenderName());
        ConfigurationDefinition configDef = notificationMgr.getConfigurationDefinitionForSender(notification
            .getSenderName());
        anr.setConfig(ConfigurationHelper.configurationToMap(notification.getConfiguration(), configDef, false));
        ConfigurationDefinition extraConfigDef = null;
        if ("Resource Operations".equals(notification.getSenderName())) {
            OperationDefinition opDef = operationMgr.getOperationDefinition(caller,
                Integer.valueOf(notification.getConfiguration().getSimpleValue("operation-definition-id", "0")));
            extraConfigDef = opDef.getParametersConfigurationDefinition();
        }
        anr.setExtraConfig(ConfigurationHelper.configurationToMap(notification.getExtraConfiguration(), extraConfigDef,
            false));
        return anr;
    }
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.rest.domain.AlertNotificationRest

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.