tigase.jaxmpp.core.client.xmpp.modules.pubsub
Class PubSubModule

java.lang.Object
  extended by tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule<Message>
      extended by tigase.jaxmpp.core.client.xmpp.modules.pubsub.PubSubModule
All Implemented Interfaces:
XmppModule

public class PubSubModule
extends AbstractStanzaModule<Message>

Publish-Subscribe Module.

This module implementation of XEP-0060: Publish-Subscribe.

Author:
bmalkow

Nested Class Summary
static class PubSubModule.PublishAsyncCallback
           
static class PubSubModule.PubSubEvent
           
static class PubSubModule.RetrieveItemsAsyncCallback
           
static class PubSubModule.SubscriptionAsyncCallback
           
static class PubSubModule.SubscriptionOptionsAsyncCallback
           
 
Field Summary
static Criteria CRIT
           
static EventType NotificationReceived
           
 
Fields inherited from class tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule
log, observable, sessionObject, writer
 
Constructor Summary
PubSubModule(Observable parentObservable, SessionObject sessionObject, PacketWriter packetWriter)
           
 
Method Summary
 void configureSubscription(BareJID pubSubJID, String nodeName, JID subscriberJID, JabberDataElement form, AsyncCallback callback)
           
 void configureSubscription(BareJID pubSubJID, String nodeName, JID subscriberJID, JabberDataElement form, PubSubAsyncCallback callback)
           
 void createNode(BareJID pubSubJID, String nodeName, AsyncCallback callback)
          Create node on PubSub Service.
 void createNode(BareJID pubSubJID, String nodeName, Element config, AsyncCallback callback)
          Create node on PubSub Service.
 void createNode(BareJID pubSubJID, String nodeName, Element config, PubSubAsyncCallback callback)
          Create node on PubSub Service.
 void createNode(BareJID pubSubJID, String nodeName, PubSubAsyncCallback callback)
          Create node on PubSub Service.
static JabberDataElement createNodeConfiguration()
          Create empty jabber:x:data element prepared to submit.
 void deleteItem(BareJID pubSubJID, String nodeName, String itemId, AsyncCallback callback)
           
 void deleteItem(BareJID pubSubJID, String nodeName, String itemId, PubSubAsyncCallback callback)
           
 void deleteNode(BareJID pubSubJID, String nodeName, AsyncCallback callback)
          Delete node from PubSub service.
 void deleteNode(BareJID pubSubJID, String nodeName, PubSubAsyncCallback callback)
          Delete node from PubSub service.
protected  void fireNotificationReceived(Message message, String nodeName, String itemType, String itemId, Element payload, Date delayTime)
           
 Criteria getCriteria()
          Criteria
 void getDefaultSubscriptionConfiguration(BareJID pubSubJID, String nodeName, AsyncCallback callback)
           
 void getDefaultSubscriptionConfiguration(BareJID pubSubJID, String nodeName, PubSubModule.SubscriptionOptionsAsyncCallback callback)
           
 String[] getFeatures()
           Returns features what are implemented by Module.
 void getSubscriptionConfiguration(BareJID pubSubJID, String nodeName, JID subscriberJID, AsyncCallback callback)
           
 void getSubscriptionConfiguration(BareJID pubSubJID, String nodeName, JID subscriberJID, PubSubModule.SubscriptionOptionsAsyncCallback callback)
           
 void process(Message message)
           
 void publishItem(BareJID pubSubJID, String nodeName, String itemId, Element payload, AsyncCallback callback)
           
 void publishItem(BareJID pubSubJID, String nodeName, String itemId, Element payload, PubSubModule.PublishAsyncCallback callback)
           
 void retrieveItem(BareJID pubSubJID, String nodeName, AsyncCallback callback)
           
 void retrieveItem(BareJID pubSubJID, String nodeName, PubSubModule.RetrieveItemsAsyncCallback callback)
           
 void retrieveItem(BareJID pubSubJID, String nodeName, String itemId, AsyncCallback callback)
           
 void retrieveItem(BareJID pubSubJID, String nodeName, String itemId, Integer maxItems, AsyncCallback callback)
           
 void retrieveItem(BareJID pubSubJID, String nodeName, String itemId, PubSubModule.RetrieveItemsAsyncCallback callback)
           
 void subscribe(BareJID pubSubJID, String nodeName, JID subscriberJID, JabberDataElement options, AsyncCallback callback)
           
 void subscribe(BareJID pubSubJID, String nodeName, JID subscriberJID, JabberDataElement options, PubSubModule.SubscriptionAsyncCallback callback)
           
 void subscribe(BareJID pubSubJID, String nodeName, JID subscriberJID, PubSubModule.SubscriptionAsyncCallback callback)
           
 void unlockItem(BareJID pubSubJID, String nodeName, String itemId, AsyncCallback callback)
           
 void unlockItem(BareJID pubSubJID, String nodeName, String itemId, PubSubAsyncCallback callback)
           
 void unsubscribe(BareJID pubSubJID, String nodeName, JID subscriberJID, AsyncCallback callback)
           
 void unsubscribe(BareJID pubSubJID, String nodeName, JID subscriberJID, PubSubAsyncCallback callback)
           
 
