mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-11 23:51:09 +01:00
s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/
This commit is contained in:
parent
9328182912
commit
90a5e289f8
100 changed files with 406 additions and 406 deletions
|
|
@ -126,7 +126,7 @@ public final class IoTControlManager extends IoTManager {
|
|||
public IoTSetResponse setUsingIq(FullJid jid, Collection<? extends SetData> data) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
IoTSetRequest request = new IoTSetRequest(data);
|
||||
request.setTo(jid);
|
||||
IoTSetResponse response = connection().createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
IoTSetResponse response = connection().createStanzaCollectorAndSend(request).nextResultOrThrow();
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.logging.Level;
|
|||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.ConnectionCreationListener;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.StanzaCollector;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
|
|
@ -177,14 +177,14 @@ public final class IoTDataManager extends IoTManager {
|
|||
StanzaFilter dataFilter = new IoTFieldsExtensionFilter(seqNr, false);
|
||||
|
||||
// Setup the IoTFieldsExtension message collectors before sending the IQ to avoid a data race.
|
||||
PacketCollector doneCollector = connection.createPacketCollector(doneFilter);
|
||||
StanzaCollector doneCollector = connection.createStanzaCollector(doneFilter);
|
||||
|
||||
PacketCollector.Configuration dataCollectorConfiguration = PacketCollector.newConfiguration().setStanzaFilter(
|
||||
StanzaCollector.Configuration dataCollectorConfiguration = StanzaCollector.newConfiguration().setStanzaFilter(
|
||||
dataFilter).setCollectorToReset(doneCollector);
|
||||
PacketCollector dataCollector = connection.createPacketCollector(dataCollectorConfiguration);
|
||||
StanzaCollector dataCollector = connection.createStanzaCollector(dataCollectorConfiguration);
|
||||
|
||||
try {
|
||||
connection.createPacketCollectorAndSend(iotDataRequest).nextResultOrThrow();
|
||||
connection.createStanzaCollectorAndSend(iotDataRequest).nextResultOrThrow();
|
||||
// Wait until a message with an IoTFieldsExtension and the done flag comes in.
|
||||
doneCollector.nextResult();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ public final class IoTDiscoveryManager extends Manager {
|
|||
final XMPPConnection connection = connection();
|
||||
IoTRegister iotRegister = new IoTRegister(thing.getMetaTags(), thing.getNodeInfo(), thing.isSelfOwened());
|
||||
iotRegister.setTo(registry);
|
||||
IQ result = connection.createPacketCollectorAndSend(iotRegister).nextResultOrThrow();
|
||||
IQ result = connection.createStanzaCollectorAndSend(iotRegister).nextResultOrThrow();
|
||||
if (result instanceof IoTClaimed) {
|
||||
IoTClaimed iotClaimedResult = (IoTClaimed) result;
|
||||
throw new IoTClaimedException(iotClaimedResult);
|
||||
|
|
@ -288,7 +288,7 @@ public final class IoTDiscoveryManager extends Manager {
|
|||
|
||||
IoTMine iotMine = new IoTMine(metaTags, publicThing);
|
||||
iotMine.setTo(registry);
|
||||
IoTClaimed iotClaimed = connection().createPacketCollectorAndSend(iotMine).nextResultOrThrow();
|
||||
IoTClaimed iotClaimed = connection().createStanzaCollectorAndSend(iotMine).nextResultOrThrow();
|
||||
|
||||
// The 'jid' attribute of the <claimed/> response now represents the XMPP address of the thing we just successfully claimed.
|
||||
Jid thing = iotClaimed.getJid();
|
||||
|
|
@ -317,7 +317,7 @@ public final class IoTDiscoveryManager extends Manager {
|
|||
|
||||
IoTRemove iotRemove = new IoTRemove(thing, nodeInfo);
|
||||
iotRemove.setTo(registry);
|
||||
connection().createPacketCollectorAndSend(iotRemove).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(iotRemove).nextResultOrThrow();
|
||||
|
||||
// We no not update the ThingState here, as this is done in the <removed/> IQ handler above.;
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ public final class IoTDiscoveryManager extends Manager {
|
|||
|
||||
IoTUnregister iotUnregister = new IoTUnregister(nodeInfo);
|
||||
iotUnregister.setTo(registry);
|
||||
connection().createPacketCollectorAndSend(iotUnregister).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(iotUnregister).nextResultOrThrow();
|
||||
|
||||
ThingState state = getStateFor(nodeInfo);
|
||||
state.setUnregistered();
|
||||
|
|
@ -370,7 +370,7 @@ public final class IoTDiscoveryManager extends Manager {
|
|||
|
||||
IoTDisown iotDisown = new IoTDisown(thing, nodeInfo);
|
||||
iotDisown.setTo(registry);
|
||||
connection().createPacketCollectorAndSend(iotDisown).nextResultOrThrow();
|
||||
connection().createStanzaCollectorAndSend(iotDisown).nextResultOrThrow();
|
||||
}
|
||||
|
||||
// Registry utility methods
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public final class IoTProvisioningManager extends Manager {
|
|||
// Stanza listener for XEP-0324 § 3.2.3.
|
||||
connection.addAsyncStanzaListener(new StanzaListener() {
|
||||
@Override
|
||||
public void processPacket(Stanza stanza) throws NotConnectedException, InterruptedException {
|
||||
public void processStanza(Stanza stanza) throws NotConnectedException, InterruptedException {
|
||||
if (!isFromProvisioningService(stanza, true)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ public final class IoTProvisioningManager extends Manager {
|
|||
// (yet) part of the XEP.
|
||||
connection.addAsyncStanzaListener(new StanzaListener() {
|
||||
@Override
|
||||
public void processPacket(final Stanza stanza) throws NotConnectedException, InterruptedException {
|
||||
public void processStanza(final Stanza stanza) throws NotConnectedException, InterruptedException {
|
||||
final Message friendMessage = (Message) stanza;
|
||||
final Friend friend = Friend.from(friendMessage);
|
||||
final BareJid friendJid = friend.getFriend();
|
||||
|
|
@ -337,7 +337,7 @@ public final class IoTProvisioningManager extends Manager {
|
|||
|
||||
IoTIsFriend iotIsFriend = new IoTIsFriend(friendInQuestion);
|
||||
iotIsFriend.setTo(provisioningServer);
|
||||
IoTIsFriendResponse response = connection().createPacketCollectorAndSend(iotIsFriend).nextResultOrThrow();
|
||||
IoTIsFriendResponse response = connection().createStanzaCollectorAndSend(iotIsFriend).nextResultOrThrow();
|
||||
assert (response.getJid().equals(friendInQuestion));
|
||||
boolean isFriend = response.getIsFriendResult();
|
||||
if (!isFriend) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue