KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > xmpp > filters > XmppAndFilter


1 /*
2  * $Id: XmppAndFilter.java 4219 2006-12-09 10:15:14Z lajos $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.xmpp.filters;
12
13 import org.jivesoftware.smack.filter.AndFilter;
14 import org.jivesoftware.smack.filter.PacketFilter;
15
16 /**
17  * <code>XmppAndFilter</code> an Xmpp AND filter
18  */

19 public class XmppAndFilter extends AbstractXmppFilter
20 {
21     private volatile PacketFilter leftFilter;
22     private volatile PacketFilter rightFilter;
23
24     public XmppAndFilter()
25     {
26         super();
27     }
28
29     public XmppAndFilter(PacketFilter left, PacketFilter right)
30     {
31         this.leftFilter = left;
32         this.rightFilter = right;
33     }
34
35     public void setLeftFilter(PacketFilter left)
36     {
37         this.leftFilter = left;
38     }
39
40     public void setRightFilter(PacketFilter right)
41     {
42         this.leftFilter = right;
43     }
44
45     public PacketFilter getLeftFilter()
46     {
47         return leftFilter;
48     }
49
50     public PacketFilter getRightFilter()
51     {
52         return rightFilter;
53     }
54
55     protected PacketFilter createFilter()
56     {
57         return new AndFilter(leftFilter, rightFilter);
58     }
59 }
60
Popular Tags