Smack

org.jivesoftware.smack.filter
Class FromMatchesFilter

java.lang.Object
  extended by org.jivesoftware.smack.filter.FromMatchesFilter
All Implemented Interfaces:
PacketFilter

public class FromMatchesFilter
extends Object
implements PacketFilter

Filter for packets where the "from" field exactly matches a specified JID. If the specified address is a bare JID then the filter will match any address whose bare JID matches the specified JID. But if the specified address is a full JID then the filter will only match if the sender of the packet matches the specified resource.

Author:
Gaston Dombiak

Constructor Summary
FromMatchesFilter(String address)
          Creates a "from" filter using the "from" field part.
 
Method Summary
 boolean accept(Packet packet)
          Tests whether or not the specified packet should pass the filter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FromMatchesFilter

public FromMatchesFilter(String address)
Creates a "from" filter using the "from" field part. If the specified address is a bare JID then the filter will match any address whose bare JID matches the specified JID. But if the specified address is a full JID then the filter will only match if the sender of the packet matches the specified resource.

Parameters:
address - the from field value the packet must match. Could be a full or bare JID.
Method Detail

accept

public boolean accept(Packet packet)
Description copied from interface: PacketFilter
Tests whether or not the specified packet should pass the filter.

Specified by:
accept in interface PacketFilter
Parameters:
packet - the packet to test.
Returns:
true if and only if packet passes the filter.

toString

public String toString()
Overrides:
toString in class Object

Smack

Copyright © 2003-2007 Jive Software.