Package org.opennms.netmgt.threshd
Class ExpressionConfigWrapper
- java.lang.Object
-
- org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper
-
- org.opennms.netmgt.threshd.ExpressionConfigWrapper
-
public class ExpressionConfigWrapper extends BaseThresholdDefConfigWrapper
- Author:
- Alejandro Galue, Jeff Gehlbach, Craig Miskell
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpressionConfigWrapper.ExpressionThresholdValues
static class
ExpressionConfigWrapper.MathBinding
This class provides an instance that gives access to theMath
functions.
-
Constructor Summary
Constructors Constructor Description ExpressionConfigWrapper(Expression expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ThresholdDefVisitor thresholdDefVisitor)
double
evaluate(String expression, Map<String,Double> values)
Evaluate given an already interpolated expression that contains no mate data.String
getDatasourceExpression()
getDatasourceExpressionCollection<String>
getRequiredDatasources()
Returns the names of the datasources required to evaluate this thresholdExpressionConfigWrapper.ExpressionThresholdValues
interpolateAndEvaluate(Map<String,Double> values, Scope scope)
Evaluate with un-interpolated expression that may contain mate data, meaning we need to interpolate it first.-
Methods inherited from class org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper
equals, getBasethresholddef, getConfigWrapper, getDsLabel, getDsType, getFilterDatasources, getRearm, getRearmedUEI, getRearmString, getTrigger, getTriggeredUEI, getTriggerString, getType, getValue, getValueString, hashCode, hasRearm, hasTrigger, hasValue, interpolateThresholdValues, merge
-
-
-
-
Constructor Detail
-
ExpressionConfigWrapper
public ExpressionConfigWrapper(Expression expression) throws ThresholdExpressionException
- Throws:
ThresholdExpressionException
-
-
Method Detail
-
getDatasourceExpression
public String getDatasourceExpression()
Description copied from class:BaseThresholdDefConfigWrapper
getDatasourceExpression
- Specified by:
getDatasourceExpression
in classBaseThresholdDefConfigWrapper
- 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 classBaseThresholdDefConfigWrapper
- Returns:
- Collection of the names of datasources
-
evaluate
public double evaluate(String expression, Map<String,Double> values) throws ThresholdExpressionException
Evaluate given an already interpolated expression that contains no mate data.- Throws:
ThresholdExpressionException
-
interpolateAndEvaluate
public ExpressionConfigWrapper.ExpressionThresholdValues interpolateAndEvaluate(Map<String,Double> values, Scope scope) throws ThresholdExpressionException
Evaluate with un-interpolated expression that may contain mate data, meaning we need to interpolate it first. The interpolation should happen once here and future calls to evaluate should use the resulting interpolated value.- Throws:
ThresholdExpressionException
-
accept
public void accept(ThresholdDefVisitor thresholdDefVisitor)
- Specified by:
accept
in classBaseThresholdDefConfigWrapper
-
-