Examples of PubSub


Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @throws XMPPException
   */
  public <T extends Item> List<T> getItems(int maxItems, String subscriptionId)
    throws XMPPException
  {
    PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId, maxItems));
   
    PubSub result = (PubSub)SyncPacketSend.getReply(con, request);
    ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
    return (List<T>)itemsElem.getItems();
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   *
   * For synchronous calls use {@link #send() send()}.
   */
  public void publish()
  {
    PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId()));
   
    con.sendPacket(packet);
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   *
   * @param items - The collection of items being sent
   */
  public <T extends Item> void publish(Collection<T> items)
  {
    PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
   
    con.sendPacket(packet);
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @throws XMPPException
   */
  public void send()
    throws XMPPException
  {
    PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId()));
   
    SyncPacketSend.getReply(con, packet);
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @throws XMPPException
   */
  public <T extends Item> void send(Collection<T> items)
    throws XMPPException
  {
    PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
   
    SyncPacketSend.getReply(con, packet);
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @throws XMPPException
   */
  public void deleteAllItems()
    throws XMPPException
  {
    PubSub request = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace());
   
    SyncPacketSend.getReply(con, request);
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   
    for (String id : itemIds)
    {
      items.add(new Item(id));
    }
    PubSub request = createPubsubPacket(Type.SET, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items));
    SyncPacketSend.getReply(con, request);
  }
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @exception XMPPException
   */
  public LeafNode createNode()
    throws XMPPException
  {
    PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.CREATE));
    NodeExtension elem = (NodeExtension)reply.getExtension("create", PubSubNamespace.BASIC.getXmlns());
   
    LeafNode newNode = new LeafNode(con, elem.getNode());
    newNode.setTo(to);
    nodeMap.put(newNode.getId(), newNode);
   
View Full Code Here

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @exception XMPPException
   */
  public Node createNode(String name, Form config)
    throws XMPPException
  {
    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

Examples of org.jivesoftware.smackx.pubsub.packet.PubSub

   * @throws XMPPException
   */
  public List<Affiliation> getAffiliations()
    throws XMPPException
  {
    PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.AFFILIATIONS));
    AffiliationsExtension listElem = (AffiliationsExtension)reply.getExtension(PubSubElementType.AFFILIATIONS);
    return listElem.getAffiliations();
  }
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.