Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.pubsub
Class PubSubEngine

java.lang.Object
  extended by org.jivesoftware.wildfire.pubsub.PubSubEngine

public class PubSubEngine
extends Object

A PubSubEngine is responsible for handling packets sent to the pub-sub service.

Author:
Matt Tucker

Constructor Summary
PubSubEngine(PubSubService pubSubService, PacketRouter router)
           
 
Method Summary
 Collection<String> getShowPresences(JID subscriber)
          Returns the show values of the last know presence of all connected resources of the specified subscriber.
 void presenceSubscriptionNotRequired(Node node, JID user)
          Requests the pubsub service to subscribe to the presence of the user.
 void presenceSubscriptionRequired(Node node, JID user)
          Requests the pubsub service to unsubscribe from the presence of the user.
 boolean process(IQ iq)
          Handles IQ packets sent to the pubsub service.
 void process(Message message)
          Handles Message packets sent to the pubsub service.
 void process(Presence presence)
          Handles Presence packets sent to the pubsub service.
 void shutdown()
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PubSubEngine

public PubSubEngine(PubSubService pubSubService,
                    PacketRouter router)
Method Detail

process

public boolean process(IQ iq)
Handles IQ packets sent to the pubsub service. Requests of disco#info and disco#items are not being handled by the engine. Instead the service itself should handle disco packets.

Parameters:
iq - the IQ packet sent to the pubsub service.
Returns:
true if the IQ packet was handled by the engine.

process

public void process(Presence presence)
Handles Presence packets sent to the pubsub service. Only process available and not available presences.

Parameters:
presence - the Presence packet sent to the pubsub service.

process

public void process(Message message)
Handles Message packets sent to the pubsub service. Messages may be of type error when an event notification was sent to a susbcriber whose address is no longer available.

Answers to authorization requests sent to node owners to approve pending subscriptions will also be processed by this method.

Parameters:
message - the Message packet sent to the pubsub service.

start

public void start()

shutdown

public void shutdown()

getShowPresences

public Collection<String> getShowPresences(JID subscriber)
Returns the show values of the last know presence of all connected resources of the specified subscriber. When the subscriber JID is a bare JID then the answered collection will have many entries one for each connected resource. Moreover, if the user is offline then an empty collectin is returned. Available show status is represented by a online value. The rest of the possible show values as defined in RFC 3921.

Parameters:
subscriber - the JID of the subscriber. This is not the JID of the affiliate.
Returns:
an empty collection when offline. Otherwise, a collection with the show value of each connected resource.

presenceSubscriptionNotRequired

public void presenceSubscriptionNotRequired(Node node,
                                            JID user)
Requests the pubsub service to subscribe to the presence of the user. If the service has already subscribed to the user's presence then do nothing.

Parameters:
node - the node that originated the subscription request.
user - the JID of the affiliate to subscribe to his presence.

presenceSubscriptionRequired

public void presenceSubscriptionRequired(Node node,
                                         JID user)
Requests the pubsub service to unsubscribe from the presence of the user. If the service was not subscribed to the user's presence or any node still requires to be subscribed to the user presence then do nothing.

Parameters:
node - the node that originated the unsubscription request.
user - the JID of the affiliate to unsubscribe from his presence.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.