Methods inherited from class tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule
addListener, addListener, process, removeAllListeners, removeListener, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRIT

public static final Criteria CRIT

NotificationReceived

public static final EventType NotificationReceived
Constructor Detail

PubSubModule

public PubSubModule(Observable parentObservable,
                    SessionObject sessionObject,
                    PacketWriter packetWriter)
Method Detail

createNodeConfiguration

public static JabberDataElement createNodeConfiguration()
                                                 throws JaxmppException
Create empty jabber:x:data element prepared to submit.

Returns:
empty submitable node configuration element.
Throws:
JaxmppException

configureSubscription

public void configureSubscription(BareJID pubSubJID,
                                  String nodeName,
                                  JID subscriberJID,
                                  JabberDataElement form,
                                  AsyncCallback callback)
                           throws JaxmppException,
                                  XMLException
Throws:
JaxmppException
XMLException

configureSubscription

public void configureSubscription(BareJID pubSubJID,
                                  String nodeName,
                                  JID subscriberJID,
                                  JabberDataElement form,
                                  PubSubAsyncCallback callback)
                           throws JaxmppException,
                                  XMLException
Throws:
JaxmppException
XMLException

createNode

public void createNode(BareJID pubSubJID,
                       String nodeName,
                       AsyncCallback callback)
                throws JaxmppException
Create node on PubSub Service.

Parameters:
pubSubJID - PubSub service address
nodeName - name of node to be created
callback - callback
Throws:
JaxmppException

createNode

public void createNode(BareJID pubSubJID,
                       String nodeName,
                       Element config,
                       AsyncCallback callback)
                throws JaxmppException
Create node on PubSub Service.

Parameters:
pubSubJID - PubSub service address
nodeName - name of node to be created
config - node configuration
callback - callback
Throws:
JaxmppException

createNode

public void createNode(BareJID pubSubJID,
                       String nodeName,
                       Element config,
                       PubSubAsyncCallback callback)
                throws JaxmppException
Create node on PubSub Service.

Parameters:
pubSubJID - PubSub service address
nodeName - name of node to be created
config - node configuration
callback - callback
Throws:
JaxmppException

createNode

public void createNode(BareJID pubSubJID,
                       String nodeName,
                       PubSubAsyncCallback callback)
                throws JaxmppException
Create node on PubSub Service.

Parameters:
pubSubJID - PubSub service address
nodeName - name of node to be created
config - node configuration
callback - callback
Throws:
JaxmppException

deleteItem

public void deleteItem(BareJID pubSubJID,
                       String nodeName,
                       String itemId,
                       AsyncCallback callback)
                throws JaxmppException,
                       JaxmppException
Throws:
JaxmppException

deleteItem

public void deleteItem(BareJID pubSubJID,
                       String nodeName,
                       String itemId,
                       PubSubAsyncCallback callback)
                throws JaxmppException
Throws:
JaxmppException

deleteNode

public void deleteNode(BareJID pubSubJID,
                       String nodeName,
                       AsyncCallback callback)
                throws JaxmppException
Delete node from PubSub service.

Parameters:
pubSubJID - address of PubSub service
nodeName - na of node to delete
callback - callback
Throws:
JaxmppException

deleteNode

public void deleteNode(BareJID pubSubJID,
                       String nodeName,
                       PubSubAsyncCallback callback)
                throws JaxmppException
Delete node from PubSub service.

Parameters:
pubSubJID - address of PubSub service
nodeName - na of node to delete
callback - callback
Throws:
JaxmppException

fireNotificationReceived

protected void fireNotificationReceived(Message message,
                                        String nodeName,
                                        String itemType,
                                        String itemId,
                                        Element payload,
                                        Date delayTime)
                                 throws JaxmppException
Throws:
JaxmppException

getCriteria

public Criteria getCriteria()
Description copied from interface: XmppModule
Criteria

Returns:

