ModeShape Distribution 3.0.0.Beta4

org.modeshape.jcr
Class JcrRepositoryMonitor

java.lang.Object
  extended by org.modeshape.jcr.JcrRepositoryMonitor
All Implemented Interfaces:
RepositoryMonitor

public class JcrRepositoryMonitor
extends Object
implements RepositoryMonitor

The session-specific monitoring interface.


Constructor Summary
protected JcrRepositoryMonitor(JcrSession session)
           
 
Method Summary
 Set<DurationMetric> getAvailableDurationMetrics()
          Get the DurationMetric enumerations that are available for use by the caller with RepositoryMonitor.getHistory(DurationMetric, Window).
 Set<ValueMetric> getAvailableValueMetrics()
          Get the ValueMetric enumerations that are available for use by the caller with RepositoryMonitor.getHistory(ValueMetric, Window).
 Set<Window> getAvailableWindows()
          Get the Window enumerations that are available for use by the caller with RepositoryMonitor.getHistory(DurationMetric, Window) and RepositoryMonitor.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.
protected  RepositoryStatistics statistics()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcrRepositoryMonitor

protected JcrRepositoryMonitor(JcrSession session)
                        throws RepositoryException
Throws:
RepositoryException
Method Detail

statistics

protected final RepositoryStatistics statistics()

getAvailableValueMetrics

public Set<ValueMetric> getAvailableValueMetrics()
Description copied from interface: RepositoryMonitor
Get the ValueMetric enumerations that are available for use by the caller with RepositoryMonitor.getHistory(ValueMetric, Window).

Specified by:
getAvailableValueMetrics in interface RepositoryMonitor
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:
RepositoryMonitor.getHistory(ValueMetric, Window)

getAvailableDurationMetrics

public Set<DurationMetric> getAvailableDurationMetrics()
Description copied from interface: RepositoryMonitor
Get the DurationMetric enumerations that are available for use by the caller with RepositoryMonitor.getHistory(DurationMetric, Window).

Specified by:
getAvailableDurationMetrics in interface RepositoryMonitor
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:
RepositoryMonitor.getHistory(DurationMetric, Window), RepositoryMonitor.getLongestRunning(DurationMetric)

getAvailableWindows

public Set<Window> getAvailableWindows()
Description copied from interface: RepositoryMonitor
Get the Window enumerations that are available for use by the caller with RepositoryMonitor.getHistory(DurationMetric, Window) and RepositoryMonitor.getHistory(ValueMetric, Window).

Specified by:
getAvailableWindows in interface RepositoryMonitor
Returns:
the immutable set of DurationMetric instances; never null but possibly empty if the caller has no permissions to see any windows
See Also:
RepositoryMonitor.getHistory(DurationMetric, Window), RepositoryMonitor.getHistory(ValueMetric, Window)

getHistory

public History getHistory(ValueMetric metric,
                          Window windowInTime)
                   throws AccessDeniedException
Description copied from interface: RepositoryMonitor
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.

Specified by:
getHistory in interface RepositoryMonitor
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
See Also:
RepositoryMonitor.getAvailableValueMetrics(), RepositoryMonitor.getAvailableWindows()

getHistory

public History getHistory(DurationMetric metric,
                          Window windowInTime)
                   throws AccessDeniedException
Description copied from interface: RepositoryMonitor
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.

Specified by:
getHistory in interface RepositoryMonitor
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
See Also:
RepositoryMonitor.getAvailableDurationMetrics(), RepositoryMonitor.getAvailableWindows()

getLongestRunning

public DurationActivity[] getLongestRunning(DurationMetric metric)
                                     throws AccessDeniedException
Description copied from interface: RepositoryMonitor
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.

Specified by:
getLongestRunning in interface RepositoryMonitor
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
See Also:
RepositoryMonitor.getAvailableDurationMetrics()

ModeShape Distribution 3.0.0.Beta4

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