2014-01-30 15:42:35 +00:00
|
|
|
package de.gultsch.chat.xmpp;
|
|
|
|
|
|
|
|
import de.gultsch.chat.xml.Element;
|
|
|
|
|
|
|
|
public class IqPacket extends Element {
|
|
|
|
|
|
|
|
public static final int TYPE_SET = 0;
|
|
|
|
public static final int TYPE_RESULT = 1;
|
2014-01-30 23:33:01 +00:00
|
|
|
public static final int TYPE_GET = 2;
|
2014-01-30 15:42:35 +00:00
|
|
|
|
|
|
|
private IqPacket(String name) {
|
|
|
|
super(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
public IqPacket(String id, int type) {
|
|
|
|
super("iq");
|
|
|
|
this.setAttribute("id",id);
|
|
|
|
switch (type) {
|
|
|
|
case TYPE_SET:
|
|
|
|
this.setAttribute("type", "set");
|
|
|
|
break;
|
2014-01-30 23:33:01 +00:00
|
|
|
case TYPE_GET:
|
|
|
|
this.setAttribute("type", "get");
|
|
|
|
break;
|
|
|
|
case TYPE_RESULT:
|
|
|
|
this.setAttribute("type", "result");
|
|
|
|
break;
|
2014-01-30 15:42:35 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2014-01-30 23:33:01 +00:00
|
|
|
|
|
|
|
public IqPacket() {
|
|
|
|
super("iq");
|
|
|
|
}
|
2014-01-30 15:42:35 +00:00
|
|
|
|
|
|
|
}
|