1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-16 12:12:06 +01:00
Smack/extensions/src/main/java/org/jivesoftware/smackx/pubsub
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
..
listener Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
packet Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
provider Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
util Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
AccessModel.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
Affiliation.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
AffiliationsExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ChildrenAssociationPolicy.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
CollectionNode.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ConfigurationEvent.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ConfigureForm.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ConfigureNodeFields.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
EmbeddedPacketExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
EventElement.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
EventElementType.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
FormNode.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
FormNodeType.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
FormType.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
GetItemsRequest.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
Item.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ItemDeleteEvent.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ItemPublishEvent.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ItemReply.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
ItemsExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
LeafNode.java Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
Node.java Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
NodeEvent.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
NodeExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
NodeType.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
OptionsExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
PayloadItem.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
PresenceState.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
PublishItem.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
PublishModel.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
PubSubElementType.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
PubSubManager.java Improve packet send and result collecting API 2014-02-18 19:39:47 +01:00
RetractItem.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
SimplePayload.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
SubscribeExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
SubscribeForm.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
SubscribeOptionFields.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
Subscription.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
SubscriptionEvent.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
SubscriptionsExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
UnsubscribeExtension.java Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00