Package com.adito.notification

Examples of com.adito.notification.Message


   
    public ActionForward commit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        MessageForm mf = (MessageForm)form;
        Realm realm = getSessionInfo(request).getUser().getRealm();
        Message msg = new Message(mf.getSubject(), mf.getContent(), mf.getUrgent());
        for(Iterator i = mf.getSelectedAccountsList().iterator(); i.hasNext(); ) {
            msg.getRecipients().add(new Recipient(Recipient.USER, (String)i.next(), realm.getResourceName()));
        }
        for(Iterator i = mf.getSelectedRolesList().iterator(); i.hasNext(); ) {
            msg.getRecipients().add(new Recipient(Recipient.ROLE, (String)i.next(), realm.getResourceName()));
        }
        for(Iterator i = mf.getSelectedPoliciesList().iterator(); i.hasNext(); ) {
            String policyName = PolicyDatabaseFactory.getInstance().getPolicy(Integer.parseInt((String)i.next())).getResourceName();
            msg.getRecipients().add(new Recipient(Recipient.POLICY, policyName, realm.getResourceName()));
        }
        if(msg.getRecipients().size() == 0) {
            throw new Exception("No recipients in any of the accounts, roles or policies selected.");
        }
        if(mf.getSelectedSink().equals("*")) {
            CoreServlet.getServlet().getNotifier().sendToAll(msg);
        }
View Full Code Here

TOP

Related Classes of com.adito.notification.Message

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.