Package org.jivesoftware.smackx.pubsub.packet

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub.addExtension()


   */
  public Subscription subscribe(String jid, SubscribeForm subForm)
    throws XMPPException
  {
    PubSub request = createPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
    request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm));
    PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.SET, request);
    return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
  }

  /**
 
View Full Code Here


    PubSub request = createPubsubPacket(to, Type.SET, new NodeExtension(PubSubElementType.CREATE, name));
    boolean isLeafNode = true;
   
    if (config != null)
    {
      request.addExtension(new FormNode(FormNodeType.CONFIGURE, config));
      FormField nodeTypeField = config.getField(ConfigureNodeFields.node_type.getFieldName());
     
      if (nodeTypeField != null)
        isLeafNode = nodeTypeField.getValues().next().equals(NodeType.leaf.toString());
    }
View Full Code Here

   
    if (ns != null)
    {
      request.setPubSubNamespace(ns);
    }
    request.addExtension(ext);
   
    return request;
  }

  static Packet sendPubsubPacket(Connection con, String to, Type type, PacketExtension ext)
View Full Code Here

            {
              PacketExtension ext = PacketParserUtils.parsePacketExtension(parser.getName(), namespace, parser);
             
              if (ext != null)
              {
                pubsub.addExtension(ext);
              }
            }
            else if (eventType == XmlPullParser.END_TAG)
            {
                if (parser.getName().equals("pubsub"))
View Full Code Here

   */
  public Subscription subscribe(String jid, SubscribeForm subForm)
    throws XMPPException
  {
    PubSub request = createPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
    request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm));
    PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.SET, request);
    return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
  }

  /**
 
View Full Code Here

    PubSub request = createPubsubPacket(to, Type.SET, new NodeExtension(PubSubElementType.CREATE, name));
    boolean isLeafNode = true;
   
    if (config != null)
    {
      request.addExtension(new FormNode(FormNodeType.CONFIGURE, config));
      FormField nodeTypeField = config.getField(ConfigureNodeFields.node_type.getFieldName());
     
      if (nodeTypeField != null)
        isLeafNode = nodeTypeField.getValues().next().equals(NodeType.leaf.toString());
    }
View Full Code Here

   
    if (ns != null)
    {
      request.setPubSubNamespace(ns);
    }
    request.addExtension(ext);
   
    return request;
  }

  static Packet sendPubsubPacket(Connection con, String to, Type type, PacketExtension ext)
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.