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

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


        List<String> senderNames = notificationMgr.listAllAlertSenders();
        List<AlertSender> senderList = new ArrayList<AlertSender>(senderNames.size());
        for (String senderName : senderNames) {
            AlertSenderInfo info = notificationMgr.getAlertInfoForSender(senderName);
            AlertSender sender = new AlertSender(senderName);
            sender.setDescription(info.getDescription());

            UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
            uriBuilder.path("/alert/sender/{name}");
            URI uri = uriBuilder.build(sender.getSenderName());
            Link self = new Link("self",uri.toString());
            sender.setLink(self);

            senderList.add(sender);
        }

        GenericEntity<List<AlertSender>> entity = new GenericEntity<List<AlertSender>>(senderList) {};
View Full Code Here


        AlertSenderInfo info = notificationMgr.getAlertInfoForSender(senderName);
        if (info==null) {
            throw new StuffNotFoundException("Alert sender with name [" + senderName + "]");
        }
        AlertSender sender = new AlertSender(senderName);
        sender.setDescription(info.getDescription());

        ConfigurationDefinition definition = notificationMgr.getConfigurationDefinitionForSender(senderName);
        for (PropertyDefinition pd : definition.getPropertyDefinitions().values()) {
            if (pd instanceof PropertyDefinitionSimple) {
                PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd;
                sender.getConfigDefinition().put(pds.getName(),pds.getType().name());
            }
            else {
                log.warn("Property " + pd.getName() + " for sender " + senderName + " is not of a supported type");
            }
        }

        UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
        uriBuilder.path("/alert/sender/{name}");
        URI uri = uriBuilder.build(sender.getSenderName());
        Link self = new Link("self",uri.toString());
        sender.setLink(self);


        Response.ResponseBuilder builder = Response.ok(sender);

        return builder.build();
View Full Code Here

TOP

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

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.