Interface AlertEntityDao

All Known Implementing Classes:
InMemoryAlertEntityDao

public interface AlertEntityDao
  • Method Details

    • deleteAll

      void deleteAll(@Nonnull AlertCriteria criteria)
      Deletes all alerts matching the supplied criteria.
      Parameters:
      criteria - to use when choosing which alerts to delete
    • findAllComponentIds

      Set<String> findAllComponentIds()
      Returns:
      all component IDs that any alert entity refers to
    • findAllIssueIds

      Map<String,Severity> findAllIssueIds()
      Returns:
      all issue IDs that any alert entity refers to, with the corresponding severity
    • findAllNodeNames

      Set<String> findAllNodeNames()
      Returns:
      all node names that any alert entity refers to
    • findAllPluginKeys

      Set<String> findAllPluginKeys()
      Returns:
      all plugin keys that any alert entity refers to (including DiagnosticsConstants.PLUGIN_NOT_DETECTED_KEY)
    • getById

      @Nullable AlertEntity getById(long id)
      Retrieves an alert entity by the specified ID
      Parameters:
      id - the alert ID
      Returns:
      the matching entity, or null if no matching entity was found
    • save

      @Nonnull AlertEntity save(@Nonnull Alert alert)
      Stores an alert. This should only be used to store newly-created alerts. Supplying an already stored alert will yield undefined results but most likely will result in persisting a duplicate.
      Parameters:
      alert - the alert to store
      Returns:
      the persisted alert entity
    • streamAll

      void streamAll(@Nonnull AlertCriteria criteria, @Nonnull RowCallback<AlertEntity> callback, @Nonnull PageRequest pageRequest)
      Streams all alerts matching the supplied criteria ordered by timestamp (descending), then ID (descending) until the callback signals that it's done or until no more matching alerts are found.

      The start offset on the page request refers to the row at which the requested page starts.

      For pagination purposes, implementations must attempt to retrieve one extra item following the page of data if an start is specified on the page request.

      Parameters:
      criteria - request describing which alerts to retrieve
      callback - the callback to use when streaming matching alerts (including extras) from the data store
      pageRequest - request describing which page of results to return
    • streamByIds

      void streamByIds(@Nonnull Collection<Long> ids, @Nonnull RowCallback<AlertEntity> callback)
      Streams all alerts matching the supplied IDs ordered by timestamp (descending), then ID (descending) until the callback signals that it's done or until no more matching alerts are found.

      If a requested ID is not found, no error should be returned.

      Parameters:
      ids - the IDs of the alerts to retrieve
      callback - the callback to use when streaming matching alerts from the data store
    • streamMetrics

      void streamMetrics(@Nonnull AlertCriteria criteria, @Nonnull RowCallback<AlertMetric> callback, @Nonnull PageRequest pageRequest)
      Streams alert metrics for all alerts matching the supplied criteria ordered by timestamp (descending) until the callback signals that it's done or all available metrics have been provided.
      Parameters:
      criteria - the criteria to use when choosing which alerts to stream
      callback - the callback to use when streaming matching alerts from the data store
    • streamMinimalAlerts

      void streamMinimalAlerts(@Nonnull AlertCriteria criteria, @Nonnull RowCallback<MinimalAlertEntity> callback, @Nonnull PageRequest pageRequest)
      Streams minimal alerts matching the supplied criteria ordered by timestamp (descending), then ID (descending) until the callback signals that it's done or until no more matching alerts are found.

      The start offset on the page request refers to the row at which the requested page starts.

      For pagination purposes, implementations must attempt to retrieve one extra item following the page of data if an start is specified on the page request.

      Parameters:
      criteria - request describing which alerts to retrieve
      callback - the callback to use when streaming matching alerts (including extras) from the data store
      pageRequest - request describing which page of results to return