Class 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's addThresholdListener method. When the threshold event occurs, that object's appropriate method is invoked.
    • 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
      • previousValues

        private final HashMap<String,​Long> previousValues
        The previous values.
    • Constructor Detail

      • AbstractThresholdListener

        public AbstractThresholdListener()
    • 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
      • 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 name
        previousValue - 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 name
        disabled - the disabled