Interface MonitoringService


public interface MonitoringService
  • Method Details

    • createMonitor

      @Deprecated @Nonnull ComponentMonitor createMonitor(@Nonnull String componentId, @Nonnull String componentNameI18nKey)
      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 - the component ID
      componentNameI18nKey - 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 - the component ID
      componentNameI18nKey - the i18n key of the component name
      Returns:
      the monitor for the component with ID componentId
    • destroyMonitor

      boolean destroyMonitor(@Nonnull String componentId)
      Destroys the monitor.
      Parameters:
      componentId - the component ID
      Returns:
      true if the monitor was found and destroyed and false if the monitor was not found
      Since:
      1.1
    • findAllComponents

      @Nonnull Set<Component> findAllComponents()
      Returns:
      a set of all components that are currently defined in the system or are no longer defined, but for which alerts have been detected recently (30 days by default)
    • findAllIssues

      @Nonnull Set<Issue> findAllIssues()
      Returns:
      a set of all issues that are currently defined in the system or are no longer defined, but for which alerts have been detected recently (30 days by default)
    • findAllNodesWithAlerts

      @Nonnull Set<String> findAllNodesWithAlerts()
      Returns:
      all nodes for which alerts have been detected recently (30 days by default)
    • findAllPluginsWithAlerts

      @Nonnull Set<PluginDetails> findAllPluginsWithAlerts()
      Returns:
      all plugins for which alerts have been detected recently (30 days by default)
    • getMonitor

      @Nonnull Optional<ComponentMonitor> getMonitor(@Nonnull String componentId)
      Parameters:
      componentId - the component ID
      Returns:
      the monitor for the component with ID componentId, or empty if no such monitor has been created
    • isEnabled

      boolean isEnabled()
      Returns:
      true if the monitoring feature is enabled, otherwise false
    • subscribe

      @Nonnull String subscribe(@Nonnull AlertListener listener)
      Subscribes the provided listener to 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 retrieve
      callback - the callback to send the retrieved alerts to
      pageRequest - 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 retrieve
      callback - the callback to send the retrieved alerts to
      pageRequest - specifies page limits
      Returns:
      the callback result
    • unsubscribe

      boolean unsubscribe(@Nonnull String subscriptionId)
      Unsubscribes the AlertListener that had previously subscribed.
      Parameters:
      subscriptionId - the subscription ID returned by subscribe(com.atlassian.diagnostics.AlertListener)
      Returns:
      true if the listener was unsubscribed, false if no subscription was found for subscriptionId