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

java.lang.Object
  extended by org.kuali.rice.ken.service.impl.ConcurrentJob<NotificationMessageDelivery>
      extended by org.kuali.rice.ken.service.impl.NotificationMessageDeliveryAutoRemovalServiceImpl
All Implemented Interfaces:
NotificationMessageDeliveryAutoRemovalService

public class NotificationMessageDeliveryAutoRemovalServiceImpl
extends ConcurrentJob<NotificationMessageDelivery>
implements NotificationMessageDeliveryAutoRemovalService

Auto removes expired message deliveries.

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

Field Summary
 
Fields inherited from class org.kuali.rice.ken.service.impl.ConcurrentJob
executor, LOG, txManager
 
Constructor Summary
NotificationMessageDeliveryAutoRemovalServiceImpl(GenericDao businessObjectDao, org.springframework.transaction.PlatformTransactionManager txManager, ExecutorService executor, NotificationMessageDeliveryService messageDeliveryService)
          Constructs a NotificationMessageDeliveryDispatchServiceImpl instance.
 
Method Summary
protected  Collection<String> autoRemove(NotificationMessageDeliverer messageDeliverer, NotificationMessageDelivery messageDelivery)
          Auto-removes a single message delivery
protected  void markAutoRemoved(NotificationMessageDelivery messageDelivery)
          Marks a MessageDelivery as having been auto-removed, and unlocks it
 ProcessingResult processAutoRemovalOfDeliveredNotificationMessageDeliveries()
          This implementation looks up all UNDELIVERED/DELIVERED message deliveries with an autoRemoveDateTime <= current date time and then iterates over each to call the appropriate functions to do the "auto-removal" by "canceling" each associated notification workflow document.
protected  Collection<String> processWorkItems(Collection<NotificationMessageDelivery> messageDeliveries)
          Template method that subclasses should override to process a given work item and mark it as untaken afterwards
protected  Collection<NotificationMessageDelivery> takeAvailableWorkItems()
          Template method that subclasses should override to obtain a set of available work items and mark them as taken
protected  void unlockWorkItem(NotificationMessageDelivery delivery)
          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

NotificationMessageDeliveryAutoRemovalServiceImpl

public NotificationMessageDeliveryAutoRemovalServiceImpl(GenericDao businessObjectDao,
                                                         org.springframework.transaction.PlatformTransactionManager txManager,
                                                         ExecutorService executor,
                                                         NotificationMessageDeliveryService messageDeliveryService)
Constructs a NotificationMessageDeliveryDispatchServiceImpl instance.

Parameters:
businessObjectDao -
txManager -
executor -
messageDeliveryRegistryService -
Method Detail

takeAvailableWorkItems

protected Collection<NotificationMessageDelivery> takeAvailableWorkItems()
Description copied from class: ConcurrentJob
Template method that subclasses should override to obtain a set of available work items and mark them as taken

Specified by:
takeAvailableWorkItems in class ConcurrentJob<NotificationMessageDelivery>
Returns:
a collection of available work items that have been marked as taken
See Also:
ConcurrentJob.takeAvailableWorkItems()

processWorkItems

protected Collection<String> processWorkItems(Collection<NotificationMessageDelivery> messageDeliveries)
Description copied from class: ConcurrentJob
Template method that subclasses should override to process a given work item and mark it as untaken afterwards

Specified by:
processWorkItems in class ConcurrentJob<NotificationMessageDelivery>
Parameters:
messageDeliveries - the work item
Returns:
a collection of success messages
See Also:
org.kuali.rice.ken.service.impl.ConcurrentJob#processWorkItem(java.lang.Object)

autoRemove

protected Collection<String> autoRemove(NotificationMessageDeliverer messageDeliverer,
                                        NotificationMessageDelivery messageDelivery)
Auto-removes a single message delivery

Parameters:
messageDeliverer - the message deliverer
messageDelivery - the message delivery to auto-remove
Returns:
collection of strings indicating successful auto-removals

markAutoRemoved

protected void markAutoRemoved(NotificationMessageDelivery messageDelivery)
Marks a MessageDelivery as having been auto-removed, and unlocks it

Parameters:
messageDelivery - the messageDelivery instance to mark

unlockWorkItem

protected void unlockWorkItem(NotificationMessageDelivery delivery)
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<NotificationMessageDelivery>
Parameters:
delivery - the work item to unlock
See Also:
ConcurrentJob.unlockWorkItem(java.lang.Object)

processAutoRemovalOfDeliveredNotificationMessageDeliveries

public ProcessingResult processAutoRemovalOfDeliveredNotificationMessageDeliveries()
This implementation looks up all UNDELIVERED/DELIVERED message deliveries with an autoRemoveDateTime <= current date time and then iterates over each to call the appropriate functions to do the "auto-removal" by "canceling" each associated notification workflow document.

Specified by:
processAutoRemovalOfDeliveredNotificationMessageDeliveries in interface NotificationMessageDeliveryAutoRemovalService
See Also:
org.kuali.rice.ken.service.NotificationMessageDeliveryDispatchService#processAutoRemovalOfDeliveredNotificationMessageDeliveries()


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