org.modeshape.jcr.api.monitor

## Interface RepositoryMonitor

- All Known Implementing Classes:
    JcrRepositoryMonitor, RepositoryStatistics

      public interface RepositoryMonitor

  A thread-safe component that provides histories and statistics on a variety of metrics.
  Since:
    3.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Set<DurationMetric>` | `ALL_DURATION_METRICS`
    `static Set<ValueMetric>` | `ALL_VALUE_METRICS`
    `static Set<Window>` | `ALL_WINDOWS`
    `static RepositoryMonitor` | `EMPTY_MONITOR` A monitor without history.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<DurationMetric>` | `getAvailableDurationMetrics()` Get the DurationMetric enumerations that are available for use by the caller with `getHistory(DurationMetric, Window)`.
    `Set<ValueMetric>` | `getAvailableValueMetrics()` Get the ValueMetric enumerations that are available for use by the caller with `getHistory(ValueMetric, Window)`.
    `Set<Window>` | `getAvailableWindows()` Get the Window enumerations that are available for use by the caller with `getHistory(DurationMetric, Window)` and `getHistory(ValueMetric, Window)`.
    `History` | `getHistory(DurationMetric metric, Window windowInTime)` Get the statics for the specified duration metric during the given window in time.
    `History` | `getHistory(ValueMetric metric, Window windowInTime)` Get the statics for the specified value metric during the given window in time.
    `DurationActivity[]` | `getLongestRunning(DurationMetric metric)` Get the longest-running activities recorded for the specified metric.

- - ### Field Detail

    - #### ALL_DURATION_METRICS

          static final Set<DurationMetric> ALL_DURATION_METRICS

    - #### ALL_VALUE_METRICS

          static final Set<ValueMetric> ALL_VALUE_METRICS

    - #### ALL_WINDOWS

          static final Set<Window> ALL_WINDOWS

    - #### EMPTY_MONITOR

          static final RepositoryMonitor EMPTY_MONITOR

      A monitor without history.

  - ### Method Detail

    - #### getAvailableValueMetrics

          Set<ValueMetric> getAvailableValueMetrics()

      Get the ValueMetric enumerations that are available for use by the caller with `getHistory(ValueMetric, Window)`.
      Returns:
        the immutable set of ValueMetric instances; never null but possibly empty if the caller has no permissions to see any value metrics
      See Also:
        `getHistory(ValueMetric, Window)`

    - #### getAvailableDurationMetrics

          Set<DurationMetric> getAvailableDurationMetrics()

      Get the DurationMetric enumerations that are available for use by the caller with `getHistory(DurationMetric, Window)`.
      Returns:
        the immutable set of DurationMetric instances; never null but possibly empty if the caller has no permissions to see any duration metrics
      See Also:
        `getHistory(DurationMetric, Window)`, `getLongestRunning(DurationMetric)`

    - #### getAvailableWindows

          Set<Window> getAvailableWindows()

      Get the Window enumerations that are available for use by the caller with `getHistory(DurationMetric, Window)` and `getHistory(ValueMetric, Window)`.
      Returns:
        the immutable set of DurationMetric instances; never null but possibly empty if the caller has no permissions to see any windows
      See Also:
        `getHistory(DurationMetric, Window)`, `getHistory(ValueMetric, Window)`

    - #### getHistory

          History getHistory(ValueMetric metric,
                           Window windowInTime)
                             throws AccessDeniedException,
                                    RepositoryException

      Get the statics for the specified value metric during the given window in time. The oldest statistics will be first, while the newest statistics will be last.
      Parameters:
        `metric` - the value metric; may not be null
        `windowInTime` - the window specifying which statistics are to be returned; may not be null
      Returns:
        the history of the metrics; never null but possibly empty if there are no statistics being captures for this repository
      Throws:
        `AccessDeniedException` - if the session does not have privileges to monitor the repository
        `RepositoryException` - if there is an error obtaining the history
      See Also:
        `getAvailableValueMetrics()`, `getAvailableWindows()`

    - #### getHistory

          History getHistory(DurationMetric metric,
                           Window windowInTime)
                             throws AccessDeniedException,
                                    RepositoryException

      Get the statics for the specified duration metric during the given window in time. The oldest statistics will be first, while the newest statistics will be last.
      Parameters:
        `metric` - the duration metric; may not be null
        `windowInTime` - the window specifying which statistics are to be returned; may not be null
      Returns:
        the history of the metrics; never null but possibly empty if there are no statistics being captures for this repository
      Throws:
        `AccessDeniedException` - if the session does not have privileges to monitor the repository
        `RepositoryException` - if there is an error obtaining the history
      See Also:
        `getAvailableDurationMetrics()`, `getAvailableWindows()`

    - #### getLongestRunning

          DurationActivity[] getLongestRunning(DurationMetric metric)
                                               throws AccessDeniedException,
                                                      RepositoryException

      Get the longest-running activities recorded for the specified metric. The results contain the duration records in order of increasing duration, with the activity with the longest duration appearing last in the array.
      Parameters:
        `metric` - the duration metric; may not be null
      Returns:
        the activities with the longest durations; never null but possibly empty if no such activities were performed
      Throws:
        `AccessDeniedException` - if the session does not have privileges to monitor the repository
        `RepositoryException` - if there is an error obtaining the history
      See Also:
        `getAvailableDurationMetrics()`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.