getDefaultSubscriptionConfiguration

public void getDefaultSubscriptionConfiguration(BareJID pubSubJID,
                                                String nodeName,
                                                AsyncCallback callback)
                                         throws JaxmppException
Throws:
JaxmppException

getDefaultSubscriptionConfiguration

public void getDefaultSubscriptionConfiguration(BareJID pubSubJID,
                                                String nodeName,
                                                PubSubModule.SubscriptionOptionsAsyncCallback callback)
                                         throws JaxmppException
Throws:
JaxmppException

getFeatures

public String[] getFeatures()
Description copied from interface: XmppModule

Returns features what are implemented by Module.

See Service Discovery Features

Returns:
array of features

getSubscriptionConfiguration

public void getSubscriptionConfiguration(BareJID pubSubJID,
                                         String nodeName,
                                         JID subscriberJID,
                                         AsyncCallback callback)
                                  throws JaxmppException
Throws:
JaxmppException

getSubscriptionConfiguration

public void getSubscriptionConfiguration(BareJID pubSubJID,
                                         String nodeName,
                                         JID subscriberJID,
                                         PubSubModule.SubscriptionOptionsAsyncCallback callback)
                                  throws JaxmppException
Throws:
JaxmppException

process

public void process(Message message)
             throws JaxmppException
Specified by:
process in class AbstractStanzaModule<Message>
Throws:
JaxmppException

publishItem

public void publishItem(BareJID pubSubJID,
                        String nodeName,
                        String itemId,
                        Element payload,
                        AsyncCallback callback)
                 throws JaxmppException
Throws:
JaxmppException

publishItem

public void publishItem(BareJID pubSubJID,
                        String nodeName,
                        String itemId,
                        Element payload,
                        PubSubModule.PublishAsyncCallback callback)
                 throws JaxmppException
Throws:
JaxmppException

retrieveItem

public void retrieveItem(BareJID pubSubJID,
                         String nodeName,
                         AsyncCallback callback)
                  throws JaxmppException
Throws:
JaxmppException

retrieveItem

public void retrieveItem(BareJID pubSubJID,
                         String nodeName,
                         PubSubModule.RetrieveItemsAsyncCallback callback)
                  throws JaxmppException
Throws:
JaxmppException

retrieveItem

public void retrieveItem(BareJID pubSubJID,
                         String nodeName,
                         String itemId,
                         AsyncCallback callback)
                  throws JaxmppException
Throws:
JaxmppException

retrieveItem

public void retrieveItem(BareJID pubSubJID,
                         String nodeName,
                         String itemId,
                         Integer maxItems,
                         AsyncCallback callback)
                  throws JaxmppException
Throws:
JaxmppException

retrieveItem

public void retrieveItem(BareJID pubSubJID,
                         String nodeName,
                         String itemId,
                         PubSubModule.RetrieveItemsAsyncCallback callback)
                  throws JaxmppException
Throws:
JaxmppException

subscribe

public void subscribe(BareJID pubSubJID,
                      String nodeName,
                      JID subscriberJID,
                      JabberDataElement options,
                      AsyncCallback callback)
               throws JaxmppException
Throws:
JaxmppException

subscribe

public void subscribe(BareJID pubSubJID,
                      String nodeName,
                      JID subscriberJID,
                      JabberDataElement options,
                      PubSubModule.SubscriptionAsyncCallback callback)
               throws JaxmppException
Throws:
JaxmppException

subscribe

public void subscribe(BareJID pubSubJID,
                      String nodeName,
                      JID subscriberJID,
                      PubSubModule.SubscriptionAsyncCallback callback)
               throws JaxmppException
Throws:
JaxmppException

unlockItem

public void unlockItem(BareJID pubSubJID,
                       String nodeName,
                       String itemId,
                       AsyncCallback callback)
                throws JaxmppException
Throws:
JaxmppException

unlockItem

public void unlockItem(BareJID pubSubJID,
                       String nodeName,
                       String itemId,
                       PubSubAsyncCallback callback)
                throws JaxmppException
Throws:
JaxmppException

unsubscribe

public void unsubscribe(BareJID pubSubJID,
                        String nodeName,
                        JID subscriberJID,
                        AsyncCallback callback)
                 throws JaxmppException
Throws:
JaxmppException

unsubscribe

public void unsubscribe(BareJID pubSubJID,
                        String nodeName,
                        JID subscriberJID,
                        PubSubAsyncCallback callback)
                 throws JaxmppException
Throws:
JaxmppException


Copyright © 2006-2012 Tigase. All Rights Reserved.