|
Openfire 3.3.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.pubsub.PubSubModule
public class PubSubModule
Module that implements JEP-60: Publish-Subscribe. By default node collections and instant nodes are supported.
Constructor Summary | |
---|---|
PubSubModule()
|
Method Summary | |
---|---|
void |
addNode(Node node)
Adds an already persistent node to the service. |
void |
addSysadmin(String userJID)
|
void |
addUserAllowedToCreate(String userJID)
|
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. |
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. |
XDataFormImpl |
getExtendedInfo(String name,
String node,
JID senderJID)
Returns an XDataForm with the extended information about the entity or null if none. |
Iterator<String> |
getFeatures(String name,
String node,
JID senderJID)
Returns an Iterator (of String) with the supported features. |
Iterator<org.dom4j.Element> |
getIdentities(String name,
String node,
JID senderJID)
Returns an Iterator (of Element) with the target entity's identities. |
Iterator<DiscoServerItem> |
getItems()
Returns an Iterator (of DiscoServerItem) with the items associated with the server or null if none. |
Iterator<org.dom4j.Element> |
getItems(String name,
String node,
JID senderJID)
Returns an Iterator (of Element) with the target entity's items or null if none. |
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. |
PubSubEngine |
getPubSubEngine()
Returns the pubsub engine responsible for handling packets sent to the pub-sub service. |
CollectionNode |
getRootCollectionNode()
Returns the CollectionNode that acts as the root node of the entire
node hierarchy. |
String |
getServiceDomain()
|
String |
getServiceID()
Returns a String that uniquely identifies this pubsub service. |
String |
getServiceName()
|
Collection<String> |
getShowPresences(JID subscriber)
Returns the show values of the last know presence of all connected resources of the specified subscriber. |
Collection<String> |
getSysadmins()
|
Collection<String> |
getUsersAllowedToCreate()
|
boolean |
hasInfo(String name,
String node,
JID senderJID)
Returns true if we can provide information related to the requested name and node. |
void |
initialize(XMPPServer server)
Initializes the basic module. |
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(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 |
process(Packet packet)
Process an XMPP packet. |
void |
removeNode(String nodeID)
Removes the specified node from the service. |
void |
removeSysadmin(String userJID)
|
void |
removeUserAllowedToCreate(String userJID)
|
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 |
setNodeCreationRestricted(boolean nodeCreationRestricted)
|
void |
start()
Starts the basic module. |
void |
stop()
Stops the basic module. |
Methods inherited from class org.jivesoftware.openfire.container.BasicModule |
---|
destroy, getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PubSubModule()
Method Detail |
---|
public void process(Packet packet)
ChannelHandler
process
in interface ChannelHandler
packet
- a packet to process.public String getServiceID()
PubSubService
getServiceID
in interface PubSubService
public boolean canCreateNode(JID creator)
PubSubService
canCreateNode
in interface PubSubService
creator
- the JID of the entity trying to create a new node.
public boolean isServiceAdmin(JID user)
PubSubService
isServiceAdmin
in interface PubSubService
user
- the user to check if he has admin privileges.
public boolean isInstantNodeSupported()
PubSubService
isInstantNodeSupported
in interface PubSubService
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 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 DefaultNodeConfiguration getDefaultNodeConfiguration(boolean leafType)
PubSubService
getDefaultNodeConfiguration
in interface PubSubService
leafType
- true when requesting default configuration of leaf nodes
public Collection<String> getShowPresences(JID subscriber)
PubSubService
getShowPresences
in interface PubSubService
subscriber
- the JID of the subscriber. This is not the JID of the affiliate.
public void presenceSubscriptionNotRequired(Node node, 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, 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 PubSubEngine getPubSubEngine()
PubSubService
getPubSubEngine
in interface PubSubService
public String getServiceName()
public String getServiceDomain()
public JID getAddress()
PubSubService
getAddress
in interface PubSubService
getAddress
in interface RoutableChannelHandler
public Collection<String> getUsersAllowedToCreate()
public Collection<String> getSysadmins()
public void addSysadmin(String userJID)
public void removeSysadmin(String userJID)
public boolean isNodeCreationRestricted()
public boolean isMultipleSubscriptionsEnabled()
PubSubService
isMultipleSubscriptionsEnabled
in interface PubSubService
public void setNodeCreationRestricted(boolean nodeCreationRestricted)
public void addUserAllowedToCreate(String userJID)
public void removeUserAllowedToCreate(String userJID)
public void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class BasicModule
server
- the server hosting this module.public void start()
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
public void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
public Iterator<DiscoServerItem> getItems()
ServerItemsProvider
getItems
in interface ServerItemsProvider
public Iterator<org.dom4j.Element> getIdentities(String name, String node, JID senderJID)
DiscoInfoProvider
getIdentities
in interface DiscoInfoProvider
name
- the recipient JID's name.node
- the requested disco node.senderJID
- the XMPPAddress of user that sent the disco info request.
public Iterator<String> getFeatures(String name, String node, JID senderJID)
DiscoInfoProvider
getFeatures
in interface DiscoInfoProvider
name
- the recipient JID's name.node
- the requested disco node.senderJID
- the XMPPAddress of user that sent the disco info request.
public XDataFormImpl getExtendedInfo(String name, String node, JID senderJID)
DiscoInfoProvider
getExtendedInfo
in interface DiscoInfoProvider
name
- the recipient JID's name.node
- the requested disco node.senderJID
- the XMPPAddress of user that sent the disco info request.
public boolean hasInfo(String name, String node, JID senderJID)
DiscoInfoProvider
hasInfo
in interface DiscoInfoProvider
name
- the recipient JID's name.node
- the requested disco node.senderJID
- the XMPPAddress of user that sent the disco info request.
public Iterator<org.dom4j.Element> getItems(String name, String node, JID senderJID)
DiscoItemsProvider
getItems
in interface DiscoItemsProvider
name
- the recipient JID's name.node
- the requested disco node.senderJID
- the XMPPAddress of user that sent the disco items request.
public void broadcast(Node node, Message message, Collection<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 send(Packet packet)
PubSubService
send
in interface PubSubService
packet
- the packet to send.public void sendNotification(Node node, Message message, JID jid)
PubSubService
sendNotification
in interface PubSubService
node
- the node that triggered the event notification.message
- the message containing the event notification.jid
- the entity to get the event notification.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 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.
|
Openfire 3.3.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |