org.mule.routing.filters
Class MessagePropertyFilter

java.lang.Object
  extended by org.mule.routing.filters.MessagePropertyFilter
All Implemented Interfaces:
Filter

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.


Field Summary
protected  Log logger
          logger used by this class
 
Constructor Summary
MessagePropertyFilter()
           
MessagePropertyFilter(String expression)
           
 
Method Summary
 boolean accept(MuleMessage message)
          Check a given message against this filter.
protected  boolean compare(String value1, String value2)
           
 boolean equals(Object obj)
           
 String getPattern()
           
 int hashCode()
           
 boolean isCaseSensitive()
           
 void setCaseSensitive(boolean caseSensitive)
           
 void setPattern(String expression)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final transient Log logger
logger used by this class

Constructor Detail

MessagePropertyFilter

public MessagePropertyFilter()

MessagePropertyFilter

public MessagePropertyFilter(String expression)
Method Detail

accept

public boolean accept(MuleMessage message)
Description copied from interface: Filter
Check a given message against this filter.

Specified by:
accept in interface Filter
Parameters:
message - a non null message to filter.
Returns:
true if the message matches the filter

compare

protected boolean compare(String value1,
                          String value2)

getPattern

public String getPattern()

setPattern

public void setPattern(String expression)

isCaseSensitive

public boolean isCaseSensitive()

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.