Examples of IQ

@author Matt Tucker
  • org.xmpp.packet.IQ
    IQ (Info/Query) packet. IQ packets are used to get and set information on the server, including authentication, roster operations, and creating accounts. Each IQ packet has a specific type that indicates what type of action is being taken: "get", "set", "result", or "error".

    IQ packets can contain a single child element that exists in a extended XML namespace.

  • rocks.xmpp.core.stanza.model.client.IQ
    The implementation of the {@code } element for the client namespace ('jabber:client'). @author Christian Schudt

  • Examples of org.jivesoftware.smack.packet.IQ

      @Test public void testPacketExtension() throws Exception {
       
        OADRPacketCollector packetCollector = new OADRPacketCollector();
          venConnection.addPacketListener(packetCollector, new OADR2PacketFilter());
         
          IQ iq = new OADR2IQ(createEventPayload(), this.marshaller);
          iq.setTo(venConnection.getUser());
          iq.setType(IQ.Type.SET);
         
          vtnConnection.sendPacket(iq);
         
          Packet packet = packetCollector.getQueue().poll(5,TimeUnit.SECONDS);
         
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

      @Test public void testPacketExtension() throws Exception {
       
        OADRPacketCollector packetCollector = new OADRPacketCollector();
          venConnection.addPacketListener(packetCollector, new OADR2PacketFilter());
         
          IQ iq = new OADR2IQ(new OADR2PacketExtension(createEventPayload(), this.marshaller));
          iq.setTo(venConnection.getUser());
          iq.setType(IQ.Type.SET);
         
          vtnConnection.sendPacket(iq);
         
          Packet packet = packetCollector.getQueue().poll(5,TimeUnit.SECONDS);
         
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            catch (XMPPException xmppe)
            {
                logger.warn("Failed to retrieve DiscoverInfo for " + to, xmppe);
            }

            IQ iq = getConferenceInfo((CallPeerJabberImpl)callPeer, version);

            if(iq != null)
            {
                parentProvider.getConnection().sendPacket(iq);
            }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            CoinIQ coinIQ = (CoinIQ)packet;

            //first ack all "set" requests.
            if(coinIQ.getType() == IQ.Type.SET)
            {
                IQ ack = IQ.createResultIQ(coinIQ);
                parentProvider.getConnection().sendPacket(ack);
            }

            String sid = coinIQ.getSID();
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

                //the owners of this packet's sid

                //first ack all "set" requests.
                if(jingleIQ.getType() == IQ.Type.SET)
                {
                    IQ ack = IQ.createResultIQ(jingleIQ);
                    protocolProvider.getConnection().sendPacket(ack);
                }

                try
                {
                    processJingleIQ(jingleIQ);
                }
                catch(Throwable t)
                {
                    logger.info("Error while handling incoming Jingle packet: ", t);

                    /*
                     * The Javadoc on ThreadDeath says: If ThreadDeath is caught by
                     * a method, it is important that it be rethrown so that the
                     * thread actually dies.
                     */
                    if (t instanceof ThreadDeath)
                        throw (ThreadDeath) t;
                }
            }
            else if(packet instanceof SessionIQ)
            {
                SessionIQ sessionIQ = (SessionIQ)packet;

                //first ack all "set" requests.
                if(sessionIQ.getType() == IQ.Type.SET)
                {
                    IQ ack = IQ.createResultIQ(sessionIQ);
                    protocolProvider.getConnection().sendPacket(ack);
                }

                try
                {
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            PingPacket pingRequest = new PingPacket();
            pingRequest.setType(IQ.Type.GET);
            pingRequest.setTo(SERVER_DOMAIN);
            pingRequest.setFrom(TEST_USERNAME1);

            IQ result = (IQ)sendSync(client, pingRequest);
           
            assertNotNull(result);
            assertEquals(IQ.Type.RESULT, result.getType());
            assertEquals(SERVER_DOMAIN, result.getFrom());
            assertEquals(TEST_USERNAME1, result.getTo());
        }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            PingPacket pingRequest = new PingPacket();
            pingRequest.setType(IQ.Type.GET);
            pingRequest.setTo(SERVER_DOMAIN);
            pingRequest.setFrom(TEST_USERNAME1);

            IQ result = (IQ)sendSync(client, pingRequest);
           
           
            assertNotNull(result);
            assertEquals(IQ.Type.ERROR, result.getType());
            assertEquals(SERVER_DOMAIN, result.getFrom());
            assertEquals(TEST_USERNAME1, result.getTo());
            assertEquals("service-unavailable", result.getError().getCondition());
        }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            PingPacket pingRequest = new PingPacket();
            pingRequest.setType(IQ.Type.GET);
            pingRequest.setTo(SERVER_DOMAIN);
            pingRequest.setFrom(TEST_USERNAME1);

            IQ result = (IQ) sendSync(client, pingRequest);

            assertNotNull(result);
            assertEquals(IQ.Type.RESULT, result.getType());
            assertEquals(SERVER_DOMAIN, result.getFrom());
            assertEquals(TEST_USERNAME1, result.getTo());
        }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

    public class BasicClient {

        static class IQListener implements PacketListener {

            public void processPacket(Packet packet) {
                IQ iq = (IQ) packet;
                String iqString = iq.toString();
                System.out.println("T" + System.currentTimeMillis() + " IQ: " + iqString + ": " + iq.toXML());
            }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            PingPacket pingRequest = new PingPacket();
            pingRequest.setType(IQ.Type.GET);
            pingRequest.setTo(SERVER_DOMAIN);
            pingRequest.setFrom(TEST_USERNAME1);

            IQ result = (IQ) sendSync(client, pingRequest);

            assertNotNull(result);
            assertEquals(IQ.Type.ERROR, result.getType());
            assertEquals(SERVER_DOMAIN, result.getFrom());
            assertEquals(TEST_USERNAME1, result.getTo());
            assertEquals("service-unavailable", result.getError().getCondition());
        }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.