Package org.zeroexchange.messaging.event

Examples of org.zeroexchange.messaging.event.PrivateMessageSent


                       
                        @Override
                        public void onSubmit() {
                            MessageData messageData = messageForm.getModelObject();
                            try {
                                PrivateMessageSent event = createMessageEvent(messageData);
                                eventDispatcher.publishEvent(event);
                                setResponsePage(UserMaintenance.class,
                                        new PageParameters().add(
                                                UserMaintenance.PKEY_TAB, UserMaintenance.TABALIAS_USER_MESSAGES));
                            } catch (Exception e) {
View Full Code Here


    protected PrivateMessageSent createMessageEvent(MessageData messageData) {
       
        User sender = userReader.getUser(authorizedUserService.getCurrentUserId());
        //Setup the recipients
        Collection<User> recipients = messageData.getRecipients();
        PrivateMessageSent event = new PrivateMessageSent();
        event.setBody(messageData.getBody());
        event.setSubject(messageData.getSubject());
        event.setSender(sender);
        event.setLocale(localeService.getCurrentLocale());

        for(User recipient: recipients) {
            if(recipient == null) {
                String unknownRecipientMessage = MessageFormat.format(getString(MKEY_UNKNOWN_RECIPIENT), new Object[]{recipient});
                recipientsListLabel.error(unknownRecipientMessage);
                throw new BusinessLogicException(unknownRecipientMessage);
            }
        }
        event.setRecipients(recipients);
       
        return event;
    }
View Full Code Here

TOP

Related Classes of org.zeroexchange.messaging.event.PrivateMessageSent

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.