Class IQReplyFilter
- java.lang.Object
-
- org.jivesoftware.smack.filter.IQReplyFilter
-
- All Implemented Interfaces:
StanzaFilter,Predicate<Stanza>
- Direct Known Subclasses:
IQResultReplyFilter
public class IQReplyFilter extends java.lang.Object implements StanzaFilter
Filters for packets which are a valid reply to an IQ request.Such a stanza must have the same stanza id and must be an IQ stanza of type
RESULTorERROR. Moreover, it is necessary to check thefromaddress to ignore forged replies.We accept a
fromaddress if one of the following is true:- It matches the
toaddress of the request. - The
toaddress of the request was empty and thefromaddress matches either the bare jid of the server or the (bare or full jid) of the client. - To
towas our bare address and thefromis empty.
For a discussion of the issues, see the thread "Spoofing of iq ids and misbehaving servers" from 2014-01 on the jdev@jabber.org mailing list and following discussion in February and March.
-
-
Constructor Summary
Constructors Constructor Description IQReplyFilter(IQ iqPacket, XMPPConnection conn)Filters for packets which are a valid reply to an IQ request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Stanza packet)Tests whether or not the specified stanza should pass the filter.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.filter.StanzaFilter
asPredicate, test
-
-
-
-
Constructor Detail
-
IQReplyFilter
public IQReplyFilter(IQ iqPacket, XMPPConnection conn)
Filters for packets which are a valid reply to an IQ request.Such a stanza must have the same stanza id and must be an IQ stanza of type
RESULTorERROR. Moreover, it is necessary to check thefromaddress to ignore forged replies.We accept a
fromaddress if one of the following is true:- It matches the
toaddress of the request. - The
toaddress of the request was empty and thefromaddress matches either the bare jid of the server or the (bare or full jid) of the client. - To
towas our bare address and thefromis empty.
For a discussion of the issues, see the thread "Spoofing of iq ids and misbehaving servers" from 2014-01 on the jdev@jabber.org mailing list and following discussion in February and March.
- Parameters:
iqPacket- An IQ request. Filter for replies to this packet.conn- connection.
- It matches the
-
-
Method Detail
-
accept
public boolean accept(Stanza packet)
Description copied from interface:StanzaFilterTests whether or not the specified stanza should pass the filter.- Specified by:
acceptin interfaceStanzaFilter- Parameters:
packet- the stanza to test.- Returns:
- true if and only if
stanzapasses the filter.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-