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 Details

  • Constructor Details

    • BatchNotificationManager

      public BatchNotificationManager()
  • Method Details

    • batch

      public void batch()
      모든 NotificationType 에 대하여 Notification 을 진행한다.
      Specified by:
      batch in interface BatchManager
    • sendPendingNotifications

      public void sendPendingNotifications(Date date, NotificationType type, AttributeOption option)
      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 time
      type - notificationtype
      managerId -
      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