org.opennms.netmgt.threshd
Class ThresholdEntity

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

public final class ThresholdEntity
extends Object
implements 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.
 List<org.opennms.netmgt.xml.event.Event> evaluateAndCreateEvents(Map<String,Double> values, Date date)
          Evaluates the threshold in light of the provided datasource value and create any events for thresholds.
 Double fetchLastValue(LatencyInterface latIface, LatencyParameters latParms)
           
 String getDataSourceExpression()
          Get datasource name
 String getDatasourceLabel()
          Get datasource Label
 String getDatasourceType()
          Get datasource type
 Collection<String> getRequiredDatasources()
          Returns the names of the dataousrces required to evaluate this threshold entity
static List<ThresholdEvaluator> getThresholdEvaluators()
           
 List<ThresholdEvaluatorState> getThresholdEvaluatorStates()
           
 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 String getDataSourceExpression()
Get datasource name


getDatasourceType

public String getDatasourceType()
Get datasource type


getDatasourceLabel

public String getDatasourceLabel()
Get datasource Label


getRequiredDatasources

public Collection<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 Object

toString

public 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 Object
Returns:
String which represents the content of this ThresholdEntity

evaluateAndCreateEvents

public List<org.opennms.netmgt.xml.event.Event> evaluateAndCreateEvents(Map<String,Double> values,
                                                                        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 Double fetchLastValue(LatencyInterface latIface,
                             LatencyParameters latParms)
                      throws ThresholdingException
Throws:
ThresholdingException

addThreshold

public void addThreshold(BaseThresholdDefConfigWrapper threshold)

getThresholdEvaluatorStates

public List<ThresholdEvaluatorState> getThresholdEvaluatorStates()

getThresholdEvaluators

public static final List<ThresholdEvaluator> getThresholdEvaluators()


Copyright ? 2007. All Rights Reserved.