org.opennms.netmgt.threshd
Class ThresholdEntity

java.lang.Object
  extended by org.opennms.netmgt.threshd.ThresholdEntity
All Implemented Interfaces:
java.lang.Cloneable

public 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.


Constructor Summary
ThresholdEntity()
          Constructor.
 
Method Summary
 void addThreshold(BaseThresholdDefConfigWrapper threshold)
           
 ThresholdEntity clone()
          Returns a copy of this ThresholdEntity object.
 java.util.List<org.opennms.netmgt.xml.event.Event> evaluateAndCreateEvents(java.util.Map<java.lang.String,java.lang.Double> values, java.util.Date date)
          Evaluates the threshold in light of the provided datasource value and create any events for thresholds.
 java.lang.Double fetchLastValue(LatencyInterface latIface, LatencyParameters latParms)
           
 java.lang.String getDataSourceExpression()
          Get datasource name
 java.lang.String getDatasourceLabel()
          Get datasource Label
 java.lang.String getDatasourceType()
          Get datasource type
 java.util.Collection<java.lang.String> getRequiredDatasources()
          Returns the names of the dataousrces required to evaluate this threshold entity
static java.util.List<ThresholdEvaluator> getThresholdEvaluators()
           
 java.util.List<ThresholdEvaluatorState> getThresholdEvaluatorStates()
           
 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
 

Constructor Detail

ThresholdEntity

public ThresholdEntity()
Constructor.

Method Detail

getDataSourceExpression

public java.lang.String getDataSourceExpression()
Get datasource name


getDatasourceType

public java.lang.String getDatasourceType()
Get datasource type


getDatasourceLabel

public java.lang.String getDatasourceLabel()
Get datasource Label


getRequiredDatasources

public java.util.Collection<java.lang.String> getRequiredDatasources()
Returns the names of the dataousrces required to evaluate this threshold entity

Returns:
Collection of the names of datasources

clone

public ThresholdEntity 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.

Overrides:
clone in class java.lang.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.

Overrides:
toString in class java.lang.Object
Returns:
String which represents the content of this ThresholdEntity

evaluateAndCreateEvents

public java.util.List<org.opennms.netmgt.xml.event.Event> evaluateAndCreateEvents(java.util.Map<java.lang.String,java.lang.Double> values,
                                                                                  java.util.Date date)
Evaluates the threshold in light of the provided datasource value and create any events for thresholds.

Parameters:
dsValue - Current value of datasource
Returns:
List of events

fetchLastValue

public java.lang.Double fetchLastValue(LatencyInterface latIface,
                                       LatencyParameters latParms)
                                throws ThresholdingException
Throws:
ThresholdingException

addThreshold

public void addThreshold(BaseThresholdDefConfigWrapper threshold)

getThresholdEvaluatorStates

public java.util.List<ThresholdEvaluatorState> getThresholdEvaluatorStates()

getThresholdEvaluators

public static final java.util.List<ThresholdEvaluator> getThresholdEvaluators()


Copyright © 2007. All Rights Reserved.