Lines Matching refs:IQ

26  * The base IQ (Info/Query) packet. IQ packets are used to get and set information
28 * accounts. Each IQ packet has a specific type that indicates what type of action
31 * IQ packets can contain a single child element that exists in a specific XML
33 * type of IQ packet it is. Some example IQ subpacket snippets:<ul>
35 * <li>&lt;query xmlns="jabber:iq:auth"&gt; -- an authentication IQ.
36 * <li>&lt;query xmlns="jabber:iq:private"&gt; -- a private storage IQ.
37 * <li>&lt;pubsub xmlns="http://jabber.org/protocol/pubsub"&gt; -- a pubsub IQ.
42 public abstract class IQ extends Packet {
46 public IQ() {
50 public IQ(IQ iq) {
55 * Returns the type of the IQ packet.
57 * @return the type of the IQ packet.
64 * Sets the type of the IQ packet.
66 * @param type the type of the IQ packet.
110 * Returns the sub-element XML section of the IQ packet, or <tt>null</tt> if there
115 * @return the child element section of the IQ XML.
120 * Convenience method to create a new empty {@link Type#RESULT IQ.Type.RESULT}
121 * IQ based on a {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET}
122 * IQ. The new packet will be initialized with:<ul>
123 * <li>The sender set to the recipient of the originating IQ.
124 * <li>The recipient set to the sender of the originating IQ.
125 * <li>The type set to {@link Type#RESULT IQ.Type.RESULT}.
126 * <li>The id set to the id of the originating IQ.
127 * <li>No child element of the IQ element.
130 * @param iq the {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET} IQ packet.
131 * @throws IllegalArgumentException if the IQ packet does not have a type of
132 * {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET}.
133 * @return a new {@link Type#RESULT IQ.Type.RESULT} IQ based on the originating IQ.
135 public static IQ createResultIQ(final IQ request) {
138 "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML());
140 final IQ result = new IQ() {
153 * Convenience method to create a new {@link Type#ERROR IQ.Type.ERROR} IQ
154 * based on a {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET}
155 * IQ. The new packet will be initialized with:<ul>
156 * <li>The sender set to the recipient of the originating IQ.
157 * <li>The recipient set to the sender of the originating IQ.
158 * <li>The type set to {@link Type#ERROR IQ.Type.ERROR}.
159 * <li>The id set to the id of the originating IQ.
160 * <li>The child element contained in the associated originating IQ.
164 * @param iq the {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET} IQ packet.
165 * @param error the error to associate with the created IQ packet.
166 * @throws IllegalArgumentException if the IQ packet does not have a type of
167 * {@link Type#GET IQ.Type.GET} or {@link Type#SET IQ.Type.SET}.
168 * @return a new {@link Type#ERROR IQ.Type.ERROR} IQ based on the originating IQ.
170 public static IQ createErrorResponse(final IQ request, final XMPPError error) {
173 "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML());
175 final IQ result = new IQ() {
189 * A class to represent the type of the IQ packet. The types are:
192 * <li>IQ.Type.GET
193 * <li>IQ.Type.SET
194 * <li>IQ.Type.RESULT
195 * <li>IQ.Type.ERROR