Interface NotificationIndex

All Superinterfaces:
Configurable
All Known Implementing Classes:
JDBCNotificationIndex, JsonNotificationIndex

public interface NotificationIndex extends Configurable
Stores and retrieves Notifications. This is typically used by a NotificationReceiver to track its Notifications, but may also be used by NotificationListeners. Each object should maintain a separate NotificationIndex.
  • Method Details

    • addNotification

      void addNotification(Notification notification) throws Exception
      Add a notification to the index. If an identical notification is already in the index, the implementation may choose whether or not to store the duplicate information.
      Parameters:
      notification - the notification to add.
      Throws:
      Exception - if an error occurs while storing the notification.
    • removeNotification

      void removeNotification(Notification notification) throws Exception
      Remove a notification from the index. All matching notifications should be removed from the index.
      Parameters:
      notification - the notification to remove.
      Throws:
      Exception - if an error occurs while removing the notification.
    • removeNotifications

      void removeNotifications(List<Notification> notifications) throws Exception
      Remove notifications from index.
      Parameters:
      notifications - notifications to be removed from index
      Throws:
      Exception - if error occurs
    • findNotifications

      List<Notification> findNotifications(ProductId id) throws Exception
      Search the index for notifications matching id. If more than one notification matches, all should be returned.
      Parameters:
      id - the ProductId to find.
      Returns:
      a list of matching notifications.
      Throws:
      Exception - if an error occurs while searching the index.
    • findNotifications

      List<Notification> findNotifications(String source, String type, String code) throws Exception
      Search the index for notifications matching the sources, types, and codes. Only one notification for each unique ProductId (source+type+code+updateTime) should be returned. If sources, types, and/or codes are null, that parameter should be considered a wildcard. If sources, types, and codes are all null, a notification for each unique ProductId in the index should be returned.
      Parameters:
      source - sources to include, or all if null.
      type - types to include, or all if null.
      code - codes to include, or all if null.
      Returns:
      a list of matching notifications.
      Throws:
      Exception - if an error occurs while searching the index.
    • findNotifications

      List<Notification> findNotifications(List<String> sources, List<String> types, List<String> codes) throws Exception
      Search the index for notifications matching the sources, types, and codes. Only one notification for each unique ProductId (source+type+code+updateTime) should be returned. If sources, types, and/or codes are null, that parameter should be considered a wildcard. If sources, types, and codes are all null, a notification for each unique ProductId in the index should be returned.
      Parameters:
      sources - sources to include, or all if null.
      types - types to include, or all if null.
      codes - codes to include, or all if null.
      Returns:
      a list of matching notifications.
      Throws:
      Exception - if an error occurs while searching the index.
    • findExpiredNotifications

      List<Notification> findExpiredNotifications() throws Exception
      Search the index for expired notifications. All expired notifications, even if duplicate, should be returned.
      Returns:
      a list of expired notifications.
      Throws:
      Exception - if an error occurs while searching the index.