Class DefaultAlertRepository

java.lang.Object
org.openspaces.admin.internal.alert.DefaultAlertRepository
All Implemented Interfaces:
AlertRepository, InternalAlertRepository

public class DefaultAlertRepository extends Object implements InternalAlertRepository
  • Constructor Details

    • DefaultAlertRepository

      public DefaultAlertRepository()
  • Method Details

    • setStoreLimit

      public void setStoreLimit(int limit)
      Description copied from interface: InternalAlertRepository
      The alert repository storage limit for alerts which are unresolved.
      Specified by:
      setStoreLimit in interface InternalAlertRepository
      Parameters:
      limit - a limit, default is 200;
    • addAlert

      public void addAlert(Alert alert)
      Description copied from interface: AlertRepository
      Add the alert to the repository. The added alert will be set with an alert UID.
      Specified by:
      addAlert in interface AlertRepository
      Parameters:
      alert - the alert to add to the repository.
    • getAlertByAlertUid

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

      public Alert[] getAlertsByGroupUid(String groupUid)
      Description copied from interface: AlertRepository
      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.
      Specified by:
      getAlertsByGroupUid in interface AlertRepository
      Parameters:
      groupUid - The group unique identifier
      Returns:
      The alerts belonging to this group UID. Zero-length array if no match was found.
    • iterateFifo

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

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

      public Iterable<Iterable<Alert>> list()
      Description copied from interface: AlertRepository
      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).
      Specified by:
      list in interface AlertRepository
      Returns:
      an iterator in a last-updated (per group) order.
    • size

      public int size()
      Description copied from interface: AlertRepository
      The number of Alerts stored in this alert repository.
      Specified by:
      size in interface AlertRepository
      Returns:
      the size of the repository.