Package com.atlassian.diagnostics
Interface MonitoringService
public interface MonitoringService
-
Method Summary
Modifier and TypeMethodDescriptioncreateMonitor(String componentId, String componentNameI18nKey) Deprecated.createMonitor(String componentId, String componentNameI18nKey, MonitorConfiguration monitorConfiguration) Creates a new monitor for a component with the provided ID and name, or returns the existing monitor if it has already been created.booleandestroyMonitor(String componentId) Destroys the monitor.getMonitor(String componentId) boolean<T> TstreamAlertCounts(AlertCriteria criteria, PageCallback<? super AlertCount, T> callback, PageRequest pageRequest) <T> TstreamAlerts(AlertCriteria criteria, PageCallback<? super Alert, T> callback, PageRequest pageRequest) <T> TstreamAlertsWithElisions(AlertCriteria criteria, PageCallback<? super AlertWithElisions, T> callback, PageRequest pageRequest) subscribe(AlertListener listener) Subscribes the providedlistenerto all alertsbooleanunsubscribe(String subscriptionId) Unsubscribes theAlertListenerthat had previouslysubscribed.
-
Method Details
-
createMonitor
@Deprecated @Nonnull ComponentMonitor createMonitor(@Nonnull String componentId, @Nonnull String componentNameI18nKey) Deprecated.Creates a new monitor for a component with the provided ID and name, or returns the existing monitor if it has already been created.- Parameters:
componentId- thecomponent IDcomponentNameI18nKey- the i18n key of the component name- Returns:
- the monitor for the component with ID
componentId
-
createMonitor
@Nonnull ComponentMonitor createMonitor(@Nonnull String componentId, @Nonnull String componentNameI18nKey, @Nonnull MonitorConfiguration monitorConfiguration) Creates a new monitor for a component with the provided ID and name, or returns the existing monitor if it has already been created.- Parameters:
componentId- thecomponent IDcomponentNameI18nKey- the i18n key of the component name- Returns:
- the monitor for the component with ID
componentId
-
destroyMonitor
Destroys the monitor.- Parameters:
componentId- thecomponent ID- Returns:
- true if the monitor was found and destroyed and false if the monitor was not found
- Since:
- 1.1
-
findAllComponents
- Returns:
- a set of all
componentsthat are currently defined in the system or are no longer defined, but for which alerts have been detected recently (30 days by default)
-
findAllIssues
- Returns:
- a set of all
issuesthat are currently defined in the system or are no longer defined, but for which alerts have been detected recently (30 days by default)
-
findAllNodesWithAlerts
- Returns:
- all nodes for which alerts have been detected recently (30 days by default)
-
findAllPluginsWithAlerts
- Returns:
- all
pluginsfor which alerts have been detected recently (30 days by default)
-
getMonitor
- Parameters:
componentId- thecomponent ID- Returns:
- the monitor for the component with ID
componentId, or empty if no such monitor has been created
-
isEnabled
boolean isEnabled()- Returns:
trueif the monitoring feature is enabled, otherwisefalse
-
subscribe
Subscribes the providedlistenerto all alerts- Parameters:
listener- the listener- Returns:
- the subscription ID to be used in
unsubscribe(java.lang.String)
-
streamAlerts
<T> T streamAlerts(@Nonnull AlertCriteria criteria, @Nonnull PageCallback<? super Alert, T> callback, @Nonnull PageRequest pageRequest) - Parameters:
criteria- describes which alerts to retrievecallback- the callback to send the retrieved alerts topageRequest- specifies page limits- Returns:
- the callback result
-
streamAlertCounts
<T> T streamAlertCounts(@Nonnull AlertCriteria criteria, @Nonnull PageCallback<? super AlertCount, T> callback, @Nonnull PageRequest pageRequest) -
streamAlertsWithElisions
<T> T streamAlertsWithElisions(@Nonnull AlertCriteria criteria, @Nonnull PageCallback<? super AlertWithElisions, T> callback, @Nonnull PageRequest pageRequest) - Parameters:
criteria- describes which alerts to retrievecallback- the callback to send the retrieved alerts topageRequest- specifies page limits- Returns:
- the callback result
-
unsubscribe
Unsubscribes theAlertListenerthat had previouslysubscribed.- Parameters:
subscriptionId- the subscription ID returned bysubscribe(com.atlassian.diagnostics.AlertListener)- Returns:
trueif the listener was unsubscribed,falseif no subscription was found forsubscriptionId
-
createMonitor(String, String, MonitorConfiguration)