Package com.easydesk.notification
Class BatchNotificationManager
java.lang.Object
com.easydesk.notification.DefaultNotificationManager
com.easydesk.notification.BatchNotificationManager
- All Implemented Interfaces:
BatchManager,NotificationManager
- Direct Known Subclasses:
BatchNotificationByActivitySetManager
@Component("batchNotificationManager")
public class BatchNotificationManager
extends DefaultNotificationManager
implements BatchManager
Multi Target Batch Notification Manager 각 notify 수단에 대하여 모두 처리된다.
- Author:
- Youncho Cho
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Comparator<Identifiable<?>> DOCUMENT ME!protected static final intDOCUMENT ME!protected static final Comparator<NotificationStatus> DOCUMENT ME! -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbatch()모든 NotificationType 에 대하여 Notification 을 진행한다.protected voiddoSendByItem(Item item, EasyDeskUser receiver, Map<ActivitySetType, List<NotificationStatus>> groupedActivities, Set<EasyDeskUser> creators, AttributeOption managerOption, NotificationType type, Connection con) notification 을 보낸다.getActivites(Collection<NotificationStatus> statusList, Connection con) status list 에 대응하는 activiy list 를 구한다.protected static Map<Item, TreeSet<NotificationStatus>> getPendingItemMap(Collection<NotificationStatus> pending, Connection con) 각 item 별 NotificationStatus 집합을 구한다.static List<NotificationStatus> getPendingNotifications(Date date, NotificationType type, Integer managerId, Connection con) Returns the list of pending notifications (those with State=SCHEDULED)voidsendPendingNotifications(Date date, NotificationType type, AttributeOption option) protected voidupdateNotificationRepository(Collection<NotificationStatus> notifications, Exception exception, Connection con, Date date) Update the Notification status in the database.protected voidupdateNotificationRepository(Map<ActivitySetType, List<NotificationStatus>> groupedActivities, Exception exception, Connection con) Update the Notification status in the database.Methods inherited from class com.easydesk.notification.DefaultNotificationManager
getNotificationContext, getNotificator, getNotificator, notificate, notified, requestFinished
-
Field Details
-
NOTIFICATION_STATUS_COMPARATOR
DOCUMENT ME! -
BASE_OBJECT_COMPARATOR
DOCUMENT ME! -
DEFAULT_PERIOD
protected static final int DEFAULT_PERIODDOCUMENT ME!- See Also:
-
-
Constructor Details
-
BatchNotificationManager
public BatchNotificationManager()
-
-
Method Details
-
batch
public void batch()모든 NotificationType 에 대하여 Notification 을 진행한다.- Specified by:
batchin interfaceBatchManager
-
sendPendingNotifications
- Parameters:
date-type-option-
-
doSendByItem
protected void doSendByItem(Item item, EasyDeskUser receiver, Map<ActivitySetType, List<NotificationStatus>> groupedActivities, Set<EasyDeskUser> creators, AttributeOption managerOption, NotificationType type, Connection con) notification 을 보낸다.- Parameters:
item-receiver-groupedActivities-creators-managerOption-type-con-
-
updateNotificationRepository
protected void updateNotificationRepository(Map<ActivitySetType, List<NotificationStatus>> groupedActivities, Exception exception, Connection con) Update the Notification status in the database. If exception is supplied, this method assumes, an error has occured and sets he status to DEFERRED. Otherwise the E-Mail is considered to be delivered with success and the Notification status is set to SENT. This is done for ALL activities beeing reported to this user in this item.- Parameters:
groupedActivities-exception-con-
-
updateNotificationRepository
protected void updateNotificationRepository(Collection<NotificationStatus> notifications, Exception exception, Connection con, Date date) Update the Notification status in the database. If exception is supplied, this method assumes, an error has occured and sets he status to DEFERRED. Otherwise the E-Mail is considered to be delivered with success and the Notification status is set to SENT. This is done for ALL activities beeing reported to this user in this item.- Parameters:
notifications-exception- TODO : NotificationStatus 에 error field 를 추가했다. 이것을 사용한다.con-date- now
-
getPendingItemMap
protected static Map<Item,TreeSet<NotificationStatus>> getPendingItemMap(Collection<NotificationStatus> pending, Connection con) throws TorqueException 각 item 별 NotificationStatus 집합을 구한다.- Parameters:
pending- NotificationStatus list- Returns:
- { item , NotificatonStatus Set } map
- Throws:
TorqueException
-
getPendingNotifications
public static List<NotificationStatus> getPendingNotifications(Date date, NotificationType type, Integer managerId, Connection con) Returns the list of pending notifications (those with State=SCHEDULED)- Parameters:
date- upper timetype- notificationtypemanagerId-con-- Returns:
- scheduled status
-
getActivites
protected static List<Activity> getActivites(Collection<NotificationStatus> statusList, Connection con) throws TorqueException status list 에 대응하는 activiy list 를 구한다.- Parameters:
statusList-con-- Throws:
TorqueException
-