Change IQ.Type to enum

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

View File

@ -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());
}

View File

@ -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();
}

View File

@ -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<String, String> 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<String, String> map = new HashMap<String, String>();
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<String, String> attributes = new HashMap<String, String>();
// To delete an account, we add a single attribute, "remove", that is blank.

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);

View File

@ -28,10 +28,10 @@ import org.jivesoftware.smack.packet.IQ.Type;
*/
public class IQTypeFilter extends FlexiblePacketTypeFilter<IQ> {
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;

View File

@ -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() {

View File

@ -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:<ul>
* <li>The sender set to the recipient of the originating IQ.
* <li>The recipient set to the sender of the originating IQ.
* <li>The type set to {@link Type#RESULT IQ.Type.RESULT}.
* <li>The type set to {@link Type#result IQ.Type.result}.
* <li>The id set to the id of the originating IQ.
* <li>No child element of the IQ element.
* </ul>
*
* @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:<ul>
* <li>The sender set to the recipient of the originating IQ.
* <li>The recipient set to the sender of the originating IQ.
* <li>The type set to {@link Type#ERROR IQ.Type.ERROR}.
* <li>The type set to {@link Type#error IQ.Type.error}.
* <li>The id set to the id of the originating IQ.
* <li>The child element contained in the associated originating IQ.
* <li>The provided {@link XMPPError XMPPError}.
* </ul>
*
* @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:
*
* <ul>
* <li>IQ.Type.GET
* <li>IQ.Type.SET
* <li>IQ.Type.RESULT
* <li>IQ.Type.ERROR
* <li>IQ.Type.get
* <li>IQ.Type.set
* <li>IQ.Type.result
* <li>IQ.Type.error
* </ul>
*/
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;
}
}
}

View File

@ -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

View File

@ -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;

View File

@ -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 <query/> element MUST NOT contain any <item/> 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);

View File

@ -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");

View File

@ -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();
}

View File

@ -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);

View File

@ -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);

View File

@ -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();

View File

@ -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());
}

View File

@ -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);

View File

@ -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

View File

