|
Openfire 3.6.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PubSubService
A PubSubService is responsible for keeping the hosted nodes by the service, the default configuration to use for newly created nodes and specify the policy to use regarding node management.
Implementations of PubSubService are expected to collaborate with a PubSubEngine
that will take care of handling packets sent to the service.
The separation between PubSubService
and PubSubEngine
allows to
reuse the handling of packets and at the same time be able to create different pubsub
services with different configurations. Examples of different pubsub services are:
JEP-60: Publish-Subscribe and JEP-163: Personal Eventing Protocol.
Method Summary | |
---|---|
void |
addNode(Node node)
Adds an already persistent node to the service. |
void |
broadcast(Node node,
Message message,
Collection<JID> jids)
Broadcasts the specified Message containing an event notification to a list of subscribers to the specified node. |
boolean |
canCreateNode(JID creator)
Returns true if the pubsub service allows the specified user to create nodes. |
JID |
getAddress()
Returns the XMPP address of the service. |
Map<String,Map<String,String>> |
getBarePresences()
Returns a registry of the presence's show value of users that subscribed to a node of the pubsub service and for which the node only delivers notifications for online users or node subscriptions deliver events based on the user presence show value. |
DefaultNodeConfiguration |
getDefaultNodeConfiguration(boolean leafType)
Returns the default node configuration for the specified node type or null if the specified node type is not supported by the service. |
int |
getItemsTaskTimeout()
Returns the timeout value for the published items maintenance task. |
Queue<PublishedItem> |
getItemsToAdd()
Gets the queue that holds the items that need to be added to the database. |
Queue<PublishedItem> |
getItemsToDelete()
Gets the queue that holds the items that need to be deleted from the database. |
AdHocCommandManager |
getManager()
Returns the ad-hoc commands manager used for this service. |
Node |
getNode(String nodeID)
Returns the Node that matches the specified node ID or null if
none was found. |
Collection<Node> |
getNodes()
Retuns the collection of nodes hosted by the pubsub service. |
PublishedItemTask |
getPublishedItemTask()
Returns the published item task used for this service. |
CollectionNode |
getRootCollectionNode()
Returns the CollectionNode that acts as the root node of the entire
node hierarchy. |
String |
getServiceID()
Returns a String that uniquely identifies this pubsub service. |
Collection<String> |
getShowPresences(JID subscriber)
Returns the show values of the last know presence of all connected resources of the specified subscriber. |
Timer |
getTimer()
Returns the timer used for the maintenance process of this service. |
boolean |
isCollectionNodesSupported()
Returns true if the pubsub service supports collection nodes. |
boolean |
isInstantNodeSupported()
Returns true if the pubsub service allows users to create nodes without specifying the node ID. |
boolean |
isMultipleSubscriptionsEnabled()
Returns true if a user may have more than one subscription with the node. |
boolean |
isServiceAdmin(JID user)
Returns true if the specified user is a sysadmin of the pubsub service or has admin privileges. |
void |
presenceSubscriptionNotRequired(Node node,
JID user)
Requests the pubsub service to unsubscribe from the presence of the user. |
void |
presenceSubscriptionRequired(Node node,
JID user)
Requests the pubsub service to subscribe to the presence of the user. |
void |
queueItemToAdd(PublishedItem newItem)
Adds the item to the queue of items to add to the database. |
void |
queueItemToRemove(PublishedItem removedItem)
Adds the item to the queue of items to remove from the database. |
void |
removeNode(String nodeID)
Removes the specified node from the service. |
void |
send(Packet packet)
Sends the specified packet. |
void |
sendNotification(Node node,
Message message,
JID jid)
Sends the specified Message containing an event notification to a specific subscriber of the specified node. |
void |
setItemsTaskTimeout(int timeout)
Sets the timeout value for the published items maintenance task. |
void |
setPublishedItemTask(PublishedItemTask task)
Sets the published item task used for this service. |
Method Detail |
---|
JID getAddress()
String getServiceID()
Map<String,Map<String,String>> getBarePresences()
boolean canCreateNode(JID creator)
creator
- the JID of the entity trying to create a new node.
boolean isServiceAdmin(JID user)
user
- the user to check if he has admin privileges.
boolean isInstantNodeSupported()
boolean isCollectionNodesSupported()
CollectionNode
may only hold children nodes of type CollectionNode
or LeafNode
. On the
other hand, LeafNode
can only hold PublishedItem
.
CollectionNode getRootCollectionNode()
CollectionNode
that acts as the root node of the entire
node hierarchy. The returned node does not have a node identifier. If collection
nodes is not supported then return null.
Node getNode(String nodeID)
Node
that matches the specified node ID or null if
none was found.
nodeID
- the ID that uniquely identifies the node in the pubsub service.
Collection<Node> getNodes()
void addNode(Node node)
node
- the persistent node to add to the service.void removeNode(String nodeID)
A future version may support unloading of inactive nodes even though they may still exist in the database.
nodeID
- the ID that uniquely identifies the node in the pubsub service.void broadcast(Node node, Message message, Collection<JID> jids)
node
- the node that triggered the event notification.message
- the message containing the event notification.jids
- the list of entities to get the event notification.void send(Packet packet)
packet
- the packet to send.void sendNotification(Node node, Message message, JID jid)
node
- the node that triggered the event notification.message
- the message containing the event notification.jid
- the entity to get the event notification.DefaultNodeConfiguration getDefaultNodeConfiguration(boolean leafType)
leafType
- true when requesting default configuration of leaf nodes
Collection<String> getShowPresences(JID subscriber)
subscriber
- the JID of the subscriber. This is not the JID of the affiliate.
void presenceSubscriptionRequired(Node node, JID user)
node
- the node that originated the subscription request.user
- the JID of the affiliate to subscribe to his presence.void presenceSubscriptionNotRequired(Node node, JID user)
node
- the node that originated the unsubscription request.user
- the JID of the affiliate to unsubscribe from his presence.boolean isMultipleSubscriptionsEnabled()
void queueItemToAdd(PublishedItem newItem)
newItem
- the item to add to the database.Queue<PublishedItem> getItemsToAdd()
Queue<PublishedItem> getItemsToDelete()
AdHocCommandManager getManager()
PublishedItemTask getPublishedItemTask()
void setPublishedItemTask(PublishedItemTask task)
task
- the PublishedItemTask to set for this service.void queueItemToRemove(PublishedItem removedItem)
removedItem
- the item to remove from the database.Timer getTimer()
int getItemsTaskTimeout()
void setItemsTaskTimeout(int timeout)
timeout
- the timeout value for the published items maintenance task.
|
Openfire 3.6.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |