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

ExpressionConfigWrapper class.

Author:
Jeff Gehlbach, Craig Miskell

Constructor Summary
ExpressionConfigWrapper(Expression expression)
          Constructor for ExpressionConfigWrapper.
 
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()
          getDatasourceExpression
 Collection<String> getRequiredDatasources()
          Returns the names of the datasources required to evaluate this threshold
 
Methods inherited from class org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper
equals, getBasethresholddef, getConfigWrapper, getDsLabel, getDsType, getRearm, getRearmedUEI, getTrigger, getTriggeredUEI, getType, getValue, hashCode, hasRearm, hasTrigger, hasValue, identical, merge
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionConfigWrapper

public ExpressionConfigWrapper(Expression expression)
                        throws ThresholdExpressionException

Constructor for ExpressionConfigWrapper.

Parameters:
expression - a Expression object.
Throws:
ThresholdExpressionException - if any.
Method Detail

getDatasourceExpression

public String getDatasourceExpression()

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()
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
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 - if any.


Copyright © 2011. All Rights Reserved.