Package com.qfs.snl.alerts
Interface IAlertService
- All Superinterfaces:
IServiceWithListeners<IAlertListener>
- All Known Implementing Classes:
CacheAlertService
,DatabaseAlertService
The alert service.
- Author:
- ActiveViam
-
Method Summary
Modifier and TypeMethodDescriptionfind
(boolean activeOnly, Collection<Long> monitorIds, ITimePeriod timePeriod) Finds alerts with complex conditions.getAlert
(long id) Get the alert given by id.getAlerts
(boolean active) Gets all active alerts in the system.startAlert
(ISentinelAlert alert) Start an alert.startAlerts
(List<? extends ISentinelAlert> alerts) Starts a series of alerts.stopAlert
(long id) The alert to stop.stopAlerts
(List<? extends ISentinelAlert> alerts) Stops a series of alerts.stopMonitorAlerts
(String site, long monitorId) Stops all alerts belonging to a given monitor.updateAlert
(ISentinelAlert alert) Updates a single alert.updateAlerts
(List<? extends ISentinelAlert> alerts) Updates a series of alerts.Methods inherited from interface com.qfs.snl.utils.IServiceWithListeners
addListener, removeListener
-
Method Details
-
getAlerts
Gets all active alerts in the system.- Parameters:
active
- flag to fetch active alerts or stopped ones- Returns:
- list of alerts stored in the db
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
getAlert
Get the alert given by id.- Parameters:
id
- the alert id- Returns:
- the list of alerts.
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
find
Collection<ISentinelAlert> find(boolean activeOnly, Collection<Long> monitorIds, ITimePeriod timePeriod) Finds alerts with complex conditions.- Parameters:
activeOnly
- flag to only retrieve active alerts, false to retrieve allmonitorIds
- list of monitor ids to consider, null or empty to consider all monitorstimePeriod
- time period to consider It will apply boundaries on alerts, requiring that they either started or stopped in the period. From time is included in the window, to is excluded, i.e.from <= start|stop < to
.- Returns:
- alerts fulfilling all conditions
-
startAlert
Start an alert.- Parameters:
alert
- the alert to start- Returns:
- the started alert
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
startAlerts
Starts a series of alerts.- Parameters:
alerts
- alerts to start- Returns:
- storted alerts, in the same order as provided
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
updateAlert
Updates a single alert.So far, it is only possible to update 'content' attribute in an alert, as other information are managed by the system.
- Parameters:
alert
- alert to update- Returns:
- update value for the alert
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
updateAlerts
Updates a series of alerts.If one of the alerts fails to be udpdated, the whole operation is reverted.
- Parameters:
alerts
- alerts to update- Returns:
- results of the update, in the same order as provided
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
stopAlert
The alert to stop.- Parameters:
id
- the id of the alert to stop- Returns:
- the stopped alert
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
stopAlerts
Stops a series of alerts.- Parameters:
alerts
- alerts to stop- Returns:
- stopped alerts, in the same order as provided
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
stopMonitorAlerts
Stops all alerts belonging to a given monitor.- Parameters:
site
- monitor sitemonitorId
- monitor id- Returns:
- list of stopped alerts
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-