Interface AlertRepository
- All Known Subinterfaces:
InternalAlertRepository
- All Known Implementing Classes:
DefaultAlertRepository
public interface AlertRepository
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the alert to the repository.getAlertByAlertUid(String alertUid) Get a specific alert by itsAlert.getAlertUid()Alert[]getAlertsByGroupUid(String groupUid) Get an array of alerts matching aAlert.getGroupUid().An Iterator over the alerts in the repository from the first alert to arrive to the last.An Iterator over the alerts in the repository from the last alert to arrive to the first.list()An Iterator of Iterators over the alerts in the repository, each iterator groups together alerts belonging to the same group UID.intsize()The number of Alerts stored in this alert repository.
-
Method Details
-
addAlert
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
Get a specific alert by itsAlert.getAlertUid()- Parameters:
alertUid- The alert unique identifier- Returns:
- The alert matching this UID.
nullif not match was found.
-
getAlertsByGroupUid
Get an array of alerts matching aAlert.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
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
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.
-