Package org.jivesoftware.smackx.pubsub.packet

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


   * @param submitForm
   */
  public void sendConfigurationForm(Form submitForm)
    throws XMPPException
  {
    PubSub packet = createPubsubPacket(Type.SET, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER);
    SyncPacketSend.getReply(con, packet);
  }
View Full Code Here


   * @throws XMPPException
   */
  public List<Subscription> getSubscriptions()
    throws XMPPException
  {
    PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId()));
    SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS);
    return subElem.getSubscriptions();
  }
View Full Code Here

   * @exception XMPPException
   */
  public Subscription subscribe(String jid)
    throws XMPPException
  {
    PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
    return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
  }
View Full Code Here

   * @exception XMPPException
   */
  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

   * @throws XMPPException
   */
  public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId)
    throws XMPPException
  {
    PubSub packet = (PubSub)sendPubsubPacket(Type.GET, new OptionsExtension(jid, getId(), subscriptionId));
    FormNode ext = (FormNode)packet.getExtension(PubSubElementType.OPTIONS);
    return new SubscribeForm(ext.getForm());
  }
View Full Code Here

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

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

   
    for (String id : ids)
    {
      itemList.add(new Item(id));
    }
    PubSub request = createPubsubPacket(Type.GET, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList));
   
    PubSub result = (PubSub)SyncPacketSend.getReply(con, request);
    ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
    return (List<T>)itemsElem.getItems();
  }
View Full Code Here

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

   * @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

TOP

Related Classes of org.jivesoftware.smackx.pubsub.packet.PubSub

Copyright © 2018 www.massapicom. 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.