public class DefaultAlertRepository extends Object implements InternalAlertRepository
Modifier and Type | Class and Description |
---|---|
static class |
DefaultAlertRepository.AlertGroup |
Constructor and Description |
---|
DefaultAlertRepository() |
Modifier and Type | Method and Description |
---|---|
void |
addAlert(Alert alert)
Add the alert to the repository.
|
Alert |
getAlertByAlertUid(String alertUid)
Get a specific alert by its
Alert.getAlertUid() |
Alert[] |
getAlertsByGroupUid(String groupUid)
Get an array of alerts matching a
Alert.getGroupUid() . |
Iterable<Alert> |
iterateFifo()
An Iterator over the alerts in the repository from the first alert to arrive to the last.
|
Iterable<Alert> |
iterateLifo()
An Iterator over the alerts in the repository from the last alert to arrive to the first.
|
Iterable<Iterable<Alert>> |
list()
An Iterator of Iterators over the alerts in the repository, each iterator groups together
alerts belonging to the same group UID.
|
void |
setStoreLimit(int limit)
The alert repository storage limit for alerts which are unresolved.
|
int |
size()
The number of Alerts stored in this alert repository.
|
public void setStoreLimit(int limit)
InternalAlertRepository
setStoreLimit
in interface InternalAlertRepository
limit
- a limit, default is 200;public void addAlert(Alert alert)
AlertRepository
addAlert
in interface AlertRepository
alert
- the alert to add to the repository.public Alert getAlertByAlertUid(String alertUid)
AlertRepository
Alert.getAlertUid()
getAlertByAlertUid
in interface AlertRepository
alertUid
- The alert unique identifiernull
if not match was found.public Alert[] getAlertsByGroupUid(String groupUid)
AlertRepository
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.getAlertsByGroupUid
in interface AlertRepository
groupUid
- The group unique identifierpublic Iterable<Alert> iterateFifo()
AlertRepository
iterateFifo
in interface AlertRepository
public Iterable<Alert> iterateLifo()
AlertRepository
iterateLifo
in interface AlertRepository
public Iterable<Iterable<Alert>> list()
AlertRepository
list
in interface AlertRepository
public int size()
AlertRepository
size
in interface AlertRepository
Copyright © GigaSpaces.