Package psiprobe.beans.stats.listeners
Class AbstractFlapListener
- java.lang.Object
-
- psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
-
- psiprobe.beans.stats.listeners.AbstractThresholdListener
-
- psiprobe.beans.stats.listeners.AbstractFlapListener
-
- All Implemented Interfaces:
StatsCollectionListener
- Direct Known Subclasses:
MemoryPoolMailingListener
public abstract class AbstractFlapListener extends AbstractThresholdListener
The listener interface for receiving flap events. The class that is interested in processing a flap event implements this interface, and the object created with that class is registered with a component using the component'saddFlapListener
method. When the flap event occurs, that object's appropriate method is invoked.
-
-
Field Summary
Fields Modifier and Type Field Description private float
defaultFlapHighWeight
The default flap high weight.private int
defaultFlapInterval
The default flap interval.private float
defaultFlapLowWeight
The default flap low weight.private float
defaultFlapStartThreshold
The default flap start threshold.private float
defaultFlapStopThreshold
The default flap stop threshold.private HashMap<String,Boolean>
flappingStates
The flapping states.private HashMap<String,LinkedList<Boolean>>
flaps
The flaps.-
Fields inherited from class psiprobe.beans.stats.listeners.AbstractThresholdListener
DEFAULT_THRESHOLD, DEFAULT_VALUE
-
Fields inherited from class psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
logger
-
-
Constructor Summary
Constructors Constructor Description AbstractFlapListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
aboveThresholdFlappingStopped(StatsCollectionEvent sce)
Above threshold flapping stopped.protected abstract void
aboveThresholdNotFlapping(StatsCollectionEvent sce)
Above threshold not flapping.protected void
addFlap(String name, boolean flap)
Adds the flap.protected abstract void
belowThresholdFlappingStopped(StatsCollectionEvent sce)
Below threshold flapping stopped.protected abstract void
belowThresholdNotFlapping(StatsCollectionEvent sce)
Below threshold not flapping.protected float
calculateStateTransitionPercentage(String name, boolean flapping)
Calculate state transition percentage.protected boolean
checkFlappingStateChanged(String name, boolean crossedThreshold)
Check flapping state changed.protected void
crossedAboveThreshold(StatsCollectionEvent sce)
Crossed above threshold.protected void
crossedBelowThreshold(StatsCollectionEvent sce)
Crossed below threshold.protected abstract void
flappingStarted(StatsCollectionEvent sce)
Flapping started.float
getDefaultFlapHighWeight()
Gets the default flap high weight.int
getDefaultFlapInterval()
Gets the default flap interval.float
getDefaultFlapLowWeight()
Gets the default flap low weight.float
getDefaultFlapStartThreshold()
Gets the default flap start threshold.float
getDefaultFlapStopThreshold()
Gets the default flap stop threshold.protected float
getFlapHighWeight(String name)
Gets the flap high weight.protected int
getFlapInterval(String name)
Gets the flap interval.protected float
getFlapLowWeight(String name)
Gets the flap low weight.protected boolean
getFlappingState(String name)
Gets the flapping state.protected LinkedList<Boolean>
getFlaps(String name)
Gets the flaps.protected float
getFlapStartThreshold(String name)
Gets the flap start threshold.protected float
getFlapStopThreshold(String name)
Gets the flap stop threshold.protected void
remainedAboveThreshold(StatsCollectionEvent sce)
Remained above threshold.protected void
remainedBelowThreshold(StatsCollectionEvent sce)
Remained below threshold.void
reset()
Reset.void
setDefaultFlapHighWeight(float defaultFlapHighWeight)
Sets the default flap high weight.void
setDefaultFlapInterval(int defaultFlapInterval)
Sets the default flap interval.void
setDefaultFlapLowWeight(float defaultFlapLowWeight)
Sets the default flap low weight.void
setDefaultFlapStartThreshold(float defaultFlapStartThreshold)
Sets the default flap start threshold.void
setDefaultFlapStopThreshold(float defaultFlapStopThreshold)
Sets the default flap stop threshold.protected void
setFlappingState(String name, boolean flapping)
Sets the flapping state.protected void
statsCollected(StatsCollectionEvent sce, boolean crossedThreshold, boolean above)
Stats collected.-
Methods inherited from class psiprobe.beans.stats.listeners.AbstractThresholdListener
getPreviousValue, getThreshold, isPreviousValueAboveThreshold, isSeriesDisabled, isValueAboveThreshold, setPreviousValue, setSeriesDisabled, statsCollected
-
Methods inherited from class psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
getPropertyCategory, getPropertyKey, getPropertyValue, getPropertyValue, isEnabled, setEnabled, setPropertyCategory
-
-
-
-
Field Detail
-
defaultFlapInterval
private int defaultFlapInterval
The default flap interval.
-
defaultFlapStartThreshold
private float defaultFlapStartThreshold
The default flap start threshold.
-
defaultFlapStopThreshold
private float defaultFlapStopThreshold
The default flap stop threshold.
-
defaultFlapLowWeight
private float defaultFlapLowWeight
The default flap low weight.
-
defaultFlapHighWeight
private float defaultFlapHighWeight
The default flap high weight.
-
flaps
private final HashMap<String,LinkedList<Boolean>> flaps
The flaps.
-
-
Method Detail
-
flappingStarted
protected abstract void flappingStarted(StatsCollectionEvent sce)
Flapping started.- Parameters:
sce
- the sce
-
aboveThresholdFlappingStopped
protected abstract void aboveThresholdFlappingStopped(StatsCollectionEvent sce)
Above threshold flapping stopped.- Parameters:
sce
- the sce
-
belowThresholdFlappingStopped
protected abstract void belowThresholdFlappingStopped(StatsCollectionEvent sce)
Below threshold flapping stopped.- Parameters:
sce
- the sce
-
aboveThresholdNotFlapping
protected abstract void aboveThresholdNotFlapping(StatsCollectionEvent sce)
Above threshold not flapping.- Parameters:
sce
- the sce
-
belowThresholdNotFlapping
protected abstract void belowThresholdNotFlapping(StatsCollectionEvent sce)
Below threshold not flapping.- Parameters:
sce
- the sce
-
crossedAboveThreshold
protected void crossedAboveThreshold(StatsCollectionEvent sce)
Description copied from class:AbstractThresholdListener
Crossed above threshold.- Specified by:
crossedAboveThreshold
in classAbstractThresholdListener
- Parameters:
sce
- the sce
-
crossedBelowThreshold
protected void crossedBelowThreshold(StatsCollectionEvent sce)
Description copied from class:AbstractThresholdListener
Crossed below threshold.- Specified by:
crossedBelowThreshold
in classAbstractThresholdListener
- Parameters:
sce
- the sce
-
remainedAboveThreshold
protected void remainedAboveThreshold(StatsCollectionEvent sce)
Description copied from class:AbstractThresholdListener
Remained above threshold.- Specified by:
remainedAboveThreshold
in classAbstractThresholdListener
- Parameters:
sce
- the sce
-
remainedBelowThreshold
protected void remainedBelowThreshold(StatsCollectionEvent sce)
Description copied from class:AbstractThresholdListener
Remained below threshold.- Specified by:
remainedBelowThreshold
in classAbstractThresholdListener
- Parameters:
sce
- the sce
-
reset
public void reset()
Description copied from class:AbstractStatsCollectionListener
Reset.- Overrides:
reset
in classAbstractThresholdListener
-
statsCollected
protected void statsCollected(StatsCollectionEvent sce, boolean crossedThreshold, boolean above)
Stats collected.- Parameters:
sce
- the scecrossedThreshold
- the crossed thresholdabove
- the above
-
checkFlappingStateChanged
protected boolean checkFlappingStateChanged(String name, boolean crossedThreshold)
Check flapping state changed.- Parameters:
name
- the namecrossedThreshold
- the crossed threshold- Returns:
- true, if successful
-
calculateStateTransitionPercentage
protected float calculateStateTransitionPercentage(String name, boolean flapping)
Calculate state transition percentage.- Parameters:
name
- the nameflapping
- the flapping- Returns:
- the float
-
addFlap
protected void addFlap(String name, boolean flap)
Adds the flap.- Parameters:
name
- the nameflap
- the flap
-
getFlappingState
protected boolean getFlappingState(String name)
Gets the flapping state.- Parameters:
name
- the name- Returns:
- the flapping state
-
setFlappingState
protected void setFlappingState(String name, boolean flapping)
Sets the flapping state.- Parameters:
name
- the nameflapping
- the flapping
-
getFlaps
protected LinkedList<Boolean> getFlaps(String name)
Gets the flaps.- Parameters:
name
- the name- Returns:
- the flaps
-
getFlapInterval
protected int getFlapInterval(String name)
Gets the flap interval.- Parameters:
name
- the name- Returns:
- the flap interval
-
getFlapStartThreshold
protected float getFlapStartThreshold(String name)
Gets the flap start threshold.- Parameters:
name
- the name- Returns:
- the flap start threshold
-
getFlapStopThreshold
protected float getFlapStopThreshold(String name)
Gets the flap stop threshold.- Parameters:
name
- the name- Returns:
- the flap stop threshold
-
getFlapLowWeight
protected float getFlapLowWeight(String name)
Gets the flap low weight.- Parameters:
name
- the name- Returns:
- the flap low weight
-
getFlapHighWeight
protected float getFlapHighWeight(String name)
Gets the flap high weight.- Parameters:
name
- the name- Returns:
- the flap high weight
-
getDefaultFlapInterval
public int getDefaultFlapInterval()
Gets the default flap interval.- Returns:
- the default flap interval
-
setDefaultFlapInterval
public void setDefaultFlapInterval(int defaultFlapInterval)
Sets the default flap interval.- Parameters:
defaultFlapInterval
- the new default flap interval
-
getDefaultFlapStartThreshold
public float getDefaultFlapStartThreshold()
Gets the default flap start threshold.- Returns:
- the default flap start threshold
-
setDefaultFlapStartThreshold
public void setDefaultFlapStartThreshold(float defaultFlapStartThreshold)
Sets the default flap start threshold.- Parameters:
defaultFlapStartThreshold
- the new default flap start threshold
-
getDefaultFlapStopThreshold
public float getDefaultFlapStopThreshold()
Gets the default flap stop threshold.- Returns:
- the default flap stop threshold
-
setDefaultFlapStopThreshold
public void setDefaultFlapStopThreshold(float defaultFlapStopThreshold)
Sets the default flap stop threshold.- Parameters:
defaultFlapStopThreshold
- the new default flap stop threshold
-
getDefaultFlapLowWeight
public float getDefaultFlapLowWeight()
Gets the default flap low weight.- Returns:
- the default flap low weight
-
setDefaultFlapLowWeight
public void setDefaultFlapLowWeight(float defaultFlapLowWeight)
Sets the default flap low weight.- Parameters:
defaultFlapLowWeight
- the new default flap low weight
-
getDefaultFlapHighWeight
public float getDefaultFlapHighWeight()
Gets the default flap high weight.- Returns:
- the default flap high weight
-
setDefaultFlapHighWeight
public void setDefaultFlapHighWeight(float defaultFlapHighWeight)
Sets the default flap high weight.- Parameters:
defaultFlapHighWeight
- the new default flap high weight
-
-