Package org.jivesoftware.openfire.pubsub
Class PubSubEventDispatcher
java.lang.Object
org.jivesoftware.openfire.pubsub.PubSubEventDispatcher
Dispatches Pub/Sub events. The following events are supported:
Use
addListener(PubSubListener) and removeListener(PubSubListener) to add or remove event
listeners.- Author:
- Guus der Kinderen, guus@goodbytes.nl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddListener(PubSubListener listener) Registers a listener to receive events.static voiddispatchItemsDeleted(Node.UniqueIdentifier nodeId, Collection<PublishedItem> items) Dispatches that a collection of items was deleted from a node to all listeners.static voiddispatchItemsPublished(Node.UniqueIdentifier nodeId, Collection<PublishedItem> items) Dispatches that a collection of items was published on a node to all listeners.static voidremoveListener(PubSubListener listener) Unregisters a listener to receive events.
-
Constructor Details
-
PubSubEventDispatcher
public PubSubEventDispatcher()
-
-
Method Details
-
addListener
Registers a listener to receive events.- Parameters:
listener- the listener.
-
removeListener
Unregisters a listener to receive events.- Parameters:
listener- the listener.
-
dispatchItemsPublished
public static void dispatchItemsPublished(@Nonnull Node.UniqueIdentifier nodeId, @Nonnull Collection<PublishedItem> items) Dispatches that a collection of items was published on a node to all listeners. All items are published on the same node.- Parameters:
nodeId- the identifier of the node on which the items were published.items- the published items.
-
dispatchItemsDeleted
public static void dispatchItemsDeleted(@Nonnull Node.UniqueIdentifier nodeId, @Nonnull Collection<PublishedItem> items) Dispatches that a collection of items was deleted from a node to all listeners. All items are deleted from the same node.- Parameters:
nodeId- the identifier of the node on which the items were published.items- the deleted items.
-