public class MessagePropertyFilter extends Object implements Filter
MessagePropertyFilter can be used to filter against properties on an event. This can be very useful as the event
properties represent all the meta information about the event from the underlying transport, so for an event received over HTTP
you can check for HTTP headers etc. The pattern should be expressed as a key/value pair, i.e. "propertyName=value". If you want
to compare more than one property you can use the logic filters for And, Or and Not expressions. By default the comparison is
case sensitive; you can set the caseSensitive property to override this.
Since 3.0.0 its possible to set the property value as a wildcard expression i.e.
fooHeader = *foo*
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger
logger used by this class
|
| Constructor and Description |
|---|
MessagePropertyFilter() |
MessagePropertyFilter(String expression) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(org.mule.runtime.api.message.Message message,
Event.Builder builder)
Checks a given message against this filter.
|
protected boolean |
compare(String value1,
String value2) |
boolean |
equals(Object obj) |
String |
getPattern() |
String |
getScope() |
int |
hashCode() |
boolean |
isCaseSensitive() |
void |
setCaseSensitive(boolean caseSensitive) |
void |
setPattern(String expression) |
void |
setScope(String scope) |
public MessagePropertyFilter()
public MessagePropertyFilter(String expression)
public boolean accept(org.mule.runtime.api.message.Message message,
Event.Builder builder)
FilterTODO MULE-9142 See how this API can be improved to not need the builder.
accept in interface Filtermessage - a non null message to filter.builder - an event builder in case the filter needs to make changes to the event.true if the message matches the filter TODO MULE-9341 Remove Filters that are not needed. This method
will be removed when filters are cleaned up.public String getPattern()
public void setPattern(String expression)
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
public String getScope()
public void setScope(String scope)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.