|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.pep.PEPService
public class PEPService
A PEPService is a PubSubService
for use with XEP-0163: "Personal Eventing via
Pubsub" Version 1.0
Note: Although this class implements Cacheable
, instances should only be
cached in caches that have time-based (as opposed to size-based) eviction policies.
Constructor Summary | |
---|---|
PEPService(XMPPServer server,
String bareJID)
Constructs a PEPService. |
Method Summary | |
---|---|
void |
addNode(Node node)
Adds an already persistent node to the service. |
void |
broadcast(Node node,
org.xmpp.packet.Message message,
Collection<org.xmpp.packet.JID> jids)
Broadcasts the specified Message containing an event notification to a list of subscribers to the specified node. |
boolean |
canCreateNode(org.xmpp.packet.JID creator)
Returns true if the pubsub service allows the specified user to create nodes. |
org.xmpp.packet.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. |
int |
getCachedSize()
Returns the approximate size of the Object in bytes. |
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. |
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. |
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(org.xmpp.packet.JID subscriber)
Returns the show values of the last know presence of all connected resources of the specified subscriber. |
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 |
isNodeCreationRestricted()
|
boolean |
isServiceAdmin(org.xmpp.packet.JID user)
Returns true if the specified user is a sysadmin of the pubsub service or has admin privileges. |
void |
presenceSubscriptionNotRequired(Node node,
org.xmpp.packet.JID user)
Requests the pubsub service to unsubscribe from the presence of the user. |
void |
presenceSubscriptionRequired(Node node,
org.xmpp.packet.JID user)
Requests the pubsub service to subscribe to the presence of the user. |
void |
removeNode(String nodeID)
Removes the specified node from the service. |
void |
send(org.xmpp.packet.Packet packet)
Sends the specified packet. |
void |
sendLastPublishedItems(org.xmpp.packet.JID recipientJID)
Sends an event notification for the last published item of each leaf node under the root collection node to the recipient JID. |
void |
sendNotification(Node node,
org.xmpp.packet.Message message,
org.xmpp.packet.JID recipientJID)
Sends the specified Message containing an event notification to a specific subscriber of the specified node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PEPService(XMPPServer server, String bareJID)
server
- the XMPP server.bareJID
- the bare JID (service ID) of the user owning the service.Method Detail |
---|
public void addNode(Node node)
PubSubService
addNode
in interface PubSubService
node
- the persistent node to add to the service.public void removeNode(String nodeID)
PubSubService
A future version may support unloading of inactive nodes even though they may still exist in the database.
removeNode
in interface PubSubService
nodeID
- the ID that uniquely identifies the node in the pubsub service.public Node getNode(String nodeID)
PubSubService
Node
that matches the specified node ID or null if
none was found.
getNode
in interface PubSubService
nodeID
- the ID that uniquely identifies the node in the pubsub service.
public Collection<Node> getNodes()
PubSubService
getNodes
in interface PubSubService
public CollectionNode getRootCollectionNode()
PubSubService
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.
getRootCollectionNode
in interface PubSubService
public org.xmpp.packet.JID getAddress()
PubSubService
getAddress
in interface PubSubService
public String getServiceID()
PubSubService
getServiceID
in interface PubSubService
public DefaultNodeConfiguration getDefaultNodeConfiguration(boolean leafType)
PubSubService
getDefaultNodeConfiguration
in interface PubSubService
leafType
- true when requesting default configuration of leaf nodes
public Collection<String> getShowPresences(org.xmpp.packet.JID subscriber)
PubSubService
getShowPresences
in interface PubSubService
subscriber
- the JID of the subscriber. This is not the JID of the affiliate.
public boolean canCreateNode(org.xmpp.packet.JID creator)
PubSubService
canCreateNode
in interface PubSubService
creator
- the JID of the entity trying to create a new node.
public boolean isCollectionNodesSupported()
PubSubService
CollectionNode
may only hold children nodes of type CollectionNode
or LeafNode
. On the
other hand, LeafNode
can only hold PublishedItem
.
isCollectionNodesSupported
in interface PubSubService
public boolean isInstantNodeSupported()
PubSubService
isInstantNodeSupported
in interface PubSubService
public boolean isMultipleSubscriptionsEnabled()
PubSubService
isMultipleSubscriptionsEnabled
in interface PubSubService
public boolean isServiceAdmin(org.xmpp.packet.JID user)
PubSubService
isServiceAdmin
in interface PubSubService
user
- the user to check if he has admin privileges.
public boolean isNodeCreationRestricted()
public void presenceSubscriptionNotRequired(Node node, org.xmpp.packet.JID user)
PubSubService
presenceSubscriptionNotRequired
in interface PubSubService
node
- the node that originated the unsubscription request.user
- the JID of the affiliate to unsubscribe from his presence.public void presenceSubscriptionRequired(Node node, org.xmpp.packet.JID user)
PubSubService
presenceSubscriptionRequired
in interface PubSubService
node
- the node that originated the subscription request.user
- the JID of the affiliate to subscribe to his presence.public void send(org.xmpp.packet.Packet packet)
PubSubService
send
in interface PubSubService
packet
- the packet to send.public void broadcast(Node node, org.xmpp.packet.Message message, Collection<org.xmpp.packet.JID> jids)
PubSubService
broadcast
in interface PubSubService
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.public void sendNotification(Node node, org.xmpp.packet.Message message, org.xmpp.packet.JID recipientJID)
PubSubService
sendNotification
in interface PubSubService
node
- the node that triggered the event notification.message
- the message containing the event notification.recipientJID
- the entity to get the event notification.public void sendLastPublishedItems(org.xmpp.packet.JID recipientJID)
Depending on the subscription configuration the event notifications may or may not have a payload, may not be sent if a keyword (i.e. filter) was defined and it was not matched.
recipientJID
- the recipient that is to receive the last published item notifications.public Map<String,Map<String,String>> getBarePresences()
PubSubService
getBarePresences
in interface PubSubService
public AdHocCommandManager getManager()
PubSubService
getManager
in interface PubSubService
public int getCachedSize()
Cacheable
getCachedSize
in interface Cacheable
|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |