Package org.kuali.rice.ken.service.impl
Class NotificationMessageDeliveryResolverServiceImpl
java.lang.Object
org.kuali.rice.ken.service.impl.ConcurrentJob<NotificationBo>
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
ConstructorsConstructorDescriptionNotificationMessageDeliveryResolverServiceImpl(NotificationService notificationService, NotificationRecipientService notificationRecipientService, DataObjectService dataObjectService, org.springframework.transaction.PlatformTransactionManager txManager, ExecutorService executor) Constructs a NotificationMessageDeliveryDispatchServiceImpl instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Object>processWorkItems(Collection<NotificationBo> notifications) Generates all message deliveries for a given notification and save thems to the database.This method is responsible for resolving the list of NotificationMessageDelivery records for a given notification.protected Collection<NotificationBo>Obtains and marks as taken all unresolved (and untaken) notificationsprotected voidunlockWorkItem(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
-
Constructor Details
-
NotificationMessageDeliveryResolverServiceImpl
public NotificationMessageDeliveryResolverServiceImpl(NotificationService notificationService, NotificationRecipientService notificationRecipientService, DataObjectService dataObjectService, org.springframework.transaction.PlatformTransactionManager txManager, ExecutorService executor) Constructs a NotificationMessageDeliveryDispatchServiceImpl instance.- Parameters:
notificationRecipientService-dataObjectService-txManager-executor-
-
-
Method Details
-
takeAvailableWorkItems
Obtains and marks as taken all unresolved (and untaken) notifications- Specified by:
takeAvailableWorkItemsin classConcurrentJob<NotificationBo>- Returns:
- a collection of available Notifications to process
-
processWorkItems
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:
processWorkItemsin classConcurrentJob<NotificationBo>- Parameters:
notifications- the Notification for which to generate message deliveries- Returns:
- a count of the number of message deliveries generated
-
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<NotificationBo>- Parameters:
notification- the work item to unlock- See Also:
-
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:
resolveNotificationMessageDeliveriesin interfaceNotificationMessageDeliveryResolverService- Returns:
- int the number of resolved messages
- See Also:
-