public class PubSubModule extends BasicModule implements ServerItemsProvider, DiscoInfoProvider, DiscoItemsProvider, RoutableChannelHandler, PubSubService, PropertyEventListener
| Constructor and Description |
|---|
PubSubModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(Node node)
Adds an already persistent node to the service.
|
void |
addSysadmin(String userJID) |
void |
addUserAllowedToCreate(String userJID) |
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.
|
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.
|
org.xmpp.forms.DataForm |
getExtendedInfo(String name,
String node,
org.xmpp.packet.JID senderJID)
Returns an XDataForm with the extended information about the entity or null if none.
|
Iterator<String> |
getFeatures(String name,
String node,
org.xmpp.packet.JID senderJID)
Returns an Iterator (of String) with the supported features.
|
Iterator<org.dom4j.Element> |
getIdentities(String name,
String node,
org.xmpp.packet.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<DiscoItem> |
getItems(String name,
String node,
org.xmpp.packet.JID senderJID)
Returns an Iterator (of DiscoItem) with the target entity's items or null if none.
|
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 |
getServiceDomain() |
String |
getServiceID()
Returns a String that uniquely identifies this pubsub service.
|
String |
getServiceName() |
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.
|
Collection<String> |
getSysadmins() |
Collection<String> |
getUsersAllowedToCreate() |
boolean |
hasInfo(String name,
String node,
org.xmpp.packet.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(org.xmpp.packet.JID user)
Returns true if the specified user is a sysadmin of the pubsub service or has
admin privileges.
|
boolean |
isServiceEnabled()
Returns true if the service is available.
|
void |
markedAsSeniorClusterMember() |
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 |
process(org.xmpp.packet.Packet packet)
Process an XMPP packet.
|
void |
propertyDeleted(String property,
Map<String,Object> params)
A property was deleted.
|
void |
propertySet(String property,
Map<String,Object> params)
A property was set.
|
void |
removeNode(String nodeID)
Removes the specified node from the service.
|
void |
removeSysadmin(String userJID) |
void |
removeUserAllowedToCreate(String userJID) |
void |
send(org.xmpp.packet.Packet packet)
Sends the specified packet.
|
void |
sendNotification(Node node,
org.xmpp.packet.Message message,
org.xmpp.packet.JID jid)
Sends the specified Message containing an event notification to a specific
subscriber of the specified node.
|
void |
setNodeCreationRestricted(boolean nodeCreationRestricted) |
void |
setServiceEnabled(boolean enabled) |
void |
start()
Starts the basic module.
|
void |
stop()
Stops the basic module.
|
void |
xmlPropertyDeleted(String property,
Map<String,Object> params)
An XML property was deleted.
|
void |
xmlPropertySet(String property,
Map<String,Object> params)
An XML property was set.
|
destroy, getNamepublic void process(org.xmpp.packet.Packet packet)
ChannelHandlerprocess in interface ChannelHandler<org.xmpp.packet.Packet>packet - a packet to process.public String getServiceID()
PubSubServicegetServiceID in interface PubSubServicepublic boolean canCreateNode(org.xmpp.packet.JID creator)
PubSubServicecanCreateNode in interface PubSubServicecreator - the JID of the entity trying to create a new node.public boolean isServiceAdmin(org.xmpp.packet.JID user)
PubSubServiceisServiceAdmin in interface PubSubServiceuser - the user to check if he has admin privileges.public boolean isInstantNodeSupported()
PubSubServiceisInstantNodeSupported in interface PubSubServicepublic boolean isCollectionNodesSupported()
PubSubServiceCollectionNode
may only hold children nodes of type CollectionNode or LeafNode. On the
other hand, LeafNode can only hold PublishedItem.isCollectionNodesSupported in interface PubSubServicepublic CollectionNode getRootCollectionNode()
PubSubServiceCollectionNode 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 PubSubServicepublic DefaultNodeConfiguration getDefaultNodeConfiguration(boolean leafType)
PubSubServicegetDefaultNodeConfiguration in interface PubSubServiceleafType - true when requesting default configuration of leaf nodespublic Collection<String> getShowPresences(org.xmpp.packet.JID subscriber)
PubSubServicegetShowPresences in interface PubSubServicesubscriber - the JID of the subscriber. This is not the JID of the affiliate.public void presenceSubscriptionNotRequired(Node node, org.xmpp.packet.JID user)
PubSubServicepresenceSubscriptionNotRequired in interface PubSubServicenode - 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)
PubSubServicepresenceSubscriptionRequired in interface PubSubServicenode - the node that originated the subscription request.user - the JID of the affiliate to subscribe to his presence.public String getServiceName()
public String getServiceDomain()
public org.xmpp.packet.JID getAddress()
RoutableChannelHandlergetAddress in interface PubSubServicegetAddress in interface RoutableChannelHandlerpublic Collection<String> getUsersAllowedToCreate()
public Collection<String> getSysadmins()
public void addSysadmin(String userJID)
public void removeSysadmin(String userJID)
public boolean isNodeCreationRestricted()
public boolean isMultipleSubscriptionsEnabled()
PubSubServiceisMultipleSubscriptionsEnabled in interface PubSubServicepublic void setNodeCreationRestricted(boolean nodeCreationRestricted)
public void addUserAllowedToCreate(String userJID)
public void removeUserAllowedToCreate(String userJID)
public void initialize(XMPPServer server)
BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize in interface Moduleinitialize in class BasicModuleserver - the server hosting this module.public void start()
BasicModuleStarts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start in interface Modulestart in class BasicModulepublic void stop()
BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop in interface Modulestop in class BasicModulepublic void setServiceEnabled(boolean enabled)
public boolean isServiceEnabled()
setServiceEnabled(boolean) to
enable or disable the service.public void markedAsSeniorClusterMember()
public Iterator<DiscoServerItem> getItems()
ServerItemsProvidergetItems in interface ServerItemsProviderpublic Iterator<org.dom4j.Element> getIdentities(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProvidergetIdentities in interface DiscoInfoProvidername - 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, org.xmpp.packet.JID senderJID)
DiscoInfoProvidergetFeatures in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.public org.xmpp.forms.DataForm getExtendedInfo(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProvidergetExtendedInfo in interface DiscoInfoProvidername - 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, org.xmpp.packet.JID senderJID)
DiscoInfoProviderhasInfo in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.public Iterator<DiscoItem> getItems(String name, String node, org.xmpp.packet.JID senderJID)
DiscoItemsProvidergetItems in interface DiscoItemsProvidername - 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, org.xmpp.packet.Message message, Collection<org.xmpp.packet.JID> jids)
PubSubServicebroadcast in interface PubSubServicenode - 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(org.xmpp.packet.Packet packet)
PubSubServicesend in interface PubSubServicepacket - the packet to send.public void sendNotification(Node node, org.xmpp.packet.Message message, org.xmpp.packet.JID jid)
PubSubServicesendNotification in interface PubSubServicenode - 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)
PubSubServiceNode that matches the specified node ID or null if
none was found.getNode in interface PubSubServicenodeID - the ID that uniquely identifies the node in the pubsub service.public Collection<Node> getNodes()
PubSubServicegetNodes in interface PubSubServicepublic void addNode(Node node)
PubSubServiceaddNode in interface PubSubServicenode - the persistent node to add to the service.public void removeNode(String nodeID)
PubSubServiceA future version may support unloading of inactive nodes even though they may still exist in the database.
removeNode in interface PubSubServicenodeID - the ID that uniquely identifies the node in the pubsub service.public Map<String,Map<String,String>> getBarePresences()
PubSubServicegetBarePresences in interface PubSubServicepublic AdHocCommandManager getManager()
PubSubServicegetManager in interface PubSubServicepublic void propertySet(String property, Map<String,Object> params)
PropertyEventListenerpropertySet in interface PropertyEventListenerproperty - the name of the property.params - event parameters.public void propertyDeleted(String property, Map<String,Object> params)
PropertyEventListenerpropertyDeleted in interface PropertyEventListenerproperty - the name of the property deleted.params - event parameters.public void xmlPropertySet(String property, Map<String,Object> params)
PropertyEventListenerxmlPropertySet in interface PropertyEventListenerproperty - the name of the property.params - event parameters.public void xmlPropertyDeleted(String property, Map<String,Object> params)
PropertyEventListenerxmlPropertyDeleted in interface PropertyEventListenerproperty - the name of the property.params - event parameters.Copyright © 2003-2008 Jive Software.