org.apache.synapse.mediators.filters
Class FilterMediator
java.lang.Object
org.apache.synapse.mediators.AbstractMediator
org.apache.synapse.mediators.AbstractListMediator
org.apache.synapse.mediators.filters.FilterMediator
- All Implemented Interfaces:
- AspectConfigurable, ManagedLifecycle, Mediator, FilterMediator, ListMediator, SynapseArtifact
public class FilterMediator
- extends AbstractListMediator
- implements FilterMediator
The filter mediator combines the regex and xpath filtering functionality. If an xpath
is set, it is evaluated; else the given regex is evaluated against the source xpath.
Methods inherited from class org.apache.synapse.mediators.AbstractMediator |
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilterMediator
public FilterMediator()
init
public void init(SynapseEnvironment se)
- Description copied from class:
AbstractListMediator
- Initialize child mediators recursively
- Specified by:
init
in interface ManagedLifecycle
- Overrides:
init
in class AbstractListMediator
- Parameters:
se
- synapse environment
destroy
public void destroy()
- Description copied from class:
AbstractListMediator
- Destroy child mediators recursively
- Specified by:
destroy
in interface ManagedLifecycle
- Overrides:
destroy
in class AbstractListMediator
mediate
public boolean mediate(MessageContext synCtx)
- Executes the list of sub/child mediators, if the filter condition is satisfied
- Specified by:
mediate
in interface Mediator
- Overrides:
mediate
in class AbstractListMediator
- Parameters:
synCtx
- the current message
- Returns:
- true if filter condition fails. else returns as per List mediator semantics
test
public boolean test(MessageContext synCtx)
- Tests the supplied condition after evaluation against the given XPath
or Regex (against a source XPath). When a regular expression is supplied
the source XPath is evaluated into a String value, and matched against
the given regex
- Specified by:
test
in interface FilterMediator
- Parameters:
synCtx
- the current message for evaluation of the test condition
- Returns:
- true if evaluation of the XPath/Regex results in true
getSource
public SynapseXPath getSource()
setSource
public void setSource(SynapseXPath source)
getRegex
public Pattern getRegex()
setRegex
public void setRegex(Pattern regex)
getXpath
public SynapseXPath getXpath()
setXpath
public void setXpath(SynapseXPath xpath)
getElseMediator
public ListMediator getElseMediator()
setElseMediator
public void setElseMediator(ListMediator elseMediator)
isThenElementPresent
public boolean isThenElementPresent()
setThenElementPresent
public void setThenElementPresent(boolean thenElementPresent)
getThenKey
public String getThenKey()
setThenKey
public void setThenKey(String thenKey)
getElseKey
public String getElseKey()
setElseKey
public void setElseKey(String elseKey)
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.