| java.lang.Object org.jivesoftware.openfire.pubsub.PubSubEngine
PubSubEngine | public class PubSubEngine (Code) | | A PubSubEngine is responsible for handling packets sent to a pub-sub service.
author: Matt Tucker |
Method Summary | |
void | cancelQueuedItems(PubSubService service, Collection<PublishedItem> items) Cancels any queued operation for the specified list of items. | public static Collection<String> | getShowPresences(PubSubService service, JID subscriber) Returns the show values of the last know presence of all connected resources of the
specified subscriber. | public static void | presenceSubscriptionNotRequired(PubSubService service, Node node, JID user) Requests the pubsub service to subscribe to the presence of the user. | public static void | presenceSubscriptionRequired(PubSubService service, Node node, JID user) Requests the pubsub service to unsubscribe from the presence of the user. | public boolean | process(PubSubService service, IQ iq) Handles IQ packets sent to the pubsub service. | public void | process(PubSubService service, Presence presence) Handles Presence packets sent to the pubsub service. | public void | process(PubSubService service, Message message) Handles Message packets sent to the pubsub service. | public static void | queueItemToAdd(PubSubService service, PublishedItem newItem) Adds the item to the queue of items to add to the database. | public static void | queueItemToRemove(PubSubService service, PublishedItem removedItem) Adds the item to the queue of items to remove from the database. | void | sendErrorPacket(IQ packet, PacketError.Condition error, Element pubsubError) Generate a conflict packet to indicate that the nickname being requested/used is already in
use by another user. | void | setPublishedItemTaskTimeout(PubSubService service, int timeout) Schedules the maintenance task for repeated fixed-delay execution,
beginning after the specified delay. | public void | shutdown(PubSubService service) | public void | start(PubSubService service) |
cancelQueuedItems | void cancelQueuedItems(PubSubService service, Collection<PublishedItem> items)(Code) | | Cancels any queued operation for the specified list of items. This operation is
usually required when a node was deleted so any pending operation of the node items
should be cancelled.
Parameters: service - the PubSub service this action is to be performed for. Parameters: items - the list of items to remove the from queues. |
getShowPresences | public static Collection<String> getShowPresences(PubSubService service, JID subscriber)(Code) | | 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: service - the PubSub service this action is to be performed for. Parameters: subscriber - the JID of the subscriber. This is not the JID of the affiliate. an empty collection when offline. Otherwise, a collection with the show valueof each connected resource. |
presenceSubscriptionNotRequired | public static void presenceSubscriptionNotRequired(PubSubService service, Node node, JID user)(Code) | | 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: service - the PubSub service this action is to be performed for. Parameters: node - the node that originated the subscription request. Parameters: user - the JID of the affiliate to subscribe to his presence. |
presenceSubscriptionRequired | public static void presenceSubscriptionRequired(PubSubService service, Node node, JID user)(Code) | | 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: service - the PubSub service this action is to be performed for. Parameters: node - the node that originated the unsubscription request. Parameters: user - the JID of the affiliate to unsubscribe from his presence. |
process | public boolean process(PubSubService service, IQ iq)(Code) | | 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: service - the PubSub service this action is to be performed for. Parameters: iq - the IQ packet sent to the pubsub service. true if the IQ packet was handled by the engine. |
process | public void process(PubSubService service, Presence presence)(Code) | | Handles Presence packets sent to the pubsub service. Only process available and not
available presences.
Parameters: service - the PubSub service this action is to be performed for. Parameters: presence - the Presence packet sent to the pubsub service. |
process | public void process(PubSubService service, Message message)(Code) | | 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: service - the PubSub service this action is to be performed for. Parameters: message - the Message packet sent to the pubsub service. |
queueItemToAdd | public static void queueItemToAdd(PubSubService service, PublishedItem newItem)(Code) | | Adds the item to the queue of items to add to the database. The queue is going
to be processed by another thread.
Parameters: service - the PubSub service this action is to be performed for. Parameters: newItem - the item to add to the database. |
queueItemToRemove | public static void queueItemToRemove(PubSubService service, PublishedItem removedItem)(Code) | | Adds the item to the queue of items to remove from the database. The queue is going
to be processed by another thread.
Parameters: service - the PubSub service this action is to be performed for. Parameters: removedItem - the item to remove from the database. |
sendErrorPacket | void sendErrorPacket(IQ packet, PacketError.Condition error, Element pubsubError)(Code) | | Generate a conflict packet to indicate that the nickname being requested/used is already in
use by another user.
Parameters: packet - the packet to be bounced. |
setPublishedItemTaskTimeout | void setPublishedItemTaskTimeout(PubSubService service, int timeout)(Code) | | Schedules the maintenance task for repeated fixed-delay execution,
beginning after the specified delay. Subsequent executions take place
at approximately regular intervals separated by the specified period.
Parameters: service - the PubSub service this action is to be performed for. Parameters: timeout - the new frequency of the maintenance task. |
|
|