1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/

This commit is contained in:
Florian Schmaus 2017-01-03 11:12:34 +01:00
parent 9328182912
commit 90a5e289f8
100 changed files with 406 additions and 406 deletions

View file

@ -40,7 +40,7 @@ public class Agent {
public static Collection<String> getWorkgroups(Jid serviceJID, Jid agentJID, XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
AgentWorkgroups request = new AgentWorkgroups(agentJID);
request.setTo(serviceJID);
AgentWorkgroups response = (AgentWorkgroups) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
AgentWorkgroups response = (AgentWorkgroups) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response.getWorkgroups();
}
@ -75,7 +75,7 @@ public class Agent {
agentInfo.setType(IQ.Type.get);
agentInfo.setTo(workgroupJID);
agentInfo.setFrom(getUser());
AgentInfo response = (AgentInfo) connection.createPacketCollectorAndSend(agentInfo).nextResultOrThrow();
AgentInfo response = (AgentInfo) connection.createStanzaCollectorAndSend(agentInfo).nextResultOrThrow();
return response.getName();
}
@ -97,6 +97,6 @@ public class Agent {
agentInfo.setTo(workgroupJID);
agentInfo.setFrom(getUser());
agentInfo.setName(newName);
connection.createPacketCollectorAndSend(agentInfo).nextResultOrThrow();
connection.createStanzaCollectorAndSend(agentInfo).nextResultOrThrow();
}
}

View file

