org.kuali.rice.kcb.service.impl
Class MessagingServiceImpl

java.lang.Object
  extended by org.kuali.rice.kcb.service.impl.MessagingServiceImpl
All Implemented Interfaces:
MessagingService

public class MessagingServiceImpl
extends Object
implements MessagingService

MessagingService implementation

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
static class MessagingServiceImpl.QueueProcessingJobSynchronization
           
 
Field Summary
private  String jobGroup
           
private  String jobName
           
private static org.apache.log4j.Logger LOG
           
private  MessageDeliveryService messageDeliveryService
           
private  MessageService messageService
           
private  RecipientPreferenceService recipientPrefs
           
private  boolean synchronous
          Whether to perform the processing synchronously
 
Constructor Summary
MessagingServiceImpl()
           
 
Method Summary
 Long deliver(MessageDTO message)
          Delivers a message
private  Collection<String> getDelivererTypesForUserAndChannel(String userRecipientId, String channel)
          Determines what delivery endpoints the user has configured
private  void queueJob(MessageProcessingJob.Mode mode, long messageId, String user, String cause)
           
 void remove(long messageId, String user, String cause)
          Removes a specific message and all deliveries
private  void remove(Message message, String user, String cause)
           
 Long removeByOriginId(String originId, String user, String cause)
          Removes a specific message and all deliveries.
 void setJobGroup(String jobGroup)
          Sets the group of the target job to run to process messages
 void setJobName(String jobName)
          Sets the name of the target job to run to process messages
 void setMessageDeliveryService(MessageDeliveryService messageDeliveryService)
          Sets the MessageDeliveryService
 void setMessageService(MessageService messageService)
          Sets the MessageService
 void setRecipientPreferenceService(RecipientPreferenceService prefs)
          Sets the RecipientPreferencesService
 void setSynchronous(boolean sync)
          Sets whether to perform the processing synchronously
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

messageService

private MessageService messageService

messageDeliveryService

private MessageDeliveryService messageDeliveryService

recipientPrefs

private RecipientPreferenceService recipientPrefs

jobName

private String jobName

jobGroup

private String jobGroup

synchronous

private boolean synchronous
Whether to perform the processing synchronously

Constructor Detail

MessagingServiceImpl

public MessagingServiceImpl()
Method Detail

setJobName

public void setJobName(String jobName)
Sets the name of the target job to run to process messages

Parameters:
jobName - the name of the target job to run to process messages

setJobGroup

public void setJobGroup(String jobGroup)
Sets the group of the target job to run to process messages

Parameters:
jobGroup - Sets the group of the target job to run to process messages

setMessageService

public void setMessageService(MessageService messageService)
Sets the MessageService

Parameters:
messageService - the MessageService

setMessageDeliveryService

public void setMessageDeliveryService(MessageDeliveryService messageDeliveryService)
Sets the MessageDeliveryService

Parameters:
messageDeliveryService - the MessageDeliveryService

setSynchronous

public void setSynchronous(boolean sync)
Sets whether to perform the processing synchronously

Parameters:
sync - whether to perform the processing synchronously

setRecipientPreferenceService

public void setRecipientPreferenceService(RecipientPreferenceService prefs)
Sets the RecipientPreferencesService

Parameters:
prefs - the RecipientPreferenceService

deliver

public Long deliver(MessageDTO message)
             throws MessageDeliveryException
Description copied from interface: MessagingService
Delivers a message

Specified by:
deliver in interface MessagingService
Parameters:
message - message to deliver
Returns:
identifier for the message
Throws:
MessageDeliveryException
See Also:
MessagingService.deliver(org.kuali.rice.kcb.dto.MessageDTO)

remove

public void remove(long messageId,
                   String user,
                   String cause)
            throws MessageDismissalException
Description copied from interface: MessagingService
Removes a specific message and all deliveries

Specified by:
remove in interface MessagingService
Parameters:
messageId - id of the message to remove
user - the user under which the action was taken
cause - the cause or action taken to remove the message
Throws:
MessageDismissalException
See Also:
MessagingService.remove(long, java.lang.String, java.lang.String)

removeByOriginId

public Long removeByOriginId(String originId,
                             String user,
                             String cause)
                      throws MessageDismissalException
Description copied from interface: MessagingService
Removes a specific message and all deliveries. Does not throw an exception if no message with the origin id is found.

Specified by:
removeByOriginId in interface MessagingService
Parameters:
originId - origin id of the message to remove
user - the user under which the action was taken
cause - the cause or action taken to remove the message
Returns:
Long the message id of the message removed, if any
Throws:
MessageDismissalException
See Also:
MessagingService.removeByOriginId(java.lang.String, java.lang.String, java.lang.String)

remove

private void remove(Message message,
                    String user,
                    String cause)

getDelivererTypesForUserAndChannel

private Collection<String> getDelivererTypesForUserAndChannel(String userRecipientId,
                                                              String channel)
Determines what delivery endpoints the user has configured

Parameters:
userRecipientId - the user
Returns:
a Set of NotificationConstants.MESSAGE_DELIVERY_TYPES

queueJob

private void queueJob(MessageProcessingJob.Mode mode,
                      long messageId,
                      String user,
                      String cause)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.