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.calclab.emite.core.client.xmpp.stanzas.IQ

          }
      });
        }

        public void bindResource(final String resource) {
      final IQ iq = new IQ(IQ.Type.set);
      iq.setId("bind-resource");
      iq.addChild("bind", "urn:ietf:params:xml:ns:xmpp-bind").addChild("resource", null).setText(resource);

      connection.send(iq);
        }
    View Full Code Here

    Examples of com.calclab.emite.core.client.xmpp.stanzas.IQ

        } else if (name.equals("presence")) {
            onPresence.fire(new Presence(stanza));
        } else if (name.equals("iq")) {
            final String type = stanza.getAttribute("type");
            if ("get".equals(type) || "set".equals(type)) {
          onIQ.fire(new IQ(stanza));
            } else {
          iqManager.handle(stanza);
            }
        } else if (transaction != null && "stream:features".equals(name) && stanza.hasChild("mechanisms")) {
            saslManager.sendAuthorizationRequest(transaction);
    View Full Code Here

    Examples of com.calclab.emite.core.client.xmpp.stanzas.IQ

        public void onSessionCreated(final Listener<XmppURI> listener) {
      onSessionCreated.add(listener);
        }

        public void requestSession(final XmppURI uri) {
      final IQ iq = new IQ(IQ.Type.set, uri.getHostURI());
      iq.setFrom(uri);
      iq.setAttribute("id", "im-session-request");
      iq.Includes("session", "urn:ietf:params:xml:ns:xmpp-session");

      connection.send(iq);
        }
    View Full Code Here

    Examples of com.calclab.emite.core.stanzas.IQ

       *            the other entity jid
       * @param order
       *            i din't read the spec... is that necessary?
       */
      public void blockUserBasedOnJID(final String listName, final XmppURI uri, final int order) {
        final IQ iq = new IQ(IQ.Type.set);
        final XMLPacket list = iq.addQuery(XmppNamespaces.PRIVACY).addChild("list", null);
        list.setAttribute("name", listName);
        final XMLPacket item = list.addChild("item", null);
        item.setAttribute("type", "jid");
        item.setAttribute("value", uri.getJID().toString());
        item.setAttribute("action", "deny");
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

       *
       * @see com.sissi.persistent.PersistentElement#read(java.util.Map)
       */
      @Override
      public Element read(Map<String, Object> element) {
        return IQ.class.cast(super.read(element, new IQ())).setId(element.get(Dictionary.FIELD_SID).toString()).setFrom(this.delegation).add(new Si().setId(element.get(Dictionary.FIELD_SID).toString()).setSource(element.get(Dictionary.FIELD_FROM).toString()).setProfile(this.profile).setFeature(this.feature).setFile(new File().setName(element.get(Dictionary.FIELD_NAME).toString()).setSize(element.get(Dictionary.FIELD_SIZE).toString())).delay(super.toString(element, Dictionary.FIELD_DELAY)));
      }
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

       *
       * @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
       */
      public boolean input(JIDContext context, Protocol protocol) {
        String host = protocol.cast(Si.class).setId(protocol.parent().getId()).host(super.build(protocol.parent().getTo()).asString(this.resource), context.jid().asString(this.resource));
        context.write(new IQ().add(new Bytestreams().setSid(this.persistent.peek(MongoUtils.asMap(BasicDBObjectBuilder.start(Dictionary.FIELD_SID, protocol.parent().getId()).get()), MongoUtils.asMap(BasicDBObjectBuilder.start("$addToSet", BasicDBObjectBuilder.start(Dictionary.FIELD_HOST, host).get()).get())).get(Dictionary.FIELD_SID).toString()).add(this.streamhost, true)).setFrom(this.delegation).setId(host).setType(ProtocolType.SET));
        return true;
      }
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

    */
    public class IQTimeCallProcessor implements Input {

      @Override
      public boolean input(JIDContext context, Protocol protocol) {
        context.write(new IQ().add(ServerAck.now().setId(protocol.parent().getId())).setId(UUID.randomUUID().toString()).setFrom(protocol.getTo()).setType(ProtocolType.SET));
        return true;
      }
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

      @Override
      public RelationCascade update(JID master, JID slave) {
        RosterRelation relation = this.ourRelation.ourRelation(master, slave).cast(RosterRelation.class);
        // 激活则广播
        if (relation.activate()) {
          this.broadcastProtocol.broadcast(master, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(relation))).setType(ProtocolType.SET));
        }
        return this;
      }
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

        }
        return this;
      }

      public RelationCascade remove(JID master, JID slave) {
        this.broadcastProtocol.broadcast(master, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(slave).addOnEmpty(this.remove).setSubscription(RosterSubscription.REMOVE))).setType(ProtocolType.SET));
        return this;
      }
    View Full Code Here

    Examples of com.sissi.protocol.iq.IQ

        this.proxy = proxy;
      }

      @Override
      public boolean input(JIDContext context, Protocol protocol) {
        return this.proxy.input(context, new Owner().destory(new Destory().reason(this.tip)).parent(new IQ().setTo(protocol.parent().getTo()).setType(ProtocolType.SET)));
      }
    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.