org.opennms.netmgt.threshd
Class ExpressionConfigWrapper

java.lang.Object
  extended by org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper
      extended by org.opennms.netmgt.threshd.ExpressionConfigWrapper

public class ExpressionConfigWrapper
extends BaseThresholdDefConfigWrapper

Author:
Jeff Gehlbach, Craig Miskell

Constructor Summary
ExpressionConfigWrapper(Expression expression)
           
 
Method Summary
 double evaluate(Map<String,Double> values)
          Evaluate the threshold expression/datasource in terms of the named values supplied, and return that value
 String getDatasourceExpression()
           
 Collection<String> getRequiredDatasources()
          Returns the names of the datasources required to evaluate this threshold
 
Methods inherited from class org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper
getBasethresholddef, getConfigWrapper, getDsLabel, getDsType, getRearm, getRearmedUEI, getTrigger, getTriggeredUEI, getType, getValue, hasRearm, hasTrigger, hasValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionConfigWrapper

public ExpressionConfigWrapper(Expression expression)
                        throws ThresholdExpressionException
Throws:
ThresholdExpressionException
Method Detail

getDatasourceExpression

public String getDatasourceExpression()
Specified by:
getDatasourceExpression in class BaseThresholdDefConfigWrapper
Returns:
a descriptive string for the data source - typically either a data source name, or an expression of data source names

getRequiredDatasources

public Collection<String> getRequiredDatasources()
Description copied from class: BaseThresholdDefConfigWrapper
Returns the names of the datasources required to evaluate this threshold

Specified by:
getRequiredDatasources in class BaseThresholdDefConfigWrapper
Returns:
Collection of the names of datasources

evaluate

public double evaluate(Map<String,Double> values)
                throws ThresholdExpressionException
Description copied from class: BaseThresholdDefConfigWrapper
Evaluate the threshold expression/datasource in terms of the named values supplied, and return that value

Specified by:
evaluate in class BaseThresholdDefConfigWrapper
Parameters:
values - named values to use in evaluating the expression/data source
Returns:
the value of the evaluated expression
Throws:
ThresholdExpressionException


Copyright © 2009. All Rights Reserved.