|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jivesoftware.smack.PacketCollector
public class PacketCollector
Provides a mechanism to collect packets into a result queue that pass a
specified filter. The collector lets you perform blocking and polling
operations on the result queue. So, a PacketCollector is more suitable to
use than a PacketListener when you need to wait for a specific
result.
Each packet collector will queue up a configured number of packets for processing before
older packets are automatically dropped. The default number is retrieved by
SmackConfiguration.getPacketCollectorSize().
Connection.createPacketCollector(PacketFilter)| Method Summary | |
|---|---|
void |
cancel()
Explicitly cancels the packet collector so that no more results are queued up. |
PacketFilter |
getPacketFilter()
Returns the packet filter associated with this packet collector. |
Packet |
nextResult()
Returns the next available packet. |
Packet |
nextResult(long timeout)
Returns the next available packet. |
Packet |
pollResult()
Polls to see if a packet is currently available and returns it, or immediately returns null if no packets are currently in the result queue. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void cancel()
public PacketFilter getPacketFilter()
public Packet pollResult()
public Packet nextResult()
public Packet nextResult(long timeout)
timeout - the amount of time to wait for the next packet (in milleseconds).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||