public class FilterRule extends Object
FilterRule.Type.MUST - rule MUST be true and following rules are checked
FilterRule.Type.SUFFICE - if this rule is true the filter passes the event to children
otherwise next rules are checked
FilterRule.Type.MUST_NOT - if this rule is true the filter ignores the event, otherwise
next rules are checked
FilterCallback.Rule)| Modifier and Type | Class and Description |
|---|---|
static class |
FilterRule.Type
Enumeration of rule types that determines the evaluation of multiple rules in a chain.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
VAR_ACTIVE
Name of the rule variable for number of concurrently active splits of a particular Simon (active).
|
static String |
VAR_COUNTER
Name of the rule variable for current value of the counter (counter).
|
static String |
VAR_MAX
Name of the rule variable for maximal value of the Simon - stopwatch in ns, counter without unit (max).
|
static String |
VAR_MAX_ACTIVE
Name of the rule variable for maximal number of concurrently active splits (maxactive).
|
static String |
VAR_MIN
Name of the rule variable for minimal value of the Simon - stopwatch in ns, counter without unit (min).
|
static String |
VAR_SPLIT
Name of the rule variable for last split time in ns (split).
|
static String |
VAR_TOTAL
Name of the rule variable for total split time (total).
|
static String |
VAR_VALUE
Name of the rule variable for increment or decrement value (value).
|
| Constructor and Description |
|---|
FilterRule(FilterRule.Type type,
String condition,
SimonPattern pattern)
Creates the rule with a specified type, condition and pattern.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkCondition(Simon simon,
Object... params)
Checks the Simon and optional parameters against the condition specified for a rule.
|
String |
getCondition()
Returns the additional condition of this rule.
|
SimonPattern |
getPattern()
Returns the Simon pattern of this rule.
|
FilterRule.Type |
getType()
Returns the type of this rule.
|
public static final String VAR_SPLIT
public static final String VAR_ACTIVE
public static final String VAR_MAX_ACTIVE
public static final String VAR_COUNTER
public static final String VAR_MAX
public static final String VAR_MIN
public static final String VAR_TOTAL
public static final String VAR_VALUE
public FilterRule(FilterRule.Type type, String condition, SimonPattern pattern)
Callback.onManagerWarning(String, Exception), Callback.onManagerMessage(String)).
Both condition and pattern are optional and can be null.type - rule type determining the role of the rule in the chain of the filtercondition - additional conditional expression that must be truepattern - Simon pattern that must matchpublic FilterRule.Type getType()
public String getCondition()
public SimonPattern getPattern()
public boolean checkCondition(Simon simon, Object... params) throws ScriptException
simon - related Simonparams - optional parameters, e.g. value that is added to a CounterScriptException - possible exception raised by the expression evaluationCopyright © 2019. All rights reserved.