Package psiprobe.beans.stats.listeners
Class AbstractThresholdListener
- java.lang.Object
-
- psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
-
- psiprobe.beans.stats.listeners.AbstractThresholdListener
-
- All Implemented Interfaces:
StatsCollectionListener
- Direct Known Subclasses:
AbstractFlapListener
public abstract class AbstractThresholdListener extends AbstractStatsCollectionListener
The listener interface for receiving threshold events. The class that is interested in processing a threshold event implements this interface, and the object created with that class is registered with a component using the component'saddThresholdListener
method. When the threshold event occurs, that object's appropriate method is invoked.
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_THRESHOLD
The Constant DEFAULT_THRESHOLD.static long
DEFAULT_VALUE
The Constant DEFAULT_VALUE.private HashMap<String,Long>
previousValues
The previous values.private HashMap<String,Boolean>
seriesDisabled
The series disabled.-
Fields inherited from class psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
logger
-
-
Constructor Summary
Constructors Constructor Description AbstractThresholdListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
crossedAboveThreshold(StatsCollectionEvent sce)
Crossed above threshold.protected abstract void
crossedBelowThreshold(StatsCollectionEvent sce)
Crossed below threshold.protected long
getPreviousValue(String name)
Gets the previous value.protected long
getThreshold(String name)
Gets the threshold.protected boolean
isPreviousValueAboveThreshold(StatsCollectionEvent sce)
Checks if is previous value above threshold.protected boolean
isSeriesDisabled(String name)
Checks if is series disabled.protected boolean
isValueAboveThreshold(StatsCollectionEvent sce)
Checks if is value above threshold.protected abstract void
remainedAboveThreshold(StatsCollectionEvent sce)
Remained above threshold.protected abstract void
remainedBelowThreshold(StatsCollectionEvent sce)
Remained below threshold.void
reset()
Reset.protected void
setPreviousValue(String name, long previousValue)
Sets the previous value.protected void
setSeriesDisabled(String name, boolean disabled)
Sets the series disabled.void
statsCollected(StatsCollectionEvent sce)
Stats collected.-
Methods inherited from class psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
getPropertyCategory, getPropertyKey, getPropertyValue, getPropertyValue, isEnabled, setEnabled, setPropertyCategory
-
-
-
-
Field Detail
-
DEFAULT_THRESHOLD
public static final long DEFAULT_THRESHOLD
The Constant DEFAULT_THRESHOLD.- See Also:
- Constant Field Values
-
DEFAULT_VALUE
public static final long DEFAULT_VALUE
The Constant DEFAULT_VALUE.- See Also:
- Constant Field Values
-
-
Method Detail
-
crossedAboveThreshold
protected abstract void crossedAboveThreshold(StatsCollectionEvent sce)
Crossed above threshold.- Parameters:
sce
- the sce
-
crossedBelowThreshold
protected abstract void crossedBelowThreshold(StatsCollectionEvent sce)
Crossed below threshold.- Parameters:
sce
- the sce
-
remainedAboveThreshold
protected abstract void remainedAboveThreshold(StatsCollectionEvent sce)
Remained above threshold.- Parameters:
sce
- the sce
-
remainedBelowThreshold
protected abstract void remainedBelowThreshold(StatsCollectionEvent sce)
Remained below threshold.- Parameters:
sce
- the sce
-
statsCollected
public void statsCollected(StatsCollectionEvent sce)
Description copied from interface:StatsCollectionListener
Stats collected.- Parameters:
sce
- the sce
-
reset
public void reset()
Description copied from class:AbstractStatsCollectionListener
Reset.- Overrides:
reset
in classAbstractStatsCollectionListener
-
isPreviousValueAboveThreshold
protected boolean isPreviousValueAboveThreshold(StatsCollectionEvent sce)
Checks if is previous value above threshold.- Parameters:
sce
- the sce- Returns:
- true, if is previous value above threshold
-
isValueAboveThreshold
protected boolean isValueAboveThreshold(StatsCollectionEvent sce)
Checks if is value above threshold.- Parameters:
sce
- the sce- Returns:
- true, if is value above threshold
-
getThreshold
protected long getThreshold(String name)
Gets the threshold.- Parameters:
name
- the name- Returns:
- the threshold
-
getPreviousValue
protected long getPreviousValue(String name)
Gets the previous value.- Parameters:
name
- the name- Returns:
- the previous value
-
setPreviousValue
protected void setPreviousValue(String name, long previousValue)
Sets the previous value.- Parameters:
name
- the namepreviousValue
- the previous value
-
isSeriesDisabled
protected boolean isSeriesDisabled(String name)
Checks if is series disabled.- Parameters:
name
- the name- Returns:
- true, if is series disabled
-
setSeriesDisabled
protected void setSeriesDisabled(String name, boolean disabled)
Sets the series disabled.- Parameters:
name
- the namedisabled
- the disabled
-
-