diff --git a/smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java b/smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java index 465669905..9213c6460 100644 --- a/smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java +++ b/smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java @@ -62,7 +62,7 @@ public class IQTest extends SmackTestCase { if (result == null) { fail("No response from server"); } - else if (result.getType() != IQ.Type.ERROR) { + else if (result.getType() != IQ.Type.error) { fail("The server didn't reply with an error packet"); } else { @@ -77,7 +77,7 @@ public class IQTest extends SmackTestCase { public void testFullJIDToOfflineUser() { // Request the version from the server. Version versionRequest = new Version(); - versionRequest.setType(IQ.Type.GET); + versionRequest.setType(IQ.Type.get); versionRequest.setFrom(getFullJID(0)); versionRequest.setTo(getBareJID(0) + "/Something"); @@ -92,7 +92,7 @@ public class IQTest extends SmackTestCase { // Stop queuing results collector.cancel(); assertNotNull("No response from server", result); - assertEquals("The server didn't reply with an error packet", IQ.Type.ERROR, result.getType()); + assertEquals("The server didn't reply with an error packet", IQ.Type.error, result.getType()); assertEquals("Server answered an incorrect error code", 503, result.getError().getCode()); } diff --git a/smack-core/src/integration-test/java/org/jivesoftware/smack/PacketReaderTest.java b/smack-core/src/integration-test/java/org/jivesoftware/smack/PacketReaderTest.java index 02eb10258..4a667a27f 100644 --- a/smack-core/src/integration-test/java/org/jivesoftware/smack/PacketReaderTest.java +++ b/smack-core/src/integration-test/java/org/jivesoftware/smack/PacketReaderTest.java @@ -79,7 +79,7 @@ public class PacketReaderTest extends SmackTestCase { } }; iqPacket.setTo(getFullJID(1)); - iqPacket.setType(IQ.Type.GET); + iqPacket.setType(IQ.Type.get); // Send the IQ and wait for the answer PacketCollector collector = getConnection(0).createPacketCollector( @@ -89,7 +89,7 @@ public class PacketReaderTest extends SmackTestCase { if (response == null) { fail("No response from the other user."); } - assertEquals("The received IQ is not of type ERROR", IQ.Type.ERROR, response.getType()); + assertEquals("The received IQ is not of type ERROR", IQ.Type.error, response.getType()); assertEquals("The error code is not 501", 501, response.getError().getCode()); collector.cancel(); } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AccountManager.java b/smack-core/src/main/java/org/jivesoftware/smack/AccountManager.java index bac4f77c3..f16509de7 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AccountManager.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AccountManager.java @@ -102,7 +102,7 @@ public class AccountManager extends Manager { // to discover if this feature is supported if (info == null) { getRegistrationInfo(); - accountCreationSupported = info.getType() != IQ.Type.ERROR; + accountCreationSupported = info.getType() != IQ.Type.error; } return accountCreationSupported; } @@ -220,7 +220,7 @@ public class AccountManager extends Manager { public void createAccount(String username, String password, Map attributes) throws NoResponseException, XMPPErrorException, NotConnectedException { Registration reg = new Registration(); - reg.setType(IQ.Type.SET); + reg.setType(IQ.Type.set); reg.setTo(connection().getServiceName()); attributes.put("username", username); attributes.put("password", password); @@ -240,7 +240,7 @@ public class AccountManager extends Manager { */ public void changePassword(String newPassword) throws NoResponseException, XMPPErrorException, NotConnectedException { Registration reg = new Registration(); - reg.setType(IQ.Type.SET); + reg.setType(IQ.Type.set); reg.setTo(connection().getServiceName()); Map map = new HashMap(); map.put("username",XmppStringUtils.parseLocalpart(connection().getUser())); @@ -261,7 +261,7 @@ public class AccountManager extends Manager { */ public void deleteAccount() throws NoResponseException, XMPPErrorException, NotConnectedException { Registration reg = new Registration(); - reg.setType(IQ.Type.SET); + reg.setType(IQ.Type.set); reg.setTo(connection().getServiceName()); Map attributes = new HashMap(); // To delete an account, we add a single attribute, "remove", that is blank. diff --git a/smack-core/src/main/java/org/jivesoftware/smack/Roster.java b/smack-core/src/main/java/org/jivesoftware/smack/Roster.java index b935cd516..7573c892f 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/Roster.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/Roster.java @@ -303,7 +303,7 @@ public class Roster { // Create and send roster entry creation packet. RosterPacket rosterPacket = new RosterPacket(); - rosterPacket.setType(IQ.Type.SET); + rosterPacket.setType(IQ.Type.set); RosterPacket.Item item = new RosterPacket.Item(user, name); if (groups != null) { for (String group : groups) { @@ -348,7 +348,7 @@ public class Roster { return; } RosterPacket packet = new RosterPacket(); - packet.setType(IQ.Type.SET); + packet.setType(IQ.Type.set); RosterPacket.Item item = RosterEntry.toRosterItem(entry); // Set the item type as REMOVE so that the server will delete the entry item.setItemType(RosterPacket.ItemType.remove); @@ -951,7 +951,7 @@ public class Roster { connection.removePacketListener(this); IQ result = (IQ)packet; - if (!result.getType().equals(IQ.Type.RESULT)) { + if (!result.getType().equals(IQ.Type.result)) { LOGGER.severe("Roster result IQ not of type result. Packet: " + result.toXML()); return; } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/RosterEntry.java b/smack-core/src/main/java/org/jivesoftware/smack/RosterEntry.java index 7c10f83d3..1ebba624d 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/RosterEntry.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/RosterEntry.java @@ -88,7 +88,7 @@ public class RosterEntry { } this.name = name; RosterPacket packet = new RosterPacket(); - packet.setType(IQ.Type.SET); + packet.setType(IQ.Type.set); packet.addRosterItem(toRosterItem(this)); connection.sendPacket(packet); } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/RosterGroup.java b/smack-core/src/main/java/org/jivesoftware/smack/RosterGroup.java index 3310b03ed..9007b0879 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/RosterGroup.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/RosterGroup.java @@ -77,7 +77,7 @@ public class RosterGroup { synchronized (entries) { for (RosterEntry entry : entries) { RosterPacket packet = new RosterPacket(); - packet.setType(IQ.Type.SET); + packet.setType(IQ.Type.set); RosterPacket.Item item = RosterEntry.toRosterItem(entry); item.removeGroupName(this.name); item.addGroupName(name); @@ -173,7 +173,7 @@ public class RosterGroup { synchronized (entries) { if (!entries.contains(entry)) { RosterPacket packet = new RosterPacket(); - packet.setType(IQ.Type.SET); + packet.setType(IQ.Type.set); RosterPacket.Item item = RosterEntry.toRosterItem(entry); item.addGroupName(getName()); packet.addRosterItem(item); @@ -207,7 +207,7 @@ public class RosterGroup { synchronized (entries) { if (entries.contains(entry)) { RosterPacket packet = new RosterPacket(); - packet.setType(IQ.Type.SET); + packet.setType(IQ.Type.set); RosterPacket.Item item = RosterEntry.toRosterItem(entry); item.removeGroupName(this.getName()); packet.addRosterItem(item); diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java index 666e51d24..782517a56 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java @@ -28,10 +28,10 @@ import org.jivesoftware.smack.packet.IQ.Type; */ public class IQTypeFilter extends FlexiblePacketTypeFilter { - public static final PacketFilter GET = new IQTypeFilter(Type.GET); - public static final PacketFilter SET = new IQTypeFilter(Type.SET); - public static final PacketFilter RESULT = new IQTypeFilter(Type.RESULT); - public static final PacketFilter ERROR = new IQTypeFilter(Type.ERROR); + public static final PacketFilter GET = new IQTypeFilter(Type.get); + public static final PacketFilter SET = new IQTypeFilter(Type.set); + public static final PacketFilter RESULT = new IQTypeFilter(Type.result); + public static final PacketFilter ERROR = new IQTypeFilter(Type.error); private final IQ.Type type; diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java index 595178d64..3c0546d5b 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java @@ -36,7 +36,7 @@ public class Bind extends IQ { private String jid = null; public Bind() { - setType(IQ.Type.SET); + setType(IQ.Type.set); } public String getResource() { diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java index 97d02323d..4182cf4da 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java @@ -18,6 +18,8 @@ package org.jivesoftware.smack.packet; import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; import org.jivesoftware.smack.util.XmlStringBuilder; @@ -39,8 +41,9 @@ import org.jivesoftware.smack.util.XmlStringBuilder; * @author Matt Tucker */ public abstract class IQ extends Packet { + private static final Logger LOGGER = Logger.getLogger(IQ.class.getName()); - private Type type = Type.GET; + private Type type = Type.get; public IQ() { super(); @@ -66,7 +69,7 @@ public abstract class IQ extends Packet { */ public void setType(Type type) { if (type == null) { - this.type = Type.GET; + this.type = Type.get; } else { this.type = type; @@ -107,23 +110,23 @@ public abstract class IQ extends Packet { public abstract CharSequence getChildElementXML(); /** - * Convenience method to create a new empty {@link Type#RESULT IQ.Type.RESULT} - * IQ based on a {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET} + * Convenience method to create a new empty {@link Type#result IQ.Type.result} + * IQ based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} * IQ. The new packet will be initialized with:
    *
  • The sender set to the recipient of the originating IQ. *
  • The recipient set to the sender of the originating IQ. - *
  • The type set to {@link Type#RESULT IQ.Type.RESULT}. + *
  • The type set to {@link Type#result IQ.Type.result}. *
  • The id set to the id of the originating IQ. *
  • No child element of the IQ element. *
* - * @param request the {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET} IQ packet. + * @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet. * @throws IllegalArgumentException if the IQ packet does not have a type of - * {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET}. - * @return a new {@link Type#RESULT IQ.Type.RESULT} IQ based on the originating IQ. + * {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}. + * @return a new {@link Type#result IQ.Type.result} IQ based on the originating IQ. */ public static IQ createResultIQ(final IQ request) { - if (!(request.getType() == Type.GET || request.getType() == Type.SET)) { + if (!(request.getType() == Type.get || request.getType() == Type.set)) { throw new IllegalArgumentException( "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML()); } @@ -132,7 +135,7 @@ public abstract class IQ extends Packet { return null; } }; - result.setType(Type.RESULT); + result.setType(Type.result); result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom()); @@ -140,25 +143,25 @@ public abstract class IQ extends Packet { } /** - * Convenience method to create a new {@link Type#ERROR IQ.Type.ERROR} IQ - * based on a {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET} + * Convenience method to create a new {@link Type#error IQ.Type.error} IQ + * based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} * IQ. The new packet will be initialized with:
    *
  • The sender set to the recipient of the originating IQ. *
  • The recipient set to the sender of the originating IQ. - *
  • The type set to {@link Type#ERROR IQ.Type.ERROR}. + *
  • The type set to {@link Type#error IQ.Type.error}. *
  • The id set to the id of the originating IQ. *
  • The child element contained in the associated originating IQ. *
  • The provided {@link XMPPError XMPPError}. *
* - * @param request the {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET} IQ packet. + * @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet. * @param error the error to associate with the created IQ packet. * @throws IllegalArgumentException if the IQ packet does not have a type of - * {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET}. - * @return a new {@link Type#ERROR IQ.Type.ERROR} IQ based on the originating IQ. + * {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}. + * @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ. */ public static IQ createErrorResponse(final IQ request, final XMPPError error) { - if (!(request.getType() == Type.GET || request.getType() == Type.SET)) { + if (!(request.getType() == Type.get || request.getType() == Type.set)) { throw new IllegalArgumentException( "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML()); } @@ -168,7 +171,7 @@ public abstract class IQ extends Packet { return request.getChildElementXML(); } }; - result.setType(Type.ERROR); + result.setType(Type.error); result.setPacketID(request.getPacketID()); result.setFrom(request.getTo()); result.setTo(request.getFrom()); @@ -177,59 +180,41 @@ public abstract class IQ extends Packet { } /** - * A class to represent the type of the IQ packet. The types are: + * A enum to represent the type of the IQ packet. The types are: * *
    - *
  • IQ.Type.GET - *
  • IQ.Type.SET - *
  • IQ.Type.RESULT - *
  • IQ.Type.ERROR + *
  • IQ.Type.get + *
  • IQ.Type.set + *
  • IQ.Type.result + *
  • IQ.Type.error *
*/ - public static class Type { + public enum Type { - public static final Type GET = new Type("get"); - public static final Type SET = new Type("set"); - public static final Type RESULT = new Type("result"); - public static final Type ERROR = new Type("error"); + get, + set, + result, + error; /** * Converts a String into the corresponding types. Valid String values * that can be converted to types are: "get", "set", "result", and "error". * - * @param type the String value to covert. + * @param string the String value to covert. * @return the corresponding Type. + * @throws IllegalArgumentException when not able to parse the string parameter */ - public static Type fromString(String type) { - if (type == null) { - return null; + public static Type fromString(String string) { + Type type = null; + try { + type = Type.valueOf(string.toLowerCase(Locale.US)); } - type = type.toLowerCase(Locale.US); - if (GET.toString().equals(type)) { - return GET; + catch (Exception e) { + final String msg = "Could not transform string '" + string + "' to IQ.Type"; + LOGGER.log(Level.WARNING, msg, e); + throw new IllegalArgumentException(msg, e); } - else if (SET.toString().equals(type)) { - return SET; - } - else if (ERROR.toString().equals(type)) { - return ERROR; - } - else if (RESULT.toString().equals(type)) { - return RESULT; - } - else { - return null; - } - } - - private String value; - - private Type(String value) { - this.value = value; - } - - public String toString() { - return value; + return type; } } } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java index 11cc184b5..cf67bef97 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Session.java @@ -33,7 +33,7 @@ package org.jivesoftware.smack.packet; public class Session extends IQ { public Session() { - setType(IQ.Type.SET); + setType(IQ.Type.set); } @Override diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java index fe55e0d01..a09df7fec 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java @@ -381,7 +381,7 @@ public class PacketParserUtils { } // Only handle unknown IQs of type result. Types of 'get' and 'set' which are not understood // have to be answered with an IQ error response. See the code a few lines below - else if (IQ.Type.RESULT == type){ + else if (IQ.Type.result == type){ // No Provider found for the IQ stanza, parse it to an UnparsedIQ instance // so that the content of the IQ can be examined later on iqPacket = new UnparsedResultIQ(parseContent(parser)); @@ -396,7 +396,7 @@ public class PacketParserUtils { } // Decide what to do when an IQ packet was not understood if (iqPacket == null) { - if (connection != null && (IQ.Type.GET == type || IQ.Type.SET == type)) { + if (connection != null && (IQ.Type.get == type || IQ.Type.set == type)) { // If the IQ stanza is of type "get" or "set" containing a child element qualified // by a namespace with no registered Smack provider, then answer an IQ of type // "error" with code 501 ("feature-not-implemented") @@ -409,7 +409,7 @@ public class PacketParserUtils { iqPacket.setPacketID(id); iqPacket.setTo(from); iqPacket.setFrom(to); - iqPacket.setType(IQ.Type.ERROR); + iqPacket.setType(IQ.Type.error); iqPacket.setError(new XMPPError(XMPPError.Condition.feature_not_implemented)); connection.sendPacket(iqPacket); return null; diff --git a/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java b/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java index 27e00253e..7afe40a43 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/RosterTest.java @@ -360,7 +360,7 @@ public class RosterTest { @Test(timeout=5000) public void testIgnoreInvalidFrom() { RosterPacket packet = new RosterPacket(); - packet.setType(Type.SET); + packet.setType(Type.set); packet.setTo(connection.getUser()); packet.setFrom("mallory@example.com"); packet.addRosterItem(new Item("spam@example.com", "Cool products!")); @@ -500,7 +500,7 @@ public class RosterTest { for(RosterEntry entry : roster.getEntries()) { // prepare the roster push packet final RosterPacket rosterPush= new RosterPacket(); - rosterPush.setType(Type.SET); + rosterPush.setType(Type.set); rosterPush.setTo(connection.getUser()); // prepare the buddy's item entry which should be removed @@ -526,7 +526,7 @@ public class RosterTest { roster.reload(); while (true) { final Packet sentPacket = connection.getSentPacket(); - if (sentPacket instanceof RosterPacket && ((IQ) sentPacket).getType() == Type.GET) { + if (sentPacket instanceof RosterPacket && ((IQ) sentPacket).getType() == Type.get) { // setup the roster get request final RosterPacket rosterRequest = (RosterPacket) sentPacket; assertSame("The element MUST NOT contain any child elements!", @@ -536,7 +536,7 @@ public class RosterTest { // prepare the roster result final RosterPacket rosterResult = new RosterPacket(); rosterResult.setTo(connection.getUser()); - rosterResult.setType(Type.RESULT); + rosterResult.setType(Type.result); rosterResult.setPacketID(rosterRequest.getPacketID()); // prepare romeo's roster entry @@ -642,7 +642,7 @@ public class RosterTest { try { while (true) { final Packet packet = connection.getSentPacket(); - if (packet instanceof RosterPacket && ((IQ) packet).getType() == Type.SET) { + if (packet instanceof RosterPacket && ((IQ) packet).getType() == Type.set) { final RosterPacket rosterRequest = (RosterPacket) packet; // Prepare and process the roster push @@ -651,7 +651,7 @@ public class RosterTest { if (item.getItemType() != ItemType.remove) { item.setItemType(ItemType.none); } - rosterPush.setType(Type.SET); + rosterPush.setType(Type.set); rosterPush.setTo(connection.getUser()); rosterPush.addRosterItem(item); connection.processPacket(rosterPush); @@ -663,7 +663,7 @@ public class RosterTest { } }; response.setPacketID(rosterRequest.getPacketID()); - response.setType(Type.RESULT); + response.setType(Type.result); response.setTo(connection.getUser()); connection.processPacket(response); diff --git a/smack-core/src/test/java/org/jivesoftware/smack/RosterVersioningTest.java b/smack-core/src/test/java/org/jivesoftware/smack/RosterVersioningTest.java index b17c62da5..a2e07a0c9 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/RosterVersioningTest.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/RosterVersioningTest.java @@ -134,7 +134,7 @@ public class RosterVersioningTest { RosterPacket sentRP = (RosterPacket)sentPacket; RosterPacket answer = new RosterPacket(); answer.setPacketID(sentRP.getPacketID()); - answer.setType(Type.RESULT); + answer.setType(Type.result); answer.setTo(sentRP.getFrom()); answer.setVersion("newVersion"); @@ -173,7 +173,7 @@ public class RosterVersioningTest { { RosterPacket rosterPush = new RosterPacket(); rosterPush.setTo("rostertest@example.com/home"); - rosterPush.setType(Type.SET); + rosterPush.setType(Type.set); rosterPush.setVersion("v97"); Item pushedItem = vaglafItem(); @@ -197,7 +197,7 @@ public class RosterVersioningTest { { RosterPacket rosterPush = new RosterPacket(); rosterPush.setTo("rostertest@example.com/home"); - rosterPush.setType(Type.SET); + rosterPush.setType(Type.set); rosterPush.setVersion("v98"); Item item = new Item("vaglaf@example.com", "vaglaf the only"); diff --git a/smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java b/smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java index d5aab66c3..7decd3058 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java @@ -59,7 +59,7 @@ public class ThreadedDummyConnection extends DummyConnection { replyPacket.setPacketID(packet.getPacketID()); replyPacket.setFrom(packet.getTo()); replyPacket.setTo(packet.getFrom()); - replyPacket.setType(Type.RESULT); + replyPacket.setType(Type.result); new ProcessQueue(replyQ).start(); } diff --git a/smack-core/src/test/java/org/jivesoftware/smack/packet/IQResponseTest.java b/smack-core/src/test/java/org/jivesoftware/smack/packet/IQResponseTest.java index 35b68a1bd..df3845b4e 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/packet/IQResponseTest.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/packet/IQResponseTest.java @@ -49,7 +49,7 @@ public class IQResponseTest { final IQ result = IQ.createResultIQ(request); - assertEquals(IQ.Type.RESULT, result.getType()); + assertEquals(IQ.Type.result, result.getType()); assertNotNull(result.getPacketID()); assertEquals(request.getPacketID(), result.getPacketID()); assertEquals(request.getFrom(), result.getTo()); @@ -68,13 +68,13 @@ public class IQResponseTest { return childElement; } }; - request.setType(IQ.Type.SET); + request.setType(IQ.Type.set); request.setFrom("sender@test/Smack"); request.setTo("receiver@test/Smack"); final IQ result = IQ.createErrorResponse(request, error); - assertEquals(IQ.Type.ERROR, result.getType()); + assertEquals(IQ.Type.error, result.getType()); assertNotNull(result.getPacketID()); assertEquals(request.getPacketID(), result.getPacketID()); assertEquals(request.getFrom(), result.getTo()); @@ -93,7 +93,7 @@ public class IQResponseTest { return childElement; } }; - request.setType(IQ.Type.RESULT); + request.setType(IQ.Type.result); request.setFrom("sender@test/Smack"); request.setTo("receiver@test/Smack"); @@ -119,7 +119,7 @@ public class IQResponseTest { return childElement; } }; - request.setType(IQ.Type.ERROR); + request.setType(IQ.Type.error); request.setFrom("sender@test/Smack"); request.setTo("receiver@test/Smack"); request.setError(error); diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java index 8625db54a..3eb2e2d4d 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java @@ -92,7 +92,7 @@ public class CarbonManager extends Manager { return "<" + (new_state? "enable" : "disable") + " xmlns='" + CarbonExtension.NAMESPACE + "'/>"; } }; - setIQ.setType(IQ.Type.SET); + setIQ.setType(IQ.Type.set); return setIQ; } @@ -123,7 +123,7 @@ public class CarbonManager extends Manager { connection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { IQ result = (IQ)packet; - if (result.getType() == IQ.Type.RESULT) { + if (result.getType() == IQ.Type.result) { enabled_state = new_state; } connection().removePacketListener(this); diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/CompressionTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/CompressionTest.java index 4b770ccc8..2240e2069 100644 --- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/CompressionTest.java +++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/CompressionTest.java @@ -55,7 +55,7 @@ public class CompressionTest extends SmackTestCase { // Request the version of the server Version version = new Version(); - version.setType(IQ.Type.GET); + version.setType(IQ.Type.get); version.setTo(getServiceName()); // Create a packet collector to listen for a response. @@ -69,7 +69,7 @@ public class CompressionTest extends SmackTestCase { collector.cancel(); assertNotNull("No reply was received from the server", result); - assertEquals("Incorrect IQ type from server", IQ.Type.RESULT, result.getType()); + assertEquals("Incorrect IQ type from server", IQ.Type.result, result.getType()); // Close connection connection.disconnect(); diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/VersionTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/VersionTest.java index adf9629ee..46f1d1e47 100644 --- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/VersionTest.java +++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/VersionTest.java @@ -41,7 +41,7 @@ public class VersionTest extends SmackTestCase { */ public void testGetServerVersion() { Version version = new Version(); - version.setType(IQ.Type.GET); + version.setType(IQ.Type.get); version.setTo(getServiceName()); // Create a packet collector to listen for a response. @@ -56,7 +56,7 @@ public class VersionTest extends SmackTestCase { assertNotNull("No result from the server", result); - assertEquals("Incorrect result type", IQ.Type.RESULT, result.getType()); + assertEquals("Incorrect result type", IQ.Type.result, result.getType()); assertNotNull("No name specified in the result", ((Version)result).getName()); assertNotNull("No version specified in the result", ((Version)result).getVersion()); } diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/entitycaps/EntityCapsTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/entitycaps/EntityCapsTest.java index f388d9587..94115dbce 100644 --- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/entitycaps/EntityCapsTest.java +++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/entitycaps/EntityCapsTest.java @@ -90,7 +90,7 @@ public class EntityCapsTest extends SmackTestCase { discoInfoSend = true; } - }, new AndFilter(new PacketTypeFilter(DiscoverInfo.class), new IQTypeFilter(IQ.Type.GET))); + }, new AndFilter(new PacketTypeFilter(DiscoverInfo.class), new IQTypeFilter(IQ.Type.get))); // add a bogus feature so that con1 ver won't match con0's sdm1.addFeature(DISCOVER_TEST_FEATURE); diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java index f4ca9de6c..ba20a119b 100644 --- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java +++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java @@ -484,7 +484,7 @@ public class MultiUserChatTest extends SmackTestCase { .discoverInfo(room + "/testbot", null); assertNotNull("No info was discovered from room occupant", info); - assertEquals("Wrong IQ type", IQ.Type.RESULT, info.getType()); + assertEquals("Wrong IQ type", IQ.Type.result, info.getType()); assertEquals("Wrong IQ sender", room + "/testbot", info.getFrom()); // User2 leaves the room diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Close.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Close.java index fb0933695..6593cfbef 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Close.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Close.java @@ -39,7 +39,7 @@ public class Close extends IQ { throw new IllegalArgumentException("Session ID must not be null or empty"); } this.sessionID = sessionID; - setType(Type.SET); + setType(Type.set); } /** diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Data.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Data.java index d9198ec4f..d566cdcfd 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Data.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Data.java @@ -45,7 +45,7 @@ public class Data extends IQ { * retrieved from IQ stanza and message stanza in the same way */ addExtension(data); - setType(IQ.Type.SET); + setType(IQ.Type.set); } /** diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Open.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Open.java index 276b9e5e8..5489dd459 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Open.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/packet/Open.java @@ -62,7 +62,7 @@ public class Open extends IQ { this.sessionID = sessionID; this.blockSize = blockSize; this.stanza = stanza; - setType(Type.SET); + setType(Type.set); } /** diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java index 46483f85b..7c25b674e 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java @@ -640,7 +640,7 @@ public final class Socks5BytestreamManager implements BytestreamManager { */ private Bytestream createStreamHostRequest(String proxy) { Bytestream request = new Bytestream(); - request.setType(IQ.Type.GET); + request.setType(IQ.Type.get); request.setTo(proxy); return request; } @@ -695,7 +695,7 @@ public final class Socks5BytestreamManager implements BytestreamManager { initiation.addStreamHost(streamHost); } - initiation.setType(IQ.Type.SET); + initiation.setType(IQ.Type.set); initiation.setTo(targetJID); return initiation; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamRequest.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamRequest.java index 641d2fc74..3f62ee1a3 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamRequest.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamRequest.java @@ -294,7 +294,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest { private Bytestream createUsedHostResponse(StreamHost selectedHost) { Bytestream response = new Bytestream(this.bytestreamRequest.getSessionID()); response.setTo(this.bytestreamRequest.getFrom()); - response.setType(IQ.Type.RESULT); + response.setType(IQ.Type.result); response.setPacketID(this.bytestreamRequest.getPacketID()); response.setUsedHost(selectedHost.getJID()); return response; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiator.java index 0dd11f459..f57edb027 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiator.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiator.java @@ -120,7 +120,7 @@ class Socks5ClientForInitiator extends Socks5Client { private Bytestream createStreamHostActivation() { Bytestream activate = new Bytestream(this.sessionID); activate.setMode(null); - activate.setType(IQ.Type.SET); + activate.setType(IQ.Type.set); activate.setTo(this.streamHost.getJID()); activate.setToActivate(this.target); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java index fba74539f..ea43c48f6 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java @@ -217,7 +217,7 @@ public class Bytestream extends IQ { StringBuilder buf = new StringBuilder(); buf.append(""); if (getUsedHost() != null) { buf.append(getUsedHost().toXML()); @@ -246,7 +246,7 @@ public class Bytestream extends IQ { } } } - else if (this.getType().equals(IQ.Type.GET)) { + else if (this.getType().equals(IQ.Type.get)) { return buf.append("/>").toString(); } else { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java index c3cb99ceb..f001f82ba 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java @@ -435,7 +435,7 @@ public class EntityCapsManager extends Manager { XMPPConnection connection = connection(); DiscoverInfo discoverInfo = new DiscoverInfo(); - discoverInfo.setType(IQ.Type.RESULT); + discoverInfo.setType(IQ.Type.result); discoverInfo.setNode(getLocalNodeVer()); if (connection != null) discoverInfo.setFrom(connection.getUser()); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java index 064266797..31a25c955 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java @@ -332,7 +332,7 @@ public class AdHocCommandManager extends Manager { */ private void processAdHocCommand(AdHocCommandData requestData) throws SmackException { // Only process requests of type SET - if (requestData.getType() != IQ.Type.SET) { + if (requestData.getType() != IQ.Type.set) { return; } @@ -364,7 +364,7 @@ public class AdHocCommandManager extends Manager { // corresponding sessioid LocalCommand command = newInstanceOfCmd(commandNode, sessionId); - response.setType(IQ.Type.RESULT); + response.setType(IQ.Type.result); command.setData(response); // Check that the requester has enough permission. @@ -530,7 +530,7 @@ public class AdHocCommandManager extends Manager { // Since all errors were passed, the response is now a // result - response.setType(IQ.Type.RESULT); + response.setType(IQ.Type.result); // Set the new data to the command. command.setData(response); @@ -623,7 +623,7 @@ public class AdHocCommandManager extends Manager { * @throws NotConnectedException */ private void respondError(AdHocCommandData response, XMPPError error) throws NotConnectedException { - response.setType(IQ.Type.ERROR); + response.setType(IQ.Type.error); response.setError(error); connection().sendPacket(response); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/RemoteCommand.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/RemoteCommand.java index 5b72766df..6c19ea47c 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/RemoteCommand.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/RemoteCommand.java @@ -130,7 +130,7 @@ public class RemoteCommand extends AdHocCommand { // TODO: not throw the corresponding exeption. This will make a faster response, // TODO: since the request is stoped before it's sent. AdHocCommandData data = new AdHocCommandData(); - data.setType(IQ.Type.SET); + data.setType(IQ.Type.set); data.setTo(getOwnerJID()); data.setNode(getNode()); data.setSessionID(sessionID); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java index a6d351570..354c80edc 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/packet/AdHocCommandData.java @@ -90,7 +90,7 @@ public class AdHocCommandData extends IQ { } buf.append(">"); - if (getType() == Type.RESULT) { + if (getType() == Type.result) { buf.append(" error since client doesn't contain // the specified node - response.setType(IQ.Type.ERROR); + response.setType(IQ.Type.error); response.setError(new XMPPError(XMPPError.Condition.item_not_found)); } connection.sendPacket(response); @@ -157,9 +157,9 @@ public class ServiceDiscoveryManager extends Manager { if (connection == null) return; DiscoverInfo discoverInfo = (DiscoverInfo) packet; // Answer the client's supported features if the request is of the GET type - if (discoverInfo != null && discoverInfo.getType() == IQ.Type.GET) { + if (discoverInfo != null && discoverInfo.getType() == IQ.Type.get) { DiscoverInfo response = new DiscoverInfo(); - response.setType(IQ.Type.RESULT); + response.setType(IQ.Type.result); response.setTo(discoverInfo.getFrom()); response.setPacketID(discoverInfo.getPacketID()); response.setNode(discoverInfo.getNode()); @@ -185,7 +185,7 @@ public class ServiceDiscoveryManager extends Manager { } else { // Return error since specified node was not found - response.setType(IQ.Type.ERROR); + response.setType(IQ.Type.error); response.setError(new XMPPError(XMPPError.Condition.item_not_found)); } } @@ -552,7 +552,7 @@ public class ServiceDiscoveryManager extends Manager { public DiscoverInfo discoverInfo(String entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException { // Discover the entity's info DiscoverInfo disco = new DiscoverInfo(); - disco.setType(IQ.Type.GET); + disco.setType(IQ.Type.get); disco.setTo(entityID); disco.setNode(node); @@ -589,7 +589,7 @@ public class ServiceDiscoveryManager extends Manager { public DiscoverItems discoverItems(String entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException { // Discover the entity's items DiscoverItems disco = new DiscoverItems(); - disco.setType(IQ.Type.GET); + disco.setType(IQ.Type.get); disco.setTo(entityID); disco.setNode(node); @@ -658,7 +658,7 @@ public class ServiceDiscoveryManager extends Manager { */ public void publishItems(String entityID, String node, DiscoverItems discoverItems) throws NoResponseException, XMPPErrorException, NotConnectedException { - discoverItems.setType(IQ.Type.SET); + discoverItems.setType(IQ.Type.set); discoverItems.setTo(entityID); discoverItems.setNode(node); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java index ae609952b..10ea4e93a 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java @@ -173,7 +173,7 @@ public class FileTransferManager { IQ rejection = FileTransferNegotiator.createIQ( initiation.getPacketID(), initiation.getFrom(), initiation - .getTo(), IQ.Type.ERROR); + .getTo(), IQ.Type.error); rejection.setError(new XMPPError(XMPPError.Condition.no_acceptable)); connection.sendPacket(rejection); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java index 6b1c4cc16..fb698391a 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java @@ -253,7 +253,7 @@ public class FileTransferNegotiator { String errorMessage = "No stream methods contained in packet."; XMPPError error = new XMPPError(XMPPError.Condition.bad_request, errorMessage); IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(), - IQ.Type.ERROR); + IQ.Type.error); iqPacket.setError(error); connection.sendPacket(iqPacket); throw new XMPPErrorException(errorMessage, error); @@ -267,7 +267,7 @@ public class FileTransferNegotiator { } catch (XMPPErrorException e) { IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(), - IQ.Type.ERROR); + IQ.Type.error); iqPacket.setError(e.getXMPPError()); connection.sendPacket(iqPacket); throw e; @@ -331,7 +331,7 @@ public class FileTransferNegotiator { public void rejectStream(final StreamInitiation si) throws NotConnectedException { XMPPError error = new XMPPError(XMPPError.Condition.forbidden, "Offer Declined"); IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(), - IQ.Type.ERROR); + IQ.Type.error); iqPacket.setError(error); connection.sendPacket(iqPacket); } @@ -396,7 +396,7 @@ public class FileTransferNegotiator { si.setFrom(connection.getUser()); si.setTo(userID); - si.setType(IQ.Type.SET); + si.setType(IQ.Type.set); PacketCollector collector = connection.createPacketCollectorAndSend(si); Packet siResponse = collector.nextResult(responseTimeout); @@ -404,7 +404,7 @@ public class FileTransferNegotiator { if (siResponse instanceof IQ) { IQ iqResponse = (IQ) siResponse; - if (iqResponse.getType().equals(IQ.Type.RESULT)) { + if (iqResponse.getType().equals(IQ.Type.result)) { StreamInitiation response = (StreamInitiation) siResponse; return getOutgoingNegotiator(getStreamMethodField(response .getFeatureNegotiationForm())); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java index 2f57526e3..5dcaebf3c 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java @@ -131,7 +131,7 @@ public class IBBTransferNegotiator extends StreamNegotiator { // packet must by of type SET and contains the given session ID return this.sessionID.equals(bytestream.getSessionID()) - && IQ.Type.SET.equals(bytestream.getType()); + && IQ.Type.set.equals(bytestream.getType()); } return false; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java index 8ce0998e2..bc4bb7440 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java @@ -149,7 +149,7 @@ public class Socks5TransferNegotiator extends StreamNegotiator { // packet must by of type SET and contains the given session ID return this.sessionID.equals(bytestream.getSessionID()) - && IQ.Type.SET.equals(bytestream.getType()); + && IQ.Type.set.equals(bytestream.getType()); } return false; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java index a8b873a13..aade2dbbb 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java @@ -59,7 +59,7 @@ public abstract class StreamNegotiator { StreamInitiation response = new StreamInitiation(); response.setTo(streamInitiationOffer.getFrom()); response.setFrom(streamInitiationOffer.getTo()); - response.setType(IQ.Type.RESULT); + response.setType(IQ.Type.result); response.setPacketID(streamInitiationOffer.getPacketID()); DataForm form = new DataForm(Form.TYPE_SUBMIT); @@ -76,7 +76,7 @@ public abstract class StreamNegotiator { public IQ createError(String from, String to, String packetID, XMPPError xmppError) { - IQ iq = FileTransferNegotiator.createIQ(packetID, to, from, IQ.Type.ERROR); + IQ iq = FileTransferNegotiator.createIQ(packetID, to, from, IQ.Type.error); iq.setError(xmppError); return iq; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java index 85bb9e1fe..42445f24c 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/LastActivityManager.java @@ -165,7 +165,7 @@ public class LastActivityManager extends Manager { public void processPacket(Packet packet) throws NotConnectedException { if (!enabled) return; LastActivity message = new LastActivity(); - message.setType(IQ.Type.RESULT); + message.setType(IQ.Type.result); message.setTo(packet.getFrom()); message.setFrom(packet.getTo()); message.setPacketID(packet.getPacketID()); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/packet/LastActivity.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/packet/LastActivity.java index 933254b71..3d7ce545f 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/packet/LastActivity.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqlast/packet/LastActivity.java @@ -43,7 +43,7 @@ public class LastActivity extends IQ { public String message; public LastActivity() { - setType(IQ.Type.GET); + setType(IQ.Type.get); } public LastActivity(String to) { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/PrivateDataManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/PrivateDataManager.java index 120bdd3d5..464f231b5 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/PrivateDataManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/PrivateDataManager.java @@ -162,7 +162,7 @@ public class PrivateDataManager extends Manager { return buf.toString(); } }; - privateDataGet.setType(IQ.Type.GET); + privateDataGet.setType(IQ.Type.get); PrivateDataResult response = (PrivateDataResult) connection().createPacketCollectorAndSend( privateDataGet).nextResultOrThrow(); @@ -190,7 +190,7 @@ public class PrivateDataManager extends Manager { return buf.toString(); } }; - privateDataSet.setType(IQ.Type.SET); + privateDataSet.setType(IQ.Type.set); connection().createPacketCollectorAndSend(privateDataSet).nextResultOrThrow(); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqversion/packet/Version.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqversion/packet/Version.java index 869bb17e6..6267ca761 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqversion/packet/Version.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqversion/packet/Version.java @@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.StringUtils; *
  * // Request the version from the server.
  * Version versionRequest = new Version();
- * timeRequest.setType(IQ.Type.GET);
+ * timeRequest.setType(IQ.Type.get);
  * timeRequest.setTo("example.com");
  *
  * // Create a packet collector to listen for a response.
@@ -40,7 +40,7 @@ import org.jivesoftware.smack.util.StringUtils;
  *
  * // Wait up to 5 seconds for a result.
  * IQ result = (IQ)collector.nextResult(5000);
- * if (result != null && result.getType() == IQ.Type.RESULT) {
+ * if (result != null && result.getType() == IQ.Type.result) {
  *     Version versionResult = (Version)result;
  *     // Do something with result...
  * }

@@ -62,7 +62,7 @@ public class Version extends IQ { * @param os The operating system of the queried entity. This element is OPTIONAL. */ public Version(String name, String version, String os) { - this.setType(IQ.Type.RESULT); + this.setType(IQ.Type.result); this.name = name; this.version = version; this.os = os; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index b0e6daf45..c9ee1cf55 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -566,7 +566,7 @@ public class MultiUserChat { public Form getConfigurationForm() throws NoResponseException, XMPPErrorException, NotConnectedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); - iq.setType(IQ.Type.GET); + iq.setType(IQ.Type.get); IQ answer = (IQ) connection.createPacketCollectorAndSend(iq).nextResultOrThrow(); return Form.getFormFrom(answer); @@ -585,7 +585,7 @@ public class MultiUserChat { public void sendConfigurationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); iq.addExtension(form.getDataFormToSend()); connection.createPacketCollectorAndSend(iq).nextResultOrThrow(); @@ -609,7 +609,7 @@ public class MultiUserChat { */ public Form getRegistrationForm() throws NoResponseException, XMPPErrorException, NotConnectedException { Registration reg = new Registration(); - reg.setType(IQ.Type.GET); + reg.setType(IQ.Type.get); reg.setTo(room); IQ result = (IQ) connection.createPacketCollectorAndSend(reg).nextResultOrThrow(); @@ -634,7 +634,7 @@ public class MultiUserChat { */ public void sendRegistrationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException { Registration reg = new Registration(); - reg.setType(IQ.Type.SET); + reg.setType(IQ.Type.set); reg.setTo(room); reg.addExtension(form.getDataFormToSend()); @@ -658,7 +658,7 @@ public class MultiUserChat { public void destroy(String reason, String alternateJID) throws NoResponseException, XMPPErrorException, NotConnectedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); // Create the reason for the room destruction MUCOwner.Destroy destroy = new MUCOwner.Destroy(); @@ -1369,7 +1369,7 @@ public class MultiUserChat { throws XMPPErrorException, NoResponseException, NotConnectedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); // Set the new affiliation. MUCOwner.Item item = new MUCOwner.Item(affiliation); item.setJid(jid); @@ -1382,7 +1382,7 @@ public class MultiUserChat { throws NoResponseException, XMPPErrorException, NotConnectedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); for (String jid : jids) { // Set the new affiliation. MUCOwner.Item item = new MUCOwner.Item(affiliation); @@ -1407,7 +1407,7 @@ public class MultiUserChat { { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); // Set the new affiliation. MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null); item.setJid(jid); @@ -1421,7 +1421,7 @@ public class MultiUserChat { throws NoResponseException, XMPPErrorException, NotConnectedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); for (String jid : jids) { // Set the new affiliation. MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null); @@ -1435,7 +1435,7 @@ public class MultiUserChat { private void changeRole(String nickname, String role, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); // Set the new role. MUCAdmin.Item item = new MUCAdmin.Item(null, role); item.setNick(nickname); @@ -1448,7 +1448,7 @@ public class MultiUserChat { private void changeRole(Collection nicknames, String role) throws NoResponseException, XMPPErrorException, NotConnectedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); - iq.setType(IQ.Type.SET); + iq.setType(IQ.Type.set); for (String nickname : nicknames) { // Set the new role. MUCAdmin.Item item = new MUCAdmin.Item(null, role); @@ -1604,7 +1604,7 @@ public class MultiUserChat { private Collection getAffiliatesByAdmin(String affiliation) throws NoResponseException, XMPPErrorException, NotConnectedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); - iq.setType(IQ.Type.GET); + iq.setType(IQ.Type.get); // Set the specified affiliation. This may request the list of owners/admins/members/outcasts. MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null); iq.addItem(item); @@ -1656,7 +1656,7 @@ public class MultiUserChat { private Collection getOccupants(String role) throws NoResponseException, XMPPErrorException, NotConnectedException { MUCAdmin iq = new MUCAdmin(); iq.setTo(room); - iq.setType(IQ.Type.GET); + iq.setType(IQ.Type.get); // Set the specified role. This may request the list of moderators/participants. MUCAdmin.Item item = new MUCAdmin.Item(null, role); iq.addItem(item); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PEPManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PEPManager.java index 61ab21799..a54fe80d8 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PEPManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PEPManager.java @@ -111,7 +111,7 @@ public class PEPManager { public void publish(PEPItem item) throws NotConnectedException { // Create a new message to publish the event. PEPPubSub pubSub = new PEPPubSub(item); - pubSub.setType(Type.SET); + pubSub.setType(Type.set); //pubSub.setFrom(connection.getUser()); // Send the message that contains the roster diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Ping.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Ping.java index 8ec5ac744..de9e9227f 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Ping.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Ping.java @@ -28,7 +28,7 @@ public class Ping extends IQ { public Ping(String to) { setTo(to); - setType(IQ.Type.GET); + setType(IQ.Type.get); } @Override diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Pong.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Pong.java index af63f979d..706a18f00 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Pong.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/packet/Pong.java @@ -28,7 +28,7 @@ public class Pong extends IQ { * @param ping */ public Pong(Packet ping) { - setType(IQ.Type.RESULT); + setType(IQ.Type.result); setFrom(ping.getTo()); setTo(ping.getFrom()); setPacketID(ping.getPacketID()); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java index c5433651b..88c218017 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java @@ -148,7 +148,7 @@ public class PrivacyListManager extends Manager { */ private Privacy getRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException { // The request is a get iq type - requestPrivacy.setType(Privacy.Type.GET); + requestPrivacy.setType(Privacy.Type.get); requestPrivacy.setFrom(this.getUser()); Privacy privacyAnswer = (Privacy) connection().createPacketCollectorAndSend(requestPrivacy).nextResultOrThrow(); @@ -168,7 +168,7 @@ public class PrivacyListManager extends Manager { */ private Packet setRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException { // The request is a get iq type - requestPrivacy.setType(Privacy.Type.SET); + requestPrivacy.setType(Privacy.Type.set); requestPrivacy.setFrom(this.getUser()); return connection().createPacketCollectorAndSend(requestPrivacy).nextResultOrThrow(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java index ec685160e..c9a4d5f52 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java @@ -71,7 +71,7 @@ public class LeafNode extends Node @SuppressWarnings("unchecked") public List getItems() throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId())); + PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId())); PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow(); ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS); @@ -93,7 +93,7 @@ public class LeafNode extends Node @SuppressWarnings("unchecked") public List getItems(String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId)); + PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId)); PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow(); ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS); @@ -123,7 +123,7 @@ public class LeafNode extends Node { itemList.add(new Item(id)); } - PubSub request = createPubsubPacket(Type.GET, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList)); + PubSub request = createPubsubPacket(Type.get, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList)); PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow(); ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS); @@ -143,7 +143,7 @@ public class LeafNode extends Node @SuppressWarnings("unchecked") public List getItems(int maxItems) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), maxItems)); + PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), maxItems)); PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow(); ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS); @@ -166,7 +166,7 @@ public class LeafNode extends Node @SuppressWarnings("unchecked") public List getItems(int maxItems, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId, maxItems)); + PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId, maxItems)); PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow(); ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS); @@ -188,7 +188,7 @@ public class LeafNode extends Node */ public void publish() throws NotConnectedException { - PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId())); + PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId())); con.sendPacket(packet); } @@ -233,7 +233,7 @@ public class LeafNode extends Node */ public void publish(Collection items) throws NotConnectedException { - PubSub packet = createPubsubPacket(Type.SET, new PublishItem(getId(), items)); + PubSub packet = createPubsubPacket(Type.set, new PublishItem(getId(), items)); con.sendPacket(packet); } @@ -256,7 +256,7 @@ public class LeafNode extends Node */ public void send() throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId())); + PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId())); con.createPacketCollectorAndSend(packet).nextResultOrThrow(); } @@ -311,7 +311,7 @@ public class LeafNode extends Node */ public void send(Collection items) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub packet = createPubsubPacket(Type.SET, new PublishItem(getId(), items)); + PubSub packet = createPubsubPacket(Type.set, new PublishItem(getId(), items)); con.createPacketCollectorAndSend(packet).nextResultOrThrow(); } @@ -327,7 +327,7 @@ public class LeafNode extends Node */ public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace()); + PubSub request = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace()); con.createPacketCollectorAndSend(request).nextResultOrThrow(); } @@ -363,7 +363,7 @@ public class LeafNode extends Node { items.add(new Item(id)); } - PubSub request = createPubsubPacket(Type.SET, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items)); + PubSub request = createPubsubPacket(Type.set, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items)); con.createPacketCollectorAndSend(request).nextResultOrThrow(); } } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java index a5a052d55..125bede91 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java @@ -98,7 +98,7 @@ abstract public class Node */ public ConfigureForm getNodeConfiguration() throws NoResponseException, XMPPErrorException, NotConnectedException { - Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.CONFIGURE_OWNER, getId()), PubSubNamespace.OWNER); + Packet reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.CONFIGURE_OWNER, getId()), PubSubNamespace.OWNER); return NodeUtils.getFormFromPacket(reply, PubSubElementType.CONFIGURE_OWNER); } @@ -112,7 +112,7 @@ abstract public class Node */ public void sendConfigurationForm(Form submitForm) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub packet = createPubsubPacket(Type.SET, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER); + PubSub packet = createPubsubPacket(Type.set, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER); con.createPacketCollectorAndSend(packet).nextResultOrThrow(); } @@ -143,7 +143,7 @@ abstract public class Node */ public List getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId())); + PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId())); SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS); return subElem.getSubscriptions(); } @@ -167,7 +167,7 @@ abstract public class Node */ public Subscription subscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new SubscribeExtension(jid, getId())); + PubSub reply = (PubSub)sendPubsubPacket(Type.set, new SubscribeExtension(jid, getId())); return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION); } @@ -191,9 +191,9 @@ abstract public class Node */ public Subscription subscribe(String jid, SubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(Type.SET, new SubscribeExtension(jid, getId())); + PubSub request = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId())); request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm)); - PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.SET, request); + PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.set, request); return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION); } @@ -224,7 +224,7 @@ abstract public class Node */ public void unsubscribe(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException { - sendPubsubPacket(Type.SET, new UnsubscribeExtension(jid, getId(), subscriptionId)); + sendPubsubPacket(Type.set, new UnsubscribeExtension(jid, getId(), subscriptionId)); } /** @@ -256,7 +256,7 @@ abstract public class Node */ public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub packet = (PubSub)sendPubsubPacket(Type.GET, new OptionsExtension(jid, getId(), subscriptionId)); + PubSub packet = (PubSub)sendPubsubPacket(Type.get, new OptionsExtension(jid, getId(), subscriptionId)); FormNode ext = (FormNode)packet.getExtension(PubSubElementType.OPTIONS); return new SubscribeForm(ext.getForm()); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java index 9ac1cbee9..5495bc228 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java @@ -86,7 +86,7 @@ final public class PubSubManager */ public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.CREATE)); + PubSub reply = (PubSub)sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE)); NodeExtension elem = (NodeExtension)reply.getExtension("create", PubSubNamespace.BASIC.getXmlns()); LeafNode newNode = new LeafNode(con, elem.getNode()); @@ -126,7 +126,7 @@ final public class PubSubManager */ public Node createNode(String name, Form config) throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub request = createPubsubPacket(to, Type.SET, new NodeExtension(PubSubElementType.CREATE, name)); + PubSub request = createPubsubPacket(to, Type.set, new NodeExtension(PubSubElementType.CREATE, name)); boolean isLeafNode = true; if (config != null) @@ -140,7 +140,7 @@ final public class PubSubManager // Errors will cause exceptions in getReply, so it only returns // on success. - sendPubsubPacket(con, to, Type.SET, request); + sendPubsubPacket(con, to, Type.set, request); Node newNode = isLeafNode ? new LeafNode(con, name) : new CollectionNode(con, name); newNode.setTo(to); nodeMap.put(newNode.getId(), newNode); @@ -217,7 +217,7 @@ final public class PubSubManager */ public List getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException { - Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS)); + Packet reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS)); SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS.getElementName(), PubSubElementType.SUBSCRIPTIONS.getNamespace().getXmlns()); return subElem.getSubscriptions(); } @@ -233,7 +233,7 @@ final public class PubSubManager */ public List getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException { - PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.AFFILIATIONS)); + PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS)); AffiliationsExtension listElem = (AffiliationsExtension)reply.getExtension(PubSubElementType.AFFILIATIONS); return listElem.getAffiliations(); } @@ -248,7 +248,7 @@ final public class PubSubManager */ public void deleteNode(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException { - sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace()); + sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace()); nodeMap.remove(nodeId); } @@ -264,7 +264,7 @@ final public class PubSubManager { // Errors will cause exceptions in getReply, so it only returns // on success. - PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace()); + PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace()); return NodeUtils.getFormFromPacket(reply, PubSubElementType.DEFAULT); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java index 2ee6610cf..92a28d63d 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java @@ -66,7 +66,7 @@ public class UserSearch extends IQ { */ public Form getSearchForm(XMPPConnection con, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException { UserSearch search = new UserSearch(); - search.setType(IQ.Type.GET); + search.setType(IQ.Type.get); search.setTo(searchService); IQ response = (IQ) con.createPacketCollectorAndSend(search).nextResultOrThrow(); @@ -86,7 +86,7 @@ public class UserSearch extends IQ { */ public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException { UserSearch search = new UserSearch(); - search.setType(IQ.Type.SET); + search.setType(IQ.Type.set); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); @@ -108,7 +108,7 @@ public class UserSearch extends IQ { public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException { SimpleUserSearch search = new SimpleUserSearch(); search.setForm(searchForm); - search.setType(IQ.Type.SET); + search.setType(IQ.Type.set); search.setTo(searchService); SimpleUserSearch response = (SimpleUserSearch) con.createPacketCollectorAndSend(search).nextResultOrThrow(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/sharedgroups/SharedGroupManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/sharedgroups/SharedGroupManager.java index 18d0ebd08..1900b25a7 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/sharedgroups/SharedGroupManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/sharedgroups/SharedGroupManager.java @@ -48,7 +48,7 @@ public class SharedGroupManager { public static List getSharedGroups(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException { // Discover the shared groups of the logged user SharedGroupsInfo info = new SharedGroupsInfo(); - info.setType(IQ.Type.GET); + info.setType(IQ.Type.get); SharedGroupsInfo result = (SharedGroupsInfo) connection.createPacketCollectorAndSend(info).nextResultOrThrow(); return result.getGroups(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/si/packet/StreamInitiation.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/si/packet/StreamInitiation.java index 3dda2adaf..d0b9f544c 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/si/packet/StreamInitiation.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/si/packet/StreamInitiation.java @@ -134,7 +134,7 @@ public class StreamInitiation extends IQ { */ public String getChildElementXML() { StringBuilder buf = new StringBuilder(); - if (this.getType().equals(IQ.Type.SET)) { + if (this.getType().equals(IQ.Type.set)) { buf.append(""); } else { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/time/packet/Time.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/time/packet/Time.java index 275c6bb51..60df002f6 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/time/packet/Time.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/time/packet/Time.java @@ -43,7 +43,7 @@ public class Time extends IQ { private String tzo; public Time() { - setType(Type.GET); + setType(Type.get); } /** @@ -123,7 +123,7 @@ public class Time extends IQ { public static Time createResponse(Packet request) { Time time = new Time(Calendar.getInstance()); - time.setType(Type.RESULT); + time.setType(Type.result); time.setTo(request.getFrom()); return time; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java index 0a368fb38..e7632a3c7 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java @@ -523,7 +523,7 @@ public class VCard extends IQ { public void save(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException { checkAuthenticated(connection, true); - setType(IQ.Type.SET); + setType(IQ.Type.set); setFrom(connection.getUser()); connection.createPacketCollectorAndSend(this).nextResultOrThrow(); } @@ -556,7 +556,7 @@ public class VCard extends IQ { } private void doLoad(XMPPConnection connection, String user) throws NoResponseException, XMPPErrorException, NotConnectedException { - setType(Type.GET); + setType(Type.get); VCard result = (VCard) connection.createPacketCollectorAndSend(this).nextResultOrThrow(); copyFieldsFrom(result); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/CloseListenerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/CloseListenerTest.java index 8d442a557..330400391 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/CloseListenerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/CloseListenerTest.java @@ -73,7 +73,7 @@ public class CloseListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.item_not_found.toString(), argument.getValue().getError().getCondition()); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/DataListenerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/DataListenerTest.java index 7376ca89c..3e65a1f1b 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/DataListenerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/DataListenerTest.java @@ -75,7 +75,7 @@ public class DataListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.item_not_found.toString(), argument.getValue().getError().getCondition()); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/IBBPacketUtils.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/IBBPacketUtils.java index 49ef5d56e..c577a4a9d 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/IBBPacketUtils.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/IBBPacketUtils.java @@ -42,7 +42,7 @@ public class IBBPacketUtils { } }; - errorIQ.setType(IQ.Type.ERROR); + errorIQ.setType(IQ.Type.error); errorIQ.setFrom(from); errorIQ.setTo(to); errorIQ.setError(xmppError); @@ -64,7 +64,7 @@ public class IBBPacketUtils { } }; - result.setType(IQ.Type.RESULT); + result.setType(IQ.Type.result); result.setFrom(from); result.setTo(to); return result; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamRequestTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamRequestTest.java index fe6073d4f..c32b05091 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamRequestTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamRequestTest.java @@ -83,7 +83,7 @@ public class InBandBytestreamRequestTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.no_acceptable.toString(), argument.getValue().getError().getCondition()); @@ -108,7 +108,7 @@ public class InBandBytestreamRequestTest { // assert that reply is the correct acknowledgment packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.RESULT, argument.getValue().getType()); + assertEquals(IQ.Type.result, argument.getValue().getType()); assertNotNull(session); assertNotNull(session.getInputStream()); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java index 8077a8366..4c4c8e6a5 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java @@ -91,7 +91,7 @@ public class InitiationListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.no_acceptable.toString(), argument.getValue().getError().getCondition()); @@ -119,7 +119,7 @@ public class InitiationListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.resource_constraint.toString(), argument.getValue().getError().getCondition()); @@ -209,7 +209,7 @@ public class InitiationListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.no_acceptable.toString(), argument.getValue().getError().getCondition()); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/CloseTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/CloseTest.java index 2c19fdffe..f57a4683f 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/CloseTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/CloseTest.java @@ -48,7 +48,7 @@ public class CloseTest { @Test public void shouldBeOfIQTypeSET() { Close close = new Close("sessionID"); - assertEquals(IQ.Type.SET, close.getType()); + assertEquals(IQ.Type.set, close.getType()); } @Test diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/DataTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/DataTest.java index 2e12dace6..bca527ef7 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/DataTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/DataTest.java @@ -47,7 +47,7 @@ public class DataTest { public void shouldBeOfIQTypeSET() { DataPacketExtension dpe = mock(DataPacketExtension.class); Data data = new Data(dpe); - assertEquals(IQ.Type.SET, data.getType()); + assertEquals(IQ.Type.set, data.getType()); } private static Properties outputProperties = new Properties(); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/OpenTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/OpenTest.java index ea6143b0f..ef3762b76 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/OpenTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/packet/OpenTest.java @@ -65,7 +65,7 @@ public class OpenTest { @Test public void shouldBeOfIQTypeSET() { Open open = new Open("sessionID", 4096); - assertEquals(IQ.Type.SET, open.getType()); + assertEquals(IQ.Type.set, open.getType()); } @Test diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java index dcdbfe896..2b96a0923 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java @@ -98,7 +98,7 @@ public class InitiationListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.no_acceptable.toString(), argument.getValue().getError().getCondition()); @@ -188,7 +188,7 @@ public class InitiationListenerTest { // assert that reply is the correct error packet assertEquals(initiatorJID, argument.getValue().getTo()); - assertEquals(IQ.Type.ERROR, argument.getValue().getType()); + assertEquals(IQ.Type.error, argument.getValue().getType()); assertEquals(XMPPError.Condition.no_acceptable.toString(), argument.getValue().getError().getCondition()); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java index d6923bb09..5b3ccf63d 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java @@ -432,7 +432,7 @@ public class Socks5ByteStreamManagerTest { } }; - rejectPacket.setType(Type.ERROR); + rejectPacket.setType(Type.error); rejectPacket.setFrom(targetJID); rejectPacket.setTo(initiatorJID); rejectPacket.setError(xmppError); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java index 3b26282d6..296a72cd4 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java @@ -111,7 +111,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertTrue(IQ.class.isInstance(targetResponse)); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType()); + assertEquals(IQ.Type.error, ((IQ) targetResponse).getType()); assertEquals(XMPPError.Condition.item_not_found.toString(), ((IQ) targetResponse).getError().getCondition()); @@ -155,7 +155,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertTrue(IQ.class.isInstance(targetResponse)); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType()); + assertEquals(IQ.Type.error, ((IQ) targetResponse).getType()); assertEquals(XMPPError.Condition.item_not_found.toString(), ((IQ) targetResponse).getError().getCondition()); @@ -203,7 +203,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertTrue(IQ.class.isInstance(targetResponse)); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType()); + assertEquals(IQ.Type.error, ((IQ) targetResponse).getType()); assertEquals(XMPPError.Condition.item_not_found.toString(), ((IQ) targetResponse).getError().getCondition()); } @@ -245,7 +245,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertEquals(Bytestream.class, targetResponse.getClass()); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.RESULT, ((Bytestream) targetResponse).getType()); + assertEquals(IQ.Type.result, ((Bytestream) targetResponse).getType()); assertEquals(proxyJID, ((Bytestream) targetResponse).getUsedHost().getJID()); } @@ -295,7 +295,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertTrue(IQ.class.isInstance(targetResponse)); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.ERROR, ((IQ) targetResponse).getType()); + assertEquals(IQ.Type.error, ((IQ) targetResponse).getType()); assertEquals(XMPPError.Condition.item_not_found.toString(), ((IQ) targetResponse).getError().getCondition()); } @@ -365,7 +365,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertEquals(Bytestream.class, targetResponse.getClass()); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.RESULT, ((Bytestream) targetResponse).getType()); + assertEquals(IQ.Type.result, ((Bytestream) targetResponse).getType()); assertEquals(proxyJID, ((Bytestream) targetResponse).getUsedHost().getJID()); serverSocket.close(); @@ -418,7 +418,7 @@ public class Socks5ByteStreamRequestTest { Packet targetResponse = protocol.getRequests().remove(0); assertEquals(Bytestream.class, targetResponse.getClass()); assertEquals(initiatorJID, targetResponse.getTo()); - assertEquals(IQ.Type.RESULT, ((Bytestream) targetResponse).getType()); + assertEquals(IQ.Type.result, ((Bytestream) targetResponse).getType()); assertEquals(proxyJID, ((Bytestream) targetResponse).getUsedHost().getJID()); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java index d0482e5a9..8adb18755 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java @@ -204,7 +204,7 @@ public class Socks5ClientForInitiatorTest { } }; - error.setType(Type.ERROR); + error.setType(Type.error); error.setFrom(proxyJID); error.setTo(initiatorJID); error.setError(xmppError); @@ -259,7 +259,7 @@ public class Socks5ClientForInitiatorTest { }; activationResponse.setFrom(proxyJID); activationResponse.setTo(initiatorJID); - activationResponse.setType(IQ.Type.RESULT); + activationResponse.setType(IQ.Type.result); protocol.addResponse(activationResponse, Verification.correspondingSenderReceiver, Verification.requestTypeSET, new Verification() { diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5PacketUtils.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5PacketUtils.java index 390793e8c..8beb028ce 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5PacketUtils.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5PacketUtils.java @@ -43,7 +43,7 @@ public class Socks5PacketUtils { bytestream.setFrom(from); bytestream.setTo(to); bytestream.setSessionID(sessionID); - bytestream.setType(IQ.Type.SET); + bytestream.setType(IQ.Type.set); return bytestream; } @@ -60,7 +60,7 @@ public class Socks5PacketUtils { streamHostInfo.getPacketID(); streamHostInfo.setFrom(from); streamHostInfo.setTo(to); - streamHostInfo.setType(IQ.Type.RESULT); + streamHostInfo.setType(IQ.Type.result); return streamHostInfo; } @@ -76,7 +76,7 @@ public class Socks5PacketUtils { discoverItems.getPacketID(); discoverItems.setFrom(from); discoverItems.setTo(to); - discoverItems.setType(IQ.Type.RESULT); + discoverItems.setType(IQ.Type.result); return discoverItems; } @@ -92,7 +92,7 @@ public class Socks5PacketUtils { discoverInfo.getPacketID(); discoverInfo.setFrom(from); discoverInfo.setTo(to); - discoverInfo.setType(IQ.Type.RESULT); + discoverInfo.setType(IQ.Type.result); return discoverInfo; } @@ -115,7 +115,7 @@ public class Socks5PacketUtils { response.getPacketID(); response.setFrom(from); response.setTo(to); - response.setType(IQ.Type.RESULT); + response.setType(IQ.Type.result); return response; } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/caps/EntityCapsManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/caps/EntityCapsManagerTest.java index 0e92e5495..21846a17b 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/caps/EntityCapsManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/caps/EntityCapsManagerTest.java @@ -107,7 +107,7 @@ public class EntityCapsManagerTest extends InitExtensions { di.setFrom("benvolio@capulet.lit/230193"); di.setPacketID("disco1"); di.setTo("juliet@capulet.lit/chamber"); - di.setType(IQ.Type.RESULT); + di.setType(IQ.Type.result); Collection identities = new LinkedList(); DiscoverInfo.Identity i = new DiscoverInfo.Identity("client", "Psi 0.11", "pc"); @@ -160,7 +160,7 @@ public class EntityCapsManagerTest extends InitExtensions { di.setFrom("benvolio@capulet.lit/230193"); di.setPacketID("disco1"); di.setTo(")juliet@capulet.lit/chamber"); - di.setType(IQ.Type.RESULT); + di.setType(IQ.Type.result); Collection identities = new LinkedList(); DiscoverInfo.Identity i = new DiscoverInfo.Identity("client", "Psi 0.11", "pc"); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/iqlast/LastActivityTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/iqlast/LastActivityTest.java index 28fe06d26..a25dc05cc 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/iqlast/LastActivityTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/iqlast/LastActivityTest.java @@ -50,6 +50,6 @@ public class LastActivityTest extends InitExtensions { assertTrue(reply instanceof LastActivity); LastActivity l = (LastActivity) reply; assertEquals("last2", l.getPacketID()); - assertEquals(IQ.Type.RESULT, l.getType()); + assertEquals(IQ.Type.result, l.getType()); } } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/iqversion/VersionTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/iqversion/VersionTest.java index 0d9de24a5..ad6e4c679 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/iqversion/VersionTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/iqversion/VersionTest.java @@ -52,7 +52,7 @@ public class VersionTest { //assertEquals("juliet@capulet.lit/balcony", reply.getFrom()); assertEquals("capulet.lit", reply.getTo()); assertEquals("s2c1", reply.getPacketID()); - assertEquals(IQ.Type.RESULT, reply.getType()); + assertEquals(IQ.Type.result, reply.getType()); assertEquals("Test", reply.getName()); assertEquals("0.23", reply.getVersion()); assertEquals("DummyOS", reply.getOs()); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/KeepaliveTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/KeepaliveTest.java index bc4632102..d24e95ee7 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/KeepaliveTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/KeepaliveTest.java @@ -104,7 +104,7 @@ // public void processPacket(Packet packet) { // latch.countDown(); // } -// }, new IQTypeFilter(IQ.Type.RESULT)); +// }, new IQTypeFilter(IQ.Type.result)); // // // Time based testing kind of sucks, but this should be reliable on a DummyConnection since there // // is no actual server involved. This will provide enough time to ping and wait for the lack of response. diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/PingTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/PingTest.java index ad82d5c95..f3a47a2e5 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/PingTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/ping/PingTest.java @@ -68,7 +68,7 @@ public class PingTest extends InitExtensions { IQ pong = (IQ) pongPacket; assertEquals("capulet.lit", pong.getTo()); assertEquals("s2c1", pong.getPacketID()); - assertEquals(IQ.Type.RESULT, pong.getType()); + assertEquals(IQ.Type.result, pong.getType()); } @Test diff --git a/smack-extensions/src/test/java/org/jivesoftware/util/Verification.java b/smack-extensions/src/test/java/org/jivesoftware/util/Verification.java index 9c7de80d8..d878c6d04 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/util/Verification.java +++ b/smack-extensions/src/test/java/org/jivesoftware/util/Verification.java @@ -51,7 +51,7 @@ public interface Verification { public static Verification requestTypeGET = new Verification() { public void verify(IQ request, Packet response) { - assertEquals(IQ.Type.GET, request.getType()); + assertEquals(IQ.Type.get, request.getType()); } }; @@ -62,7 +62,7 @@ public interface Verification { public static Verification requestTypeSET = new Verification() { public void verify(IQ request, Packet response) { - assertEquals(IQ.Type.SET, request.getType()); + assertEquals(IQ.Type.set, request.getType()); } }; @@ -73,7 +73,7 @@ public interface Verification { public static Verification requestTypeRESULT = new Verification() { public void verify(IQ request, Packet response) { - assertEquals(IQ.Type.RESULT, request.getType()); + assertEquals(IQ.Type.result, request.getType()); } }; @@ -84,7 +84,7 @@ public interface Verification { public static Verification requestTypeERROR = new Verification() { public void verify(IQ request, Packet response) { - assertEquals(IQ.Type.ERROR, request.getType()); + assertEquals(IQ.Type.error, request.getType()); } }; diff --git a/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java b/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java index c4c990c9f..1f855f505 100644 --- a/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java +++ b/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java @@ -143,7 +143,7 @@ public class JingleManagerTest extends SmackTestCase { if (pin instanceof IQ) { System.out.println("packet: " + pin.toXML()); IQ iq = (IQ) pin; - if (iq.getType().equals(IQ.Type.SET)) { + if (iq.getType().equals(IQ.Type.set)) { System.out.println("packet"); if (iq instanceof Jingle) { Jingle jin = (Jingle) pin; @@ -172,7 +172,7 @@ public class JingleManagerTest extends SmackTestCase { iqSent.setTo(getFullJID(0)); iqSent.setFrom(getFullJID(0)); - iqSent.setType(IQ.Type.SET); + iqSent.setType(IQ.Type.set); System.out.println("Sending packet and waiting... "); getConnection(1).sendPacket(iqSent); diff --git a/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/provider/JingleProviderTest.java b/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/provider/JingleProviderTest.java index 55e4728f8..6d86a640f 100644 --- a/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/provider/JingleProviderTest.java +++ b/smack-jingle/src/integration-test/java/org/jivesoftware/smackx/jingle/provider/JingleProviderTest.java @@ -66,7 +66,7 @@ public class JingleProviderTest extends SmackTestCase { iqSent.setTo(getFullJID(0)); iqSent.setFrom(getFullJID(0)); - iqSent.setType(IQ.Type.GET); + iqSent.setType(IQ.Type.get); // Create a filter and a collector... PacketFilter filter = new PacketTypeFilter(IQ.class); @@ -86,7 +86,7 @@ public class JingleProviderTest extends SmackTestCase { if (iqReceived == null) { fail("No response from server"); } - else if (iqReceived.getType() == IQ.Type.ERROR) { + else if (iqReceived.getType() == IQ.Type.error) { fail("The server did reply with an error packet: " + iqReceived.getError().getCode()); } else { diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/ContentNegotiator.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/ContentNegotiator.java index 7c7782dd3..74a2b3705 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/ContentNegotiator.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/ContentNegotiator.java @@ -65,10 +65,10 @@ public class ContentNegotiator extends JingleNegotiator { // match this media manager. if (iq != null) { - if (iq.getType().equals(IQ.Type.ERROR)) { + if (iq.getType().equals(IQ.Type.error)) { // Process errors // TODO getState().eventError(iq); - } else if (iq.getType().equals(IQ.Type.RESULT)) { + } else if (iq.getType().equals(IQ.Type.result)) { // Process ACKs if (isExpectedId(iq.getPacketID())) { removeExpectedId(iq.getPacketID()); diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleManager.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleManager.java index f74b21992..cf2575149 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleManager.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleManager.java @@ -445,7 +445,7 @@ public class JingleManager implements JingleSessionListener { public boolean accept(Packet pin) { if (pin instanceof IQ) { IQ iq = (IQ) pin; - if (iq.getType().equals(IQ.Type.SET)) { + if (iq.getType().equals(IQ.Type.set)) { if (iq instanceof Jingle) { Jingle jin = (Jingle) pin; if (jin.getAction().equals(JingleActionEnum.SESSION_INITIATE)) { diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleSession.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleSession.java index 6cf4cc1e1..fa12a4d80 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleSession.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/JingleSession.java @@ -325,7 +325,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList } // // If the response is anything other than a RESULT then send it now. - // if ((response != null) && (!response.getType().equals(IQ.Type.RESULT))) { + // if ((response != null) && (!response.getType().equals(IQ.Type.result))) { // getConnection().sendPacket(response); // } @@ -351,10 +351,10 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList IQ response = null; if (iq != null) { - if (iq.getType().equals(IQ.Type.ERROR)) { + if (iq.getType().equals(IQ.Type.error)) { // Process errors // TODO getState().eventError(iq); - } else if (iq.getType().equals(IQ.Type.RESULT)) { + } else if (iq.getType().equals(IQ.Type.result)) { // Process ACKs if (isExpectedId(iq.getPacketID())) { @@ -504,8 +504,8 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList if (iq != null) { // Don't acknowledge ACKs, errors... - if (iq.getType().equals(IQ.Type.SET)) { - IQ ack = createIQ(iq.getPacketID(), iq.getFrom(), iq.getTo(), IQ.Type.RESULT); + if (iq.getType().equals(IQ.Type.set)) { + IQ ack = createIQ(iq.getPacketID(), iq.getFrom(), iq.getTo(), IQ.Type.result); // No! Don't send it. Let it flow to the normal way IQ results get processed and sent. // getConnection().sendPacket(ack); @@ -715,10 +715,10 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList } } else { // We accept some non-Jingle IQ packets: ERRORs and ACKs - if (iq.getType().equals(IQ.Type.SET)) { + if (iq.getType().equals(IQ.Type.set)) { LOGGER.fine("Ignored Jingle(TYPE): " + iq.toXML()); return false; - } else if (iq.getType().equals(IQ.Type.GET)) { + } else if (iq.getType().equals(IQ.Type.get)) { LOGGER.fine("Ignored Jingle(TYPE): " + iq.toXML()); return false; } @@ -979,7 +979,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList return; LOGGER.fine("Terminate " + reason); Jingle jout = new Jingle(JingleActionEnum.SESSION_TERMINATE); - jout.setType(IQ.Type.SET); + jout.setType(IQ.Type.set); sendPacket(jout); triggerSessionClosed(reason); } @@ -1062,7 +1062,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList */ public static IQ createError(String ID, String to, String from, int errCode, XMPPError error) { - IQ iqError = createIQ(ID, to, from, IQ.Type.ERROR); + IQ iqError = createIQ(ID, to, from, IQ.Type.error); iqError.setError(error); LOGGER.fine("Created Error Packet:" + iqError.toXML()); @@ -1083,7 +1083,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList public IQ createJingleError(IQ iq, JingleError jingleError) { IQ errorPacket = null; if (jingleError != null) { - errorPacket = createIQ(getSid(), iq.getFrom(), iq.getTo(), IQ.Type.ERROR); + errorPacket = createIQ(getSid(), iq.getFrom(), iq.getTo(), IQ.Type.error); List extList = new ArrayList(); extList.add(jingleError); diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/media/MediaNegotiator.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/media/MediaNegotiator.java index 542ffefca..a86429691 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/media/MediaNegotiator.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/media/MediaNegotiator.java @@ -108,13 +108,13 @@ public class MediaNegotiator extends JingleNegotiator { List responses = new ArrayList(); IQ response = null; - if (iq.getType().equals(IQ.Type.ERROR)) { + if (iq.getType().equals(IQ.Type.error)) { // Process errors setNegotiatorState(JingleNegotiatorState.FAILED); triggerMediaClosed(getBestCommonAudioPt()); // This next line seems wrong, and may subvert the normal closing process. throw new JingleException(iq.getError().getMessage()); - } else if (iq.getType().equals(IQ.Type.RESULT)) { + } else if (iq.getType().equals(IQ.Type.result)) { // Process ACKs if (isExpectedId(iq.getPacketID())) { receiveResult(iq); diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/RTPBridge.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/RTPBridge.java index 8318e741e..764f54fe0 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/RTPBridge.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/RTPBridge.java @@ -458,7 +458,7 @@ public class RTPBridge extends IQ { RTPBridge rtpPacket = new RTPBridge(sessionID, RTPBridge.BridgeAction.change); rtpPacket.setTo(RTPBridge.NAME + "." + connection.getServiceName()); - rtpPacket.setType(Type.SET); + rtpPacket.setType(Type.set); rtpPacket.setPass(pass); rtpPacket.setPortA(localCandidate.getPort()); @@ -493,7 +493,7 @@ public class RTPBridge extends IQ { RTPBridge rtpPacket = new RTPBridge(RTPBridge.BridgeAction.publicip); rtpPacket.setTo(RTPBridge.NAME + "." + xmppConnection.getServiceName()); - rtpPacket.setType(Type.SET); + rtpPacket.setType(Type.set); // LOGGER.debug("Relayed to: " + candidate.getIp() + ":" + candidate.getPort()); diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java index 8c639f8d1..f93fbb6ec 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java @@ -598,13 +598,13 @@ public abstract class TransportNegotiator extends JingleNegotiator { IQ response = null; if (iq != null) { - if (iq.getType().equals(IQ.Type.ERROR)) { + if (iq.getType().equals(IQ.Type.error)) { // Process errors setNegotiatorState(JingleNegotiatorState.FAILED); triggerTransportClosed(null); // This next line seems wrong, and may subvert the normal closing process. throw new JingleException(iq.getError().getMessage()); - } else if (iq.getType().equals(IQ.Type.RESULT)) { + } else if (iq.getType().equals(IQ.Type.result)) { // Process ACKs if (isExpectedId(iq.getPacketID())) { response = receiveResult(iq); diff --git a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/packet/Jingle.java b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/packet/Jingle.java index 2869ed955..c9d0d47d3 100644 --- a/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/packet/Jingle.java +++ b/smack-jingle/src/main/java/org/jivesoftware/smackx/jingle/packet/Jingle.java @@ -97,7 +97,7 @@ public class Jingle extends IQ { // Some default values for the most common situation... action = JingleActionEnum.UNKNOWN; - this.setType(IQ.Type.SET); + this.setType(IQ.Type.set); } /** @@ -116,7 +116,7 @@ public class Jingle extends IQ { // Some default values for the most common situation... action = JingleActionEnum.UNKNOWN; - this.setType(IQ.Type.SET); + this.setType(IQ.Type.set); } /** @@ -129,7 +129,7 @@ public class Jingle extends IQ { this.action = action; // In general, a Jingle with an action is used in a SET packet... - this.setType(IQ.Type.SET); + this.setType(IQ.Type.set); } /** diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Agent.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Agent.java index 391c45bea..fd54f58e5 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Agent.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Agent.java @@ -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); diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java index 206f0687d..9df988865 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java @@ -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> 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); diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java index 9e1ee2334..3b402b1fe 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java @@ -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() { diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferConfirmation.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferConfirmation.java index 9bbe0e403..b6531938b 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferConfirmation.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferConfirmation.java @@ -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; } diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/TranscriptSearchManager.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/TranscriptSearchManager.java index 07d62687c..faaaeadfe 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/TranscriptSearchManager.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/TranscriptSearchManager.java @@ -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()); diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/DepartQueuePacket.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/DepartQueuePacket.java index e22c1a462..cb72bc54a 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/DepartQueuePacket.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/DepartQueuePacket.java @@ -54,7 +54,7 @@ public class DepartQueuePacket extends IQ { this.user = user; setTo(workgroup); - setType(IQ.Type.SET); + setType(IQ.Type.set); setFrom(user); } diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/OfferRequestProvider.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/OfferRequestProvider.java index 223a007f7..cab8b5a6e 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/OfferRequestProvider.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/OfferRequestProvider.java @@ -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; } diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java index 7a7770086..91daeb7de 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java @@ -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(