@ -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);
}
/**

View File

@ -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);
}
/**

View File

@ -62,7 +62,7 @@ public class Open extends IQ {
this.sessionID = sessionID;
this.blockSize = blockSize;
this.stanza = stanza;
setType(Type.SET);
setType(Type.set);
}
/**

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -217,7 +217,7 @@ public class Bytestream extends IQ {
StringBuilder buf = new StringBuilder();
buf.append("<query xmlns=\"http://jabber.org/protocol/bytestreams\"");
if (this.getType().equals(IQ.Type.SET)) {
if (this.getType().equals(IQ.Type.set)) {
if (getSessionID() != null) {
buf.append(" sid=\"").append(getSessionID()).append("\"");
}
@ -234,7 +234,7 @@ public class Bytestream extends IQ {
buf.append(getToActivate().toXML());
}
}
else if (this.getType().equals(IQ.Type.RESULT)) {
else if (this.getType().equals(IQ.Type.result)) {
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 {

View File

@ -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());

View File

@ -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);
}

View File

@ -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);

View File

@ -90,7 +90,7 @@ public class AdHocCommandData extends IQ {
}
buf.append(">");
if (getType() == Type.RESULT) {
if (getType() == Type.result) {
buf.append("<actions");
if (executeAction != null) {

View File

@ -120,9 +120,9 @@ public class ServiceDiscoveryManager extends Manager {
if (connection == null) return;
DiscoverItems discoverItems = (DiscoverItems) packet;
// Send back the items defined in the client if the request is of type GET
if (discoverItems != null && discoverItems.getType() == IQ.Type.GET) {
if (discoverItems != null && discoverItems.getType() == IQ.Type.get) {
DiscoverItems response = new DiscoverItems();
response.setType(IQ.Type.RESULT);
response.setType(IQ.Type.result);
response.setTo(discoverItems.getFrom());
response.setPacketID(discoverItems.getPacketID());
response.setNode(discoverItems.getNode());
@ -139,7 +139,7 @@ public class ServiceDiscoveryManager extends Manager {
} else if(discoverItems.getNode() != null) {
// Return <item-not-found/> 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 <item-not-found/> 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);

View File

@ -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);
}

View File

@ -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()));

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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());

View File

@ -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) {

View File

@ -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();
}

View File

@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.StringUtils;
* <pre>
* // 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...
* }</pre><p>
@ -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;

View File

@ -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<String> 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<Affiliate> 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<Occupant> 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);

View File

@ -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

View File

@ -28,7 +28,7 @@ public class Ping extends IQ {
public Ping(String to) {
setTo(to);
setType(IQ.Type.GET);
setType(IQ.Type.get);
}
@Override

View File

@ -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());

View File

@ -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();

View File

@ -71,7 +71,7 @@ public class LeafNode extends Node
@SuppressWarnings("unchecked")
public <T extends Item> List<T> 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 <T extends Item> List<T> 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 <T extends Item> List<T> 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 <T extends Item> List<T> 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 <T extends Item> void publish(Collection<T> items) throws NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(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 <T extends Item> void send(Collection<T> items) throws NoResponseException, XMPPErrorException, NotConnectedException
{
PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(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();
}
}

View File

@ -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<Subscription> 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());
}

View File

@ -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<Subscription> 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<Affiliation> 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);
}

View File

@ -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();

View File

@ -48,7 +48,7 @@ public class SharedGroupManager {
public static List<String> 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();

View File

@ -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("<si xmlns=\"http://jabber.org/protocol/si\" ");
if (getSessionID() != null) {
buf.append("id=\"").append(getSessionID()).append("\" ");
@ -151,7 +151,7 @@ public class StreamInitiation extends IQ {
buf.append(fileXML);
}
}
else if (this.getType().equals(IQ.Type.RESULT)) {
else if (this.getType().equals(IQ.Type.result)) {
buf.append("<si xmlns=\"http://jabber.org/protocol/si\">");
}
else {

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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());

View File

@ -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());

View File

@ -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;

View File

@ -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());

View File

@ -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());
}

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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());
}

View File

@ -432,7 +432,7 @@ public class Socks5ByteStreamManagerTest {
}
};
rejectPacket.setType(Type.ERROR);
rejectPacket.setType(Type.error);
rejectPacket.setFrom(targetJID);
rejectPacket.setTo(initiatorJID);
rejectPacket.setError(xmppError);

View File

@ -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());
}

View File

@ -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<Bytestream, IQ>() {

View File

@ -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;
}

View File

@ -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<DiscoverInfo.Identity> identities = new LinkedList<DiscoverInfo.Identity>();
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<DiscoverInfo.Identity> identities = new LinkedList<DiscoverInfo.Identity>();
DiscoverInfo.Identity i = new DiscoverInfo.Identity("client", "Psi 0.11", "pc");

View File

@ -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());
}
}

View File

@ -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());

View File

@ -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.

View File

@ -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

View File

@ -51,7 +51,7 @@ public interface Verification<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeGET = new Verification<IQ, Packet>() {
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<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeSET = new Verification<IQ, Packet>() {
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<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeRESULT = new Verification<IQ, Packet>() {
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<T extends Packet, S extends Packet> {
public static Verification<IQ, Packet> requestTypeERROR = new Verification<IQ, Packet>() {
public void verify(IQ request, Packet response) {
assertEquals(IQ.Type.ERROR, request.getType());
assertEquals(IQ.Type.error, request.getType());
}
};

View File

@ -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);

View File

@ -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 {

View File

@ -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());

View File

@ -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)) {

View File

@ -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<PacketExtension> extList = new ArrayList<PacketExtension>();
extList.add(jingleError);

View File

@ -108,13 +108,13 @@ public class MediaNegotiator extends JingleNegotiator {
List<IQ> responses = new ArrayList<IQ>();
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);

View File

@ -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());

View File

@ -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);

View File

@ -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);
}
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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