Interface AlertEntityDao
- All Known Implementing Classes:
InMemoryAlertEntityDao
public interface AlertEntityDao
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteAll(AlertCriteria criteria) getById(long id) Retrieves an alert entity by the specified IDStores an alert.voidstreamAll(AlertCriteria criteria, RowCallback<AlertEntity> callback, PageRequest pageRequest) voidstreamByIds(Collection<Long> ids, RowCallback<AlertEntity> callback) voidstreamMetrics(AlertCriteria criteria, RowCallback<AlertMetric> callback, PageRequest pageRequest) Streamsalert metricsfor allalertsmatching the suppliedcriteriaordered by timestamp (descending) until the callbacksignalsthat it's done or all available metrics have been provided.voidstreamMinimalAlerts(AlertCriteria criteria, RowCallback<MinimalAlertEntity> callback, PageRequest pageRequest) Streamsminimal alertsmatching the suppliedcriteriaordered by timestamp (descending), then ID (descending) until the callbacksignalsthat it's done or until no more matching alerts are found.
-
Method Details
-
deleteAll
- Parameters:
criteria- to use when choosing which alerts to delete
-
findAllComponentIds
- Returns:
- all component IDs that any alert entity refers to
-
findAllIssueIds
- Returns:
- all issue IDs that any alert entity refers to, with the corresponding severity
-
findAllNodeNames
- Returns:
- all node names that any alert entity refers to
-
findAllPluginKeys
- Returns:
- all plugin keys that any alert entity refers to (including
DiagnosticsConstants.PLUGIN_NOT_DETECTED_KEY)
-
getById
Retrieves an alert entity by the specified ID- Parameters:
id- the alert ID- Returns:
- the matching entity, or
nullif no matching entity was found
-
save
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 allalertsmatching the suppliedcriteriaordered by timestamp (descending), then ID (descending) until the callbacksignalsthat it's done or until no more matching alerts are found.The
start offseton 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
startis specified on the page request.- Parameters:
criteria- request describing which alerts to retrievecallback- the callback to use when streaming matching alerts (including extras) from the data storepageRequest- request describing which page of results to return
-
streamByIds
Streams allalertsmatching the supplied IDs ordered by timestamp (descending), then ID (descending) until the callbacksignalsthat 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 thealertsto retrievecallback- 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) Streamsalert metricsfor allalertsmatching the suppliedcriteriaordered by timestamp (descending) until the callbacksignalsthat it's done or all available metrics have been provided.- Parameters:
criteria- the criteria to use when choosing which alerts to streamcallback- 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) Streamsminimal alertsmatching the suppliedcriteriaordered by timestamp (descending), then ID (descending) until the callbacksignalsthat it's done or until no more matching alerts are found.The
start offseton 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
startis specified on the page request.- Parameters:
criteria- request describing which alerts to retrievecallback- the callback to use when streaming matching alerts (including extras) from the data storepageRequest- request describing which page of results to return
-