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

Change IQ.Type to enum

This commit is contained in:
Júlio Cesar Bueno Cotta 2014-06-05 21:20:45 -03:00
parent 944ac37fc3
commit 9be0c480e3
90 changed files with 284 additions and 299 deletions

View file

@ -70,7 +70,7 @@ public class Agent {
*/
public String getName() throws NoResponseException, XMPPErrorException, NotConnectedException {
AgentInfo agentInfo = new AgentInfo();
agentInfo.setType(IQ.Type.GET);
agentInfo.setType(IQ.Type.get);
agentInfo.setTo(workgroupJID);
agentInfo.setFrom(getUser());
AgentInfo response = (AgentInfo) connection.createPacketCollectorAndSend(agentInfo).nextResultOrThrow();
@ -90,7 +90,7 @@ public class Agent {
*/
public void setName(String newName) throws NoResponseException, XMPPErrorException, NotConnectedException {
AgentInfo agentInfo = new AgentInfo();
agentInfo.setType(IQ.Type.SET);
agentInfo.setType(IQ.Type.set);
agentInfo.setTo(workgroupJID);
agentInfo.setFrom(getUser());
agentInfo.setName(newName);

View file

@ -509,7 +509,7 @@ public class AgentSession {
*/
public OccupantsInfo getOccupantsInfo(String roomID) throws NoResponseException, XMPPErrorException, NotConnectedException {
OccupantsInfo request = new OccupantsInfo(roomID);
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
OccupantsInfo response = (OccupantsInfo) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
@ -674,7 +674,7 @@ public class AgentSession {
};
reply.setPacketID(packet.getPacketID());
reply.setTo(packet.getFrom());
reply.setType(IQ.Type.RESULT);
reply.setType(IQ.Type.result);
connection.sendPacket(reply);
fireOfferRequestEvent((OfferRequestProvider.OfferRequestPacket)packet);
@ -769,7 +769,7 @@ public class AgentSession {
}
};
reply.setPacketID(packet.getPacketID());
reply.setType(IQ.Type.RESULT);
reply.setType(IQ.Type.result);
connection.sendPacket(reply);
fireOfferRevokeEvent((OfferRevokeProvider.OfferRevokePacket)packet);
@ -787,7 +787,7 @@ public class AgentSession {
*/
public void setNote(String sessionID, String note) throws NoResponseException, XMPPErrorException, NotConnectedException {
ChatNotes notes = new ChatNotes();
notes.setType(IQ.Type.SET);
notes.setType(IQ.Type.set);
notes.setTo(workgroupJID);
notes.setSessionID(sessionID);
notes.setNotes(note);
@ -805,7 +805,7 @@ public class AgentSession {
*/
public ChatNotes getNote(String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException {
ChatNotes request = new ChatNotes();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
request.setSessionID(sessionID);
@ -831,7 +831,7 @@ public class AgentSession {
request = new AgentChatHistory(jid, maxSessions);
}
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
AgentChatHistory response = (AgentChatHistory) connection.createPacketCollectorAndSend(
@ -850,7 +850,7 @@ public class AgentSession {
*/
public SearchSettings getSearchSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
SearchSettings request = new SearchSettings();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
SearchSettings response = (SearchSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
@ -868,7 +868,7 @@ public class AgentSession {
*/
public MacroGroup getMacros(boolean global) throws NoResponseException, XMPPErrorException, NotConnectedException {
Macros request = new Macros();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
request.setPersonal(!global);
@ -886,7 +886,7 @@ public class AgentSession {
*/
public void saveMacros(MacroGroup group) throws NoResponseException, XMPPErrorException, NotConnectedException {
Macros request = new Macros();
request.setType(IQ.Type.SET);
request.setType(IQ.Type.set);
request.setTo(workgroupJID);
request.setPersonal(true);
request.setPersonalMacroGroup(group);
@ -904,7 +904,7 @@ public class AgentSession {
*/
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException, NotConnectedException {
ChatMetadata request = new ChatMetadata();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
request.setSessionID(sessionID);
@ -950,7 +950,7 @@ public class AgentSession {
return invitation.toXML();
}
};
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
iq.setTo(workgroupJID);
iq.setFrom(connection.getUser());
@ -992,7 +992,7 @@ public class AgentSession {
return transfer.toXML();
}
};
iq.setType(IQ.Type.SET);
iq.setType(IQ.Type.set);
iq.setTo(workgroupJID);
iq.setFrom(connection.getUser());
@ -1011,7 +1011,7 @@ public class AgentSession {
*/
public GenericSettings getGenericSettings(XMPPConnection con, String query) throws NoResponseException, XMPPErrorException, NotConnectedException {
GenericSettings setting = new GenericSettings();
setting.setType(IQ.Type.GET);
setting.setType(IQ.Type.get);
setting.setTo(workgroupJID);
GenericSettings response = (GenericSettings) connection.createPacketCollectorAndSend(
@ -1021,7 +1021,7 @@ public class AgentSession {
public boolean hasMonitorPrivileges(XMPPConnection con) throws NoResponseException, XMPPErrorException, NotConnectedException {
MonitorPacket request = new MonitorPacket();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
MonitorPacket response = (MonitorPacket) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
@ -1030,7 +1030,7 @@ public class AgentSession {
public void makeRoomOwner(XMPPConnection con, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException {
MonitorPacket request = new MonitorPacket();
request.setType(IQ.Type.SET);
request.setType(IQ.Type.set);
request.setTo(workgroupJID);
request.setSessionID(sessionID);

View file

@ -195,7 +195,7 @@ public class Offer {
RejectPacket(String workgroup) {
this.setTo(workgroup);
this.setType(IQ.Type.SET);
this.setType(IQ.Type.set);
}
public String getChildElementXML() {
@ -211,7 +211,7 @@ public class Offer {
AcceptPacket(String workgroup) {
this.setTo(workgroup);
this.setType(IQ.Type.SET);
this.setType(IQ.Type.set);
}
public String getChildElementXML() {

View file

@ -99,7 +99,7 @@ public class OfferConfirmation extends IQ {
NotifyServicePacket(String workgroup, String roomName) {
this.setTo(workgroup);
this.setType(IQ.Type.RESULT);
this.setType(IQ.Type.result);
this.roomName = roomName;
}

View file

@ -53,7 +53,7 @@ public class TranscriptSearchManager {
*/
public Form getSearchForm(String serviceJID) throws NoResponseException, XMPPErrorException, NotConnectedException {
TranscriptSearch search = new TranscriptSearch();
search.setType(IQ.Type.GET);
search.setType(IQ.Type.get);
search.setTo(serviceJID);
TranscriptSearch response = (TranscriptSearch) connection.createPacketCollectorAndSend(
@ -75,7 +75,7 @@ public class TranscriptSearchManager {
*/
public ReportedData submitSearch(String serviceJID, Form completedForm) throws NoResponseException, XMPPErrorException, NotConnectedException {
TranscriptSearch search = new TranscriptSearch();
search.setType(IQ.Type.GET);
search.setType(IQ.Type.get);
search.setTo(serviceJID);
search.addExtension(completedForm.getDataFormToSend());

View file

@ -54,7 +54,7 @@ public class DepartQueuePacket extends IQ {
this.user = user;
setTo(workgroup);
setType(IQ.Type.SET);
setType(IQ.Type.set);
setFrom(user);
}

View file

@ -100,7 +100,7 @@ public class OfferRequestProvider implements IQProvider {
OfferRequestPacket offerRequest =
new OfferRequestPacket(userJID, userID, timeout, metaData, sessionID, content);
offerRequest.setType(IQ.Type.SET);
offerRequest.setType(IQ.Type.set);
return offerRequest;
}

View file

@ -567,7 +567,7 @@ public class Workgroup {
this.userID = userID;
setTo(workgroup);
setType(IQ.Type.SET);
setType(IQ.Type.set);
form = answerForm.getDataFormToSend();
addExtension(form);
@ -645,7 +645,7 @@ public class Workgroup {
if (type != -1) {
request.setType(type);
}
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
ChatSettings response = (ChatSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
@ -683,7 +683,7 @@ public class Workgroup {
*/
public OfflineSettings getOfflineSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
OfflineSettings request = new OfflineSettings();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
OfflineSettings response = (OfflineSettings) connection.createPacketCollectorAndSend(
@ -701,7 +701,7 @@ public class Workgroup {
*/
public SoundSettings getSoundSettings() throws NoResponseException, XMPPErrorException, NotConnectedException {
SoundSettings request = new SoundSettings();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
SoundSettings response = (SoundSettings) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
@ -718,7 +718,7 @@ public class Workgroup {
*/
public WorkgroupProperties getWorkgroupProperties() throws NoResponseException, XMPPErrorException, NotConnectedException {
WorkgroupProperties request = new WorkgroupProperties();
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
WorkgroupProperties response = (WorkgroupProperties) connection.createPacketCollectorAndSend(
@ -738,7 +738,7 @@ public class Workgroup {
public WorkgroupProperties getWorkgroupProperties(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException {
WorkgroupProperties request = new WorkgroupProperties();
request.setJid(jid);
request.setType(IQ.Type.GET);
request.setType(IQ.Type.get);
request.setTo(workgroupJID);
WorkgroupProperties response = (WorkgroupProperties) connection.createPacketCollectorAndSend(
@ -759,7 +759,7 @@ public class Workgroup {
*/
public Form getWorkgroupForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
WorkgroupForm workgroupForm = new WorkgroupForm();
workgroupForm.setType(IQ.Type.GET);
workgroupForm.setType(IQ.Type.get);
workgroupForm.setTo(workgroupJID);
WorkgroupForm response = (WorkgroupForm) connection.createPacketCollectorAndSend(