Interface IAlertService

All Superinterfaces:
IServiceWithListeners<IAlertListener>
All Known Implementing Classes:
CacheAlertService, DatabaseAlertService

public interface IAlertService extends IServiceWithListeners<IAlertListener>
The alert service.
Author:
ActiveViam
  • Method Details Link icon

    • getAlerts Link icon

      Collection<ISentinelAlert> getAlerts(boolean active) throws ServiceException
      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 Link icon

      ISentinelAlert getAlert(long id) throws ServiceException
      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 Link icon

      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 all
      monitorIds - list of monitor ids to consider, null or empty to consider all monitors
      timePeriod - 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 Link icon

      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 Link icon

      List<ISentinelAlert> startAlerts(List<? extends ISentinelAlert> alerts) throws ServiceException
      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 Link icon

      ISentinelAlert updateAlert(ISentinelAlert alert) throws ServiceException
      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 Link icon

      List<ISentinelAlert> updateAlerts(List<? extends ISentinelAlert> alerts) throws ServiceException
      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 Link icon

      ISentinelAlert stopAlert(long id) throws ServiceException
      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 Link icon

      List<ISentinelAlert> stopAlerts(List<? extends ISentinelAlert> alerts) throws ServiceException
      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 Link icon

      List<ISentinelAlert> stopMonitorAlerts(String site, long monitorId) throws ServiceException
      Stops all alerts belonging to a given monitor.
      Parameters:
      site - monitor site
      monitorId - 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.