OpenNMS API 1.2.9

## org.opennms.netmgt.threshd
Class ThresholdEntity

    java.lang.Object
      org.opennms.netmgt.threshd.ThresholdEntity

All Implemented Interfaces:
  java.lang.Cloneable

final class ThresholdEntity
extends java.lang.Object
implements java.lang.Cloneable

Wraps the castor created org.opennms.netmgt.config.threshd.Threshold class and provides the ability to track threshold exceeded occurrences.

Field Summary
`(package private) static int` `HIGH_AND_LOW_REARMED`
`(package private) static int` `HIGH_AND_LOW_TRIGGERED`
`(package private) static int` `HIGH_REARMED`
`(package private) static java.lang.String` `HIGH_THRESHOLD`
`(package private) static int` `HIGH_TRIGGERED`
`(package private) static int` `LOW_REARMED`
`(package private) static java.lang.String` `LOW_THRESHOLD`
`(package private) static int` `LOW_TRIGGERED`
`private boolean` `m_highArmed` Threshold armed flag This flag must be true before evaluate() will return true (indicating that the threshold has been triggered).
`private int` `m_highCount` Threshold exceeded count
`private Threshold` `m_highThreshold` Castor Threshold object containing threshold configuration data.
`private boolean` `m_lowArmed`
`private int` `m_lowCount`
`private Threshold` `m_lowThreshold`
`(package private) static int` `NONE_TRIGGERED`

Constructor Summary
`(package private)` `ThresholdEntity()` Constructor.

Method Summary
`java.lang.Object` `clone()` Returns a copy of this ThresholdEntity object.
`(package private) int` `evaluate(double dsValue)` Evaluates the threshold in light of the provided datasource value.
`(package private) java.lang.String` `getDatasourceLabel()` Get datasource Label
`(package private) java.lang.String` `getDatasourceName()` Get datasource name
`(package private) java.lang.String` `getDatasourceType()` Get datasource type
`(package private) double` `getHighRearm()` Get high threshold re-arm
`(package private) Threshold` `getHighThreshold()`
`(package private) int` `getHighTrigger()` Get high threshold trigger
`(package private) double` `getHighValue()` Get high threshold value
`(package private) double` `getLowRearm()` Get low threshold re-arm
`(package private) Threshold` `getLowThreshold()`
`(package private) int` `getLowTrigger()` Get low threshold trigger
`(package private) double` `getLowValue()` Get low threshold value
`(package private) boolean` `hasHighThreshold()`
`(package private) boolean` `hasLowThreshold()`
`(package private) void` `setHighThreshold(Threshold threshold)`
`(package private) void` `setLowThreshold(Threshold threshold)`
`java.lang.String` `toString()` This method is responsible for returning a String object which represents the content of this ThresholdEntity.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### NONE_TRIGGERED

    static final int NONE_TRIGGERED

See Also:
  Constant Field Values

### HIGH_TRIGGERED

    static final int HIGH_TRIGGERED

See Also:
  Constant Field Values

### LOW_TRIGGERED

    static final int LOW_TRIGGERED

See Also:
  Constant Field Values

### HIGH_AND_LOW_TRIGGERED

    static final int HIGH_AND_LOW_TRIGGERED

See Also:
  Constant Field Values

### HIGH_REARMED

    static final int HIGH_REARMED

See Also:
  Constant Field Values

### LOW_REARMED

    static final int LOW_REARMED

See Also:
  Constant Field Values

### HIGH_AND_LOW_REARMED

    static final int HIGH_AND_LOW_REARMED

See Also:
  Constant Field Values

### HIGH_THRESHOLD

    static final java.lang.String HIGH_THRESHOLD

See Also:
  Constant Field Values

### LOW_THRESHOLD

    static final java.lang.String LOW_THRESHOLD

See Also:
  Constant Field Values

### m_highThreshold

    private Threshold m_highThreshold

  Castor Threshold object containing threshold configuration data.

### m_lowThreshold

    private Threshold m_lowThreshold

### m_highCount

    private int m_highCount

  Threshold exceeded count

### m_lowCount

    private int m_lowCount

### m_highArmed

    private boolean m_highArmed

  Threshold armed flag This flag must be true before evaluate() will return true (indicating that the threshold has been triggered). This flag is initialized to true by the constructor and is set to false each time the threshold is triggered. It can only be reset by the current value of the datasource falling below (for high threshold) or rising above (for low threshold) the rearm value.

### m_lowArmed

    private boolean m_lowArmed

Constructor Detail

### ThresholdEntity

    ThresholdEntity()

  Constructor.

Method Detail

### setHighThreshold

    void setHighThreshold(Threshold threshold)

### setLowThreshold

    void setLowThreshold(Threshold threshold)

### hasHighThreshold

    boolean hasHighThreshold()

### hasLowThreshold

    boolean hasLowThreshold()

### getHighThreshold

    Threshold getHighThreshold()

### getLowThreshold

    Threshold getLowThreshold()

### getDatasourceName

    java.lang.String getDatasourceName()

  Get datasource name

### getDatasourceType

    java.lang.String getDatasourceType()

  Get datasource type

### getHighValue

    double getHighValue()

  Get high threshold value

### getLowValue

    double getLowValue()

  Get low threshold value

### getHighRearm

    double getHighRearm()

  Get high threshold re-arm

### getLowRearm

    double getLowRearm()

  Get low threshold re-arm

### getHighTrigger

    int getHighTrigger()

  Get high threshold trigger

### getLowTrigger

    int getLowTrigger()

  Get low threshold trigger

### getDatasourceLabel

    java.lang.String getDatasourceLabel()

  Get datasource Label

### clone

    public java.lang.Object clone()

  Returns a copy of this ThresholdEntity object. NOTE: The m_lowThreshold and m_highThreshold member variables are not actually cloned...the returned ThresholdEntity object will simply contain references to the same castor Threshold objects as the original ThresholdEntity object.

### toString

    public java.lang.String toString()

  This method is responsible for returning a String object which represents the content of this ThresholdEntity. Primarily used for debugging purposes.

  Returns:
    String which represents the content of this ThresholdEntity

### evaluate

    int evaluate(double dsValue)

  Evaluates the threshold in light of the provided datasource value.

  Parameters:
    `dsValue` - Current value of datasource
  Returns:
    integer value indicating which threshold types (if any) were exceeded indicating than an event should be generated. false otherwise.

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.