org.kuali.rice.ken.service.impl
Class NotificationServiceImpl

java.lang.Object
  extended by org.kuali.rice.ken.service.impl.NotificationServiceImpl
All Implemented Interfaces:
NotificationService

public class NotificationServiceImpl
extends Object
implements NotificationService

NotificationService implementation - this is the default out-of-the-box implementation of the service.

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

Constructor Summary
NotificationServiceImpl(GenericDao businessObjectDao, NotificationMessageContentService messageContentService, NotificationAuthorizationService notificationAuthorizationService, NotificationRecipientService notificationRecipientService, NotificationWorkflowDocumentService notificationWorkflowDocumentService, NotificationMessageDeliveryService notificationMessageDeliveryService, NotificationDao notDao)
          Constructs a NotificationServiceImpl class instance.
 
Method Summary
 void dismissNotificationMessageDelivery(Long id, String user, String cause)
          This method will "dismiss"/remove a NotificationMessageDelivery with the specified cause.
 void dismissNotificationMessageDelivery(NotificationMessageDelivery nmd, String user, String cause)
           
 Notification getNotification(Long id)
          This is the default implementation that uses the businessObjectDao.
 Collection getNotificationsForRecipientByType(String contentTypeName, String recipientId)
          This is the default implementation that uses the businessObjectDao and its findMatching method.
 NotificationResponse sendNotification(Notification notification)
          This method allows consumers to send notification messages.
 NotificationResponse sendNotification(String notificationMessageAsXml)
          This method is responsible for parsing out the notification message which is sent in as a String of XML.
 Collection<Notification> takeNotificationsForResolution()
          This method is responsible for atomically finding all untaken, unresolved notifications that are ready to be sent, marking them as taken and returning them to the caller for processing.
 void unlockNotification(Notification notification)
          Unlocks specified notification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationServiceImpl

public NotificationServiceImpl(GenericDao businessObjectDao,
                               NotificationMessageContentService messageContentService,
                               NotificationAuthorizationService notificationAuthorizationService,
                               NotificationRecipientService notificationRecipientService,
                               NotificationWorkflowDocumentService notificationWorkflowDocumentService,
                               NotificationMessageDeliveryService notificationMessageDeliveryService,
                               NotificationDao notDao)
Constructs a NotificationServiceImpl class instance.

Parameters:
businessObjectDao -
messageContentService -
notificationAuthorizationService -
notificationRecipientService -
notificationWorkflowDocumentService -
notificationMessageDeliveryService -
Method Detail

getNotification

public Notification getNotification(Long id)
This is the default implementation that uses the businessObjectDao.

Specified by:
getNotification in interface NotificationService
Returns:
Notification
See Also:
NotificationService.getNotification(java.lang.Long)

sendNotification

public NotificationResponse sendNotification(String notificationMessageAsXml)
                                      throws IOException,
                                             XmlException
This method is responsible for parsing out the notification message which is sent in as a String of XML. It calls the appropriate services to validate the message content, converts it to a BO, and then passes it to another service where its content and meta-data is validated and if successful, it is saved.

Specified by:
sendNotification in interface NotificationService
Returns:
NotificationResponse response object
Throws:
IOException
XmlException
See Also:
NotificationService.sendNotification(java.lang.String)

sendNotification

public NotificationResponse sendNotification(Notification notification)
Description copied from interface: NotificationService
This method allows consumers to send notification messages. This particular service accepts the actual business object.

Specified by:
sendNotification in interface NotificationService
Returns:
NotificationResponse
See Also:
NotificationService.sendNotification(org.kuali.rice.ken.bo.Notification)

getNotificationsForRecipientByType

public Collection getNotificationsForRecipientByType(String contentTypeName,
                                                     String recipientId)
This is the default implementation that uses the businessObjectDao and its findMatching method.

Specified by:
getNotificationsForRecipientByType in interface NotificationService
Parameters:
contentTypeName - the name of the content type
recipientId - the recipient id
Returns:
Collection of notifications
See Also:
NotificationService.getNotificationsForRecipientByType(java.lang.String, java.lang.String)

dismissNotificationMessageDelivery

public void dismissNotificationMessageDelivery(Long id,
                                               String user,
                                               String cause)
Description copied from interface: NotificationService
This method will "dismiss"/remove a NotificationMessageDelivery with the specified cause.

Specified by:
dismissNotificationMessageDelivery in interface NotificationService
Parameters:
id - the id of the NotificationMessageDelivery that was acted upon
user - the user or entity that performed the dismissal
cause - the cause of the dismissal (e.g. an end user action or auto-removal by the system)
See Also:
org.kuali.rice.ken.service.NotificationService#dismissNotificationMessageDelivery(java.lang.Long, java.lang.String)

dismissNotificationMessageDelivery

public void dismissNotificationMessageDelivery(NotificationMessageDelivery nmd,
                                               String user,
                                               String cause)
See Also:
org.kuali.rice.ken.service.NotificationService#dismissNotificationMessageDelivery(org.kuali.rice.ken.bo.NotificationMessageDelivery, java.lang.String, java.lang.String)

takeNotificationsForResolution

public Collection<Notification> takeNotificationsForResolution()
This method is responsible for atomically finding all untaken, unresolved notifications that are ready to be sent, marking them as taken and returning them to the caller for processing. NOTE: it is important that this method execute in a SEPARATE dedicated transaction; either the caller should NOT be wrapped by Spring declarative transaction and this service should be wrapped (which is the case), or the caller should arrange to invoke this from within a newly created transaction).

Specified by:
takeNotificationsForResolution in interface NotificationService
Returns:
a list of available notifications that have been marked as taken by the caller

unlockNotification

public void unlockNotification(Notification notification)
Unlocks specified notification

Specified by:
unlockNotification in interface NotificationService
Parameters:
notification - the notification object to unlock


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