@ -283,7 +283,7 @@ public class AgentRoster {
* Listens for all presence packets and processes them.
*/
private class PresencePacketListener implements StanzaListener {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
Presence presence = (Presence)packet;
EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible();
if (from == null) {
@ -359,7 +359,7 @@ public class AgentRoster {
*/
private class AgentStatusListener implements StanzaListener {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
if (packet instanceof AgentStatusRequest) {
AgentStatusRequest statusRequest = (AgentStatusRequest)packet;
for (Iterator<AgentStatusRequest.Item> i = statusRequest.getAgents().iterator(); i.hasNext();) {

View file

@ -29,7 +29,7 @@ import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.StanzaCollector;
import org.jivesoftware.smack.StanzaListener;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NoResponseException;
@ -147,7 +147,7 @@ public class AgentSession {
new StanzaTypeFilter(Message.class));
packetListener = new StanzaListener() {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
try {
handlePacket(packet);
}
@ -335,7 +335,7 @@ public class AgentSession {
presence.addExtension(new StandardExtensionElement(AgentStatus.ELEMENT_NAME,
AgentStatus.NAMESPACE));
PacketCollector collector = this.connection.createPacketCollectorAndSend(new AndFilter(
StanzaCollector collector = this.connection.createStanzaCollectorAndSend(new AndFilter(
new StanzaTypeFilter(Presence.class), FromMatchesFilter.create(workgroupJID)), presence);
presence = (Presence)collector.nextResultOrThrow();
@ -437,7 +437,7 @@ public class AgentSession {
presence.addExtension(builder.build());
presence.addExtension(new MetaData(this.metaData));
PacketCollector collector = this.connection.createPacketCollectorAndSend(new AndFilter(
StanzaCollector collector = this.connection.createStanzaCollectorAndSend(new AndFilter(
new StanzaTypeFilter(Presence.class),
FromMatchesFilter.create(workgroupJID)), presence);
@ -482,7 +482,7 @@ public class AgentSession {
}
presence.addExtension(new MetaData(this.metaData));
PacketCollector collector = this.connection.createPacketCollectorAndSend(new AndFilter(new StanzaTypeFilter(Presence.class),
StanzaCollector collector = this.connection.createStanzaCollectorAndSend(new AndFilter(new StanzaTypeFilter(Presence.class),
FromMatchesFilter.create(workgroupJID)), presence);
collector.nextResultOrThrow();
@ -581,7 +581,7 @@ public class AgentSession {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
OccupantsInfo response = (OccupantsInfo) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
OccupantsInfo response = (OccupantsInfo) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
@ -837,7 +837,7 @@ public class AgentSession {
notes.setTo(workgroupJID);
notes.setSessionID(sessionID);
notes.setNotes(note);
connection.createPacketCollectorAndSend(notes).nextResultOrThrow();
connection.createStanzaCollectorAndSend(notes).nextResultOrThrow();
}
/**
@ -856,7 +856,7 @@ public class AgentSession {
request.setTo(workgroupJID);
request.setSessionID(sessionID);
ChatNotes response = (ChatNotes) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
ChatNotes response = (ChatNotes) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
@ -882,7 +882,7 @@ public class AgentSession {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
AgentChatHistory response = connection.createPacketCollectorAndSend(
AgentChatHistory response = connection.createStanzaCollectorAndSend(
request).nextResult();
return response;
@ -902,7 +902,7 @@ public class AgentSession {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
SearchSettings response = (SearchSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
SearchSettings response = (SearchSettings) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
@ -922,7 +922,7 @@ public class AgentSession {
request.setTo(workgroupJID);
request.setPersonal(!global);
Macros response = (Macros) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
Macros response = (Macros) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response.getRootGroup();
}
@ -942,7 +942,7 @@ public class AgentSession {
request.setPersonal(true);
request.setPersonalMacroGroup(group);
connection.createPacketCollectorAndSend(request).nextResultOrThrow();
connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
}
/**
@ -960,7 +960,7 @@ public class AgentSession {
request.setTo(workgroupJID);
request.setSessionID(sessionID);
ChatMetadata response = connection.createPacketCollectorAndSend(request).nextResult();
ChatMetadata response = connection.createStanzaCollectorAndSend(request).nextResult();
return response.getMetadata();
}
@ -1002,7 +1002,7 @@ public class AgentSession {
iq.setTo(workgroupJID);
iq.setFrom(connection.getUser());
connection.createPacketCollectorAndSend(iq).nextResultOrThrow();
connection.createStanzaCollectorAndSend(iq).nextResultOrThrow();
}
/**
@ -1040,7 +1040,7 @@ public class AgentSession {
iq.setTo(workgroupJID);
iq.setFrom(connection.getUser());
connection.createPacketCollectorAndSend(iq).nextResultOrThrow();
connection.createStanzaCollectorAndSend(iq).nextResultOrThrow();
}
/**
@ -1059,7 +1059,7 @@ public class AgentSession {
setting.setType(IQ.Type.get);
setting.setTo(workgroupJID);
GenericSettings response = (GenericSettings) connection.createPacketCollectorAndSend(
GenericSettings response = (GenericSettings) connection.createStanzaCollectorAndSend(
setting).nextResultOrThrow();
return response;
}
@ -1069,7 +1069,7 @@ public class AgentSession {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
MonitorPacket response = (MonitorPacket) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
MonitorPacket response = (MonitorPacket) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response.isMonitor();
}
@ -1079,6 +1079,6 @@ public class AgentSession {
request.setTo(workgroupJID);
request.setSessionID(sessionID);
connection.createPacketCollectorAndSend(request).nextResultOrThrow();
connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
}
}

View file

@ -53,7 +53,7 @@ public class TranscriptManager {
public Transcript getTranscript(Jid workgroupJID, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Transcript request = new Transcript(sessionID);
request.setTo(workgroupJID);
Transcript response = (Transcript) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
Transcript response = (Transcript) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
@ -72,7 +72,7 @@ public class TranscriptManager {
public Transcripts getTranscripts(Jid workgroupJID, Jid userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
Transcripts response = (Transcripts) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
Transcripts response = (Transcripts) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
}

View file

@ -58,7 +58,7 @@ public class TranscriptSearchManager {
search.setType(IQ.Type.get);
search.setTo(serviceJID);
TranscriptSearch response = (TranscriptSearch) connection.createPacketCollectorAndSend(
TranscriptSearch response = (TranscriptSearch) connection.createStanzaCollectorAndSend(
search).nextResultOrThrow();
return Form.getFormFrom(response);
}
@ -82,7 +82,7 @@ public class TranscriptSearchManager {
search.setTo(serviceJID);
search.addExtension(completedForm.getDataFormToSend());
TranscriptSearch response = (TranscriptSearch) connection.createPacketCollectorAndSend(
TranscriptSearch response = (TranscriptSearch) connection.createStanzaCollectorAndSend(
search).nextResultOrThrow();
return ReportedData.getReportedDataFrom(response);
}

View file

@ -21,7 +21,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.StanzaCollector;
import org.jivesoftware.smack.StanzaListener;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NoResponseException;
@ -145,7 +145,7 @@ public class Workgroup {
StanzaFilter typeFilter = new StanzaTypeFilter(Message.class);
connection.addAsyncStanzaListener(new StanzaListener() {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
handlePacket(packet);
}
}, typeFilter);
@ -184,7 +184,7 @@ public class Workgroup {
directedPresence.setTo(workgroupJID);
StanzaFilter typeFilter = new StanzaTypeFilter(Presence.class);
StanzaFilter fromFilter = FromMatchesFilter.create(workgroupJID);
PacketCollector collector = connection.createPacketCollectorAndSend(new AndFilter(fromFilter,
StanzaCollector collector = connection.createStanzaCollectorAndSend(new AndFilter(fromFilter,
typeFilter), directedPresence);
Presence response = (Presence)collector.nextResultOrThrow();
@ -342,7 +342,7 @@ public class Workgroup {
JoinQueuePacket joinPacket = new JoinQueuePacket(workgroupJID, answerForm, userID);
connection.createPacketCollectorAndSend(joinPacket).nextResultOrThrow();
connection.createStanzaCollectorAndSend(joinPacket).nextResultOrThrow();
// Notify listeners that we've joined the queue.
fireQueueJoinedEvent();
}
@ -424,7 +424,7 @@ public class Workgroup {
}
DepartQueuePacket departPacket = new DepartQueuePacket(this.workgroupJID);
connection.createPacketCollectorAndSend(departPacket).nextResultOrThrow();
connection.createStanzaCollectorAndSend(departPacket).nextResultOrThrow();
// Notify listeners that we're no longer in the queue.
fireQueueDepartedEvent();
@ -649,7 +649,7 @@ public class Workgroup {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
ChatSettings response = (ChatSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
ChatSettings response = (ChatSettings) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
@ -689,7 +689,7 @@ public class Workgroup {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
OfflineSettings response = (OfflineSettings) connection.createPacketCollectorAndSend(
OfflineSettings response = (OfflineSettings) connection.createStanzaCollectorAndSend(
request).nextResultOrThrow();
return response;
}
@ -708,7 +708,7 @@ public class Workgroup {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
SoundSettings response = (SoundSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
SoundSettings response = (SoundSettings) connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
return response;
}
@ -726,7 +726,7 @@ public class Workgroup {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
WorkgroupProperties response = (WorkgroupProperties) connection.createPacketCollectorAndSend(
WorkgroupProperties response = (WorkgroupProperties) connection.createStanzaCollectorAndSend(
request).nextResultOrThrow();
return response;
}
@ -747,7 +747,7 @@ public class Workgroup {
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
WorkgroupProperties response = (WorkgroupProperties) connection.createPacketCollectorAndSend(
WorkgroupProperties response = (WorkgroupProperties) connection.createStanzaCollectorAndSend(
request).nextResultOrThrow();
return response;
}
@ -769,7 +769,7 @@ public class Workgroup {
workgroupForm.setType(IQ.Type.get);
workgroupForm.setTo(workgroupJID);
WorkgroupForm response = (WorkgroupForm) connection.createPacketCollectorAndSend(
WorkgroupForm response = (WorkgroupForm) connection.createStanzaCollectorAndSend(
workgroupForm).nextResultOrThrow();
return Form.getFormFrom(response);
}

View file

@ -77,7 +77,7 @@ public final class MessageEventManager extends Manager {
super(connection);
// Listens for all message event packets and fire the proper message event listeners.
connection.addAsyncStanzaListener(new StanzaListener() {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
Message message = (Message) packet;
MessageEvent messageEvent =
(MessageEvent) message.getExtension("x", "jabber:x:event");

View file

@ -78,7 +78,7 @@ public class RosterExchangeManager {
weakRefConnection = new WeakReference<XMPPConnection>(connection);
// Listens for all roster exchange packets and fire the roster exchange listeners.
packetListener = new StanzaListener() {
public void processPacket(Stanza packet) {
public void processStanza(Stanza packet) {
Message message = (Message) packet;
RosterExchange rosterExchange =
(RosterExchange) message.getExtension(ELEMENT, NAMESPACE);