View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.xmpp.filters;
8   
9   import org.jivesoftware.smack.filter.MessageTypeFilter;
10  import org.jivesoftware.smack.filter.PacketFilter;
11  import org.jivesoftware.smack.packet.Message;
12  
13  /**
14   * <code>XmppMessageTypeFilter</code> is an Xmpp MessageTypeFilter adapter.
15   */
16  public class XmppMessageTypeFilter extends XmppFromContainsFilter
17  {
18      public XmppMessageTypeFilter()
19      {
20          super();
21      }
22  
23      public XmppMessageTypeFilter(String expression)
24      {
25          super(expression);
26      }
27  
28      @Override
29      protected PacketFilter createFilter()
30      {
31          return new MessageTypeFilter(Message.Type.fromString(pattern));
32      }
33  }