Package org.kuali.rice.ken.service.impl
Class NotificationMessageDeliveryAutoRemovalServiceImpl
java.lang.Object
org.kuali.rice.ken.service.impl.ConcurrentJob<NotificationMessageDelivery>
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
ConstructorsConstructorDescriptionNotificationMessageDeliveryAutoRemovalServiceImpl(DataObjectService dataObjectService, org.springframework.transaction.PlatformTransactionManager txManager, ExecutorService executor, NotificationMessageDeliveryService messageDeliveryService) Constructs a NotificationMessageDeliveryDispatchServiceImpl instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String> autoRemove(NotificationMessageDeliverer messageDeliverer, NotificationMessageDelivery messageDelivery) Auto-removes a single message deliveryprotected voidmarkAutoRemoved(NotificationMessageDelivery messageDelivery) Marks a MessageDelivery as having been auto-removed, and unlocks itThis implementation looks up all UNDELIVERED/DELIVERED message deliveries with an autoRemoveDateTime invalid input: '<'= 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 afterwardsprotected Collection<NotificationMessageDelivery> Template method that subclasses should override to obtain a set of available work items and mark them as takenprotected voidunlockWorkItem(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
-
Constructor Details
-
NotificationMessageDeliveryAutoRemovalServiceImpl
public NotificationMessageDeliveryAutoRemovalServiceImpl(DataObjectService dataObjectService, org.springframework.transaction.PlatformTransactionManager txManager, ExecutorService executor, NotificationMessageDeliveryService messageDeliveryService) Constructs a NotificationMessageDeliveryDispatchServiceImpl instance.- Parameters:
dataObjectService- service persists data to datasourcetxManager-executor-messageDeliveryService-
-
-
Method Details
-
takeAvailableWorkItems
Description copied from class:ConcurrentJobTemplate method that subclasses should override to obtain a set of available work items and mark them as taken- Specified by:
takeAvailableWorkItemsin classConcurrentJob<NotificationMessageDelivery>- Returns:
- a collection of available work items that have been marked as taken
- See Also:
-
processWorkItems
protected Collection<String> processWorkItems(Collection<NotificationMessageDelivery> messageDeliveries) Description copied from class:ConcurrentJobTemplate method that subclasses should override to process a given work item and mark it as untaken afterwards- Specified by:
processWorkItemsin classConcurrentJob<NotificationMessageDelivery>- Parameters:
messageDeliveries- the work item- Returns:
- a collection of success messages
- See Also:
-
autoRemove
protected Collection<String> autoRemove(NotificationMessageDeliverer messageDeliverer, NotificationMessageDelivery messageDelivery) Auto-removes a single message delivery- Parameters:
messageDeliverer- the message deliverermessageDelivery- the message delivery to auto-remove- Returns:
- collection of strings indicating successful auto-removals
-
markAutoRemoved
Marks a MessageDelivery as having been auto-removed, and unlocks it- Parameters:
messageDelivery- the messageDelivery instance to mark
-
unlockWorkItem
Description copied from class:ConcurrentJobTemplate method that subclasses should override to unlock a given work item when procesing has failed.- Specified by:
unlockWorkItemin classConcurrentJob<NotificationMessageDelivery>- Parameters:
delivery- the work item to unlock- See Also:
-
processAutoRemovalOfDeliveredNotificationMessageDeliveries
This implementation looks up all UNDELIVERED/DELIVERED message deliveries with an autoRemoveDateTime invalid input: '<'= 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:
processAutoRemovalOfDeliveredNotificationMessageDeliveriesin interfaceNotificationMessageDeliveryAutoRemovalService- See Also:
-