1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-12 14:44:49 +02:00
Smack/extensions/src/main/java/org/jivesoftware/smackx
Florian Schmaus 7bd7b3d24c Improve packet send and result collecting API
Instead of repeating the same pattern, when sending an IQ get/set packet
and collecting the response

PacketFilter filter = new PacketIDFilter(request.getPacketID()),
PacketCollector collector = connection.createPacketCollector(filter);
connection.sendPacket(reg);
IQ result = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
// Stop queuing results
collector.cancel();
if (result == null) {
    throw new XMPPException("No response from server.");
}
else if (result.getType() == IQ.Type.ERROR) {
    throw new XMPPException(result.getError());
}

the API got redesigned, so that the above code block can be replaced
with

Packet result = connection.createPacketCollectorAndSend(request).nextResultOrThrow();
2014-02-18 19:39:47 +01:00
..
address Activate checkstyle and add missing license headers 2014-02-17 20:09:55 +01:00
attention/packet Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
bookmarks Move EntityCaps and Bookmarks API in correct package 2014-02-18 10:24:59 +01:00
bytestreams Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
caps Move EntityCaps and Bookmarks API in correct package 2014-02-18 10:24:59 +01:00
chatstates Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
commands Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
delay Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
disco Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
filetransfer Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
forward Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
iqlast Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
iqprivate Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
iqversion/packet Activate checkstyle and add missing license headers 2014-02-17 20:09:55 +01:00
muc Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
nick/packet Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
offline Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
pep Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ping Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
privacy Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
pubsub Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
receipts Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
search Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
sharedgroups Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
shim Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
si Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
time/packet Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
vcardtemp Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
xdata Activate checkstyle and add missing license headers 2014-02-17 20:09:55 +01:00
xevent Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
xhtmlim Activate checkstyle and add missing license headers 2014-02-17 20:09:55 +01:00
xroster Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ExtensionsProviderInitializer.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ExtensionsStartupClasses.java Activate checkstyle and add missing license headers 2014-02-17 20:09:55 +01:00