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 com.sissi.protocol.iq.IQ

      }

      @Override
      public PingKeepalive ping(JIDContext context) {
        String uid = UUID.randomUUID().toString();
        this.timeouts.offer(new PingTimeout(context.ping(uid.hashCode()).write(new IQ().setId(uid).add(Ping.PING).setType(ProtocolType.GET), true)));
        return this;
      }
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

    public class PresenceRosterUnSubscribed2ItemProcessor extends ProxyProcessor {

      @Override
      public boolean input(JIDContext context, Protocol protocol) {
        JID to = super.build(protocol.getTo());
        super.broadcast(to, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(to, context.jid()).cast(RosterRelation.class)))).setType(ProtocolType.SET));
        return true;
      }
    View Full Code Here

    Examples of jabber.client.Iq

                if (LOG.isDebugEnabled()) {
                    LOG.debug("Iq Private " + debugString(iq) + " any: " + query.getAny());
                }

                Iq result = createResult(iq);
                jabber.iq._private.Query answer = new jabber.iq._private.Query();
                result.setAny(answer);
                transport.marshall(result);
            } else if (any instanceof jabber.iq.roster.Query) {
                jabber.iq.roster.Query query = (jabber.iq.roster.Query)any;

                if (LOG.isDebugEnabled()) {
                    LOG.debug("Iq Roster " + debugString(iq) + " item: " + query.getItem());
                }

                Iq result = createResult(iq);
                jabber.iq.roster.Query roster = new jabber.iq.roster.Query();
                result.setAny(roster);
                transport.marshall(result);
            } else if (any instanceof org.jabber.protocol.disco_items.Query) {
                onDiscoItems(iq, (org.jabber.protocol.disco_items.Query)any);
            } else if (any instanceof org.jabber.protocol.disco_info.Query) {
                onDiscoInfo(iq, (org.jabber.protocol.disco_info.Query)any);
            } else {
                if (any instanceof Element) {
                    Element element = (Element)any;
                    LOG.warn("Iq Unknown " + debugString(iq) + " element namespace: " + element.getNamespaceURI() + " localName: " + element.getLocalName());
                } else {
                    LOG.warn("Iq Unknown " + debugString(iq) + " any: " + any + " of type: " + any.getClass().getName());
                }
                Iq result = createResult(iq);
                jabber.client.Error error = new Error();
                error.setUnexpectedRequest("Don't understand: " + any.toString());
                result.setAny(error);
                transport.marshall(result);
            }
        }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

        /** "Reject" button pressed */
        protected void doNay() {
            // we don't want to accept the file so we need to send the IQ error message
            // to the Initiator
            IQ errorPacket = receive.getSI().createConfirmationMessage();
            errorPacket.setType(IQ.Type.ERROR);

            errorPacket.setError(new XMPPError(403,"forbidden"));
            sendPacket( errorPacket );
            dispose();
        }
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

                    .createPacketCollector(new PacketIDFilter(request.getPacketID()));

            con.sendPacket(request);

            // Wait up to 5 seconds for a result.
            IQ result = (IQ) collector.nextResult(SmackConfiguration
                    .getPacketReplyTimeout());
            if( dialog.cancelled ) return;

            if (result != null && result.getType() == IQ.Type.RESULT) {
                Version v = (Version) result;

                field.setText(v.getName() + " " + v.getVersion() + " / "
                        + v.getOs());
            } else
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            con.sendPacket(request);


            // Wait up to 5 seconds for a result.
            IQ result = (IQ) collector.nextResult(SmackConfiguration
                    .getPacketReplyTimeout());
            collector.cancel();
            if( dialog.cancelled ) return;

            if (result != null && result.getType() == IQ.Type.RESULT) {
                Time t = (Time) result;

                field.setText(t.getDisplay());
            } else
                field.setText("N/A");
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

                    .createPacketCollector(new PacketIDFilter(request.getPacketID()));

            con.sendPacket(request);

            // Wait up to 5 seconds for a result.
            IQ result = (IQ) collector.nextResult(SmackConfiguration
                    .getPacketReplyTimeout());
            if( dialog.cancelled ) return;

            if (result != null && result.getType() == IQ.Type.RESULT) {
                LastActivity t = (LastActivity) result;

                field.setText(t.showTime());
            } else
                field.setText("N/A");
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

                new PacketTypeFilter(IQ.class));

            PacketCollector packetCollector =
                BuddyList.getInstance().getConnection().createPacketCollector(filter);

            IQ reply = (IQ) packetCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
            if(reply == null)
            {
                SwingUtilities.invokeLater( new Runnable()
                {
                    public void run()
                    {
                        JOptionPane.showMessageDialog(SearchDialog.this,
                            resources.getString("searchRequestTimeout"),
                            resources.getString("searchError"),
                            JOptionPane.OK_OPTION);
                    }
                } );
                returnVal = false;
            }
            else
            {
                if(reply.getType() == IQ.Type.ERROR)
                {
                    SwingUtilities.invokeLater( new Runnable()
                    {
                        public void run()
                        {
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

            PacketFilter filter = new AndFilter(new PacketIDFilter(srch.getPacketID()),
                new PacketTypeFilter(IQ.class));
            PacketCollector packetCollector =
                BuddyList.getInstance().getConnection().createPacketCollector(filter);

            final IQ reply = (IQ) packetCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
            if(reply == null)
            {
                SwingUtilities.invokeLater( new Runnable()
                {
                    public void run()
    View Full Code Here

    Examples of org.jivesoftware.smack.packet.IQ

                PacketCollector collector = BuddyList.getInstance().getConnection()
                        .createPacketCollector(filter);
                BuddyList.getInstance().getConnection().sendPacket(register);

                // collect the response
                IQ result = (IQ) collector.nextResult(SmackConfiguration
                        .getPacketReplyTimeout());
                wait.dispose();

                if (stopped)
                    return;

                if (result == null) {
                    errorMessage = resources.getString("unknownError");
                } else if (result.getType() == IQ.Type.ERROR) {
                    errorMessage = result.getError().getMessage();
                    if (errorMessage == null)
                        errorMessage = resources.getString("unknownError");
                }

                // display the error message if there was one
    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.