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

java.lang.Object
  extended by org.kuali.rice.ken.service.impl.ConcurrentJob<NotificationBo>
      extended by org.kuali.rice.ken.service.impl.NotificationMessageDeliveryResolverServiceImpl
All Implemented Interfaces:
NotificationMessageDeliveryResolverService

public class NotificationMessageDeliveryResolverServiceImpl
extends ConcurrentJob<NotificationBo>
implements NotificationMessageDeliveryResolverService

This is the default out-of-the-box implementation that leverages the status flag on a notification (RESOLVED versus UNRESOLVED) to determine whether the notification's message deliveries need to be resolved or not. This also looks at the start and auto remove dates and times.

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

Field Summary
 
Fields inherited from class org.kuali.rice.ken.service.impl.ConcurrentJob
executor, txManager
 
Constructor Summary
NotificationMessageDeliveryResolverServiceImpl(NotificationService notificationService, NotificationRecipientService notificationRecipientService, GenericDao businessObjectDao, org.springframework.transaction.PlatformTransactionManager txManager, ExecutorService executor, UserPreferenceService userPreferenceService)
          Constructs a NotificationMessageDeliveryDispatchServiceImpl instance.
 
Method Summary
protected  Collection<Object> processWorkItems(Collection<NotificationBo> notifications)
          Generates all message deliveries for a given notification and save thems to the database.
 ProcessingResult resolveNotificationMessageDeliveries()
          This method is responsible for resolving the list of NotificationMessageDelivery records for a given notification.
protected  Collection<NotificationBo> takeAvailableWorkItems()
          Obtains and marks as taken all unresolved (and untaken) notifications
protected  void unlockWorkItem(NotificationBo notification)
          Template method that subclasses should override to unlock a given work item when procesing has failed.
 
Methods inherited from class org.kuali.rice.ken.service.impl.ConcurrentJob
createNewTransaction, groupWorkItems, run, unlockWorkItemAtomically
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationMessageDeliveryResolverServiceImpl

public NotificationMessageDeliveryResolverServiceImpl(NotificationService notificationService,
                                                      NotificationRecipientService notificationRecipientService,
                                                      GenericDao businessObjectDao,
                                                      org.springframework.transaction.PlatformTransactionManager txManager,
                                                      ExecutorService executor,
                                                      UserPreferenceService userPreferenceService)
Constructs a NotificationMessageDeliveryDispatchServiceImpl instance.

Parameters:
notificationRecipientService -
businessObjectDao -
txManager -
executor -
userPreferenceService -
Method Detail

takeAvailableWorkItems

protected Collection<NotificationBo> takeAvailableWorkItems()
Obtains and marks as taken all unresolved (and untaken) notifications

Specified by:
takeAvailableWorkItems in class ConcurrentJob<NotificationBo>
Returns:
a collection of available Notifications to process

processWorkItems

protected Collection<Object> processWorkItems(Collection<NotificationBo> notifications)
Generates all message deliveries for a given notification and save thems to the database. Updates each Notification record to indicate it has been resolved. Should be performed within a separate transaction

Specified by:
processWorkItems in class ConcurrentJob<NotificationBo>
Parameters:
notification - the Notification for which to generate message deliveries
Returns:
a count of the number of message deliveries generated

unlockWorkItem

protected void unlockWorkItem(NotificationBo notification)
Description copied from class: ConcurrentJob
Template method that subclasses should override to unlock a given work item when procesing has failed.

Specified by:
unlockWorkItem in class ConcurrentJob<NotificationBo>
Parameters:
notification - the work item to unlock
See Also:
ConcurrentJob.unlockWorkItem(java.lang.Object)

resolveNotificationMessageDeliveries

public ProcessingResult resolveNotificationMessageDeliveries()
This method is responsible for resolving the list of NotificationMessageDelivery records for a given notification. This service will look at all notifications that are ready to be delivered and will "explode" out specific message delivery records for given delivery end points.

Specified by:
resolveNotificationMessageDeliveries in interface NotificationMessageDeliveryResolverService
Returns:
int the number of resolved messages
See Also:
NotificationMessageDeliveryResolverService.resolveNotificationMessageDeliveries()


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