Interface AlertRepository

All Known Subinterfaces:
InternalAlertRepository
All Known Implementing Classes:
DefaultAlertRepository

public interface AlertRepository
  • Method Details

    • addAlert

      void addAlert(Alert alert)
      Add the alert to the repository. The added alert will be set with an alert UID.
      Parameters:
      alert - the alert to add to the repository.
    • getAlertByAlertUid

      Alert getAlertByAlertUid(String alertUid)
      Get a specific alert by its Alert.getAlertUid()
      Parameters:
      alertUid - The alert unique identifier
      Returns:
      The alert matching this UID. null if not match was found.
    • getAlertsByGroupUid

      Alert[] getAlertsByGroupUid(String groupUid)
      Get an array of alerts matching a Alert.getGroupUid(). The alerts are ordered in a LIFO order. Last alert to arrive of the same group will be in index zero, first alert to arrive of the same group will be in index size -1.
      Parameters:
      groupUid - The group unique identifier
      Returns:
      The alerts belonging to this group UID. Zero-length array if no match was found.
    • iterateFifo

      Iterable<Alert> iterateFifo()
      An Iterator over the alerts in the repository from the first alert to arrive to the last.
      Returns:
      an iterator in a first-in (the group) and first-out (of iterator) order.
    • iterateLifo

      Iterable<Alert> iterateLifo()
      An Iterator over the alerts in the repository from the last alert to arrive to the first.
      Returns:
      an iterator in a last-in (the group) and first-out (of iterator) order.
    • list

      An Iterator of Iterators over the alerts in the repository, each iterator groups together alerts belonging to the same group UID. The list is ordered by sequence of alert events, first iterator is the last group to be have been updated. There may be more than one Iterator with the same group UID (this happens when a 'group' is resolved, and new alerts with the same group UID arrive at a later time).
      Returns:
      an iterator in a last-updated (per group) order.
    • size

      int size()
      The number of Alerts stored in this alert repository.
      Returns:
      the size of the repository.