Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.muc.spi
Class MultiUserChatServerImpl

java.lang.Object
  extended by org.jivesoftware.wildfire.container.BasicModule
      extended by org.jivesoftware.wildfire.muc.spi.MultiUserChatServerImpl
All Implemented Interfaces:
ChannelHandler, Module, DiscoInfoProvider, DiscoItemsProvider, ServerItemsProvider, MultiUserChatServer, RoutableChannelHandler, Component

public class MultiUserChatServerImpl
extends BasicModule
implements MultiUserChatServer, ServerItemsProvider, DiscoInfoProvider, DiscoItemsProvider, RoutableChannelHandler

Implements the chat server as a cached memory resident chat server. The server is also responsible for responding Multi-User Chat disco requests as well as removing inactive users from the rooms after a period of time and to maintain a log of the conversation in the rooms that require to log their conversations. The conversations log is saved to the database using a separate process

Temporary rooms are held in memory as long as they have occupants. They will be destroyed after the last occupant left the room. On the other hand, persistent rooms are always present in memory even after the last occupant left the room. In order to keep memory clean of peristent rooms that have been forgotten or abandonded this class includes a clean up process. The clean up process will remove from memory rooms that haven't had occupants for a while. Moreover, forgotten or abandoned rooms won't be loaded into memory when the Multi-User Chat service starts up.

Author:
Gaston Dombiak

Field Summary
 long totalChatTime
          The total time all agents took to chat *
 
Constructor Summary
MultiUserChatServerImpl()
          Create a new group chat server.
 
Method Summary
 void addSysadmin(String userJID)
          Adds a new system administrator of the MUC service.
 void addUserAllowedToCreate(String userJID)
          Adds a new user to the list of JIDs that are allowed to create MUC rooms.
 void enableService(boolean enabled)
          Enables or disables the MUC service.
 JID getAddress()
          Returns the XMPP address.
 MUCRoom getChatRoom(String roomName)
          Obtains a chatroom by name.
 MUCRoom getChatRoom(String roomName, JID userjid)
          Obtains a chatroom by name.
 List<MUCRoom> getChatRooms()
          Retuns a list with a snapshot of all the rooms in the server (i.e.
 MUCUser getChatUser(JID userjid)
          Obtain a chat user by XMPPAddress.
 String getDescription()
          Returns the description of this component.
 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.
 HistoryStrategy getHistoryStrategy()
          Obtain the server-wide default message history settings.
 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.
 int getKickIdleUsersTimeout()
          Returns the time to elapse between clearing of idle chat users.
 int getLogConversationBatchSize()
          Returns the number of messages to save to the database on each run of the logging process.
 int getLogConversationsTimeout()
          Returns the time to elapse between logging the room conversations.
 int getNumberChatRooms()
          Retuns the number of existing rooms in the server (i.e.
 int getNumberConnectedUsers()
          Retuns the total number of occupants in all rooms in the server.
 int getNumberRoomOccupants()
          Retuns the total number of users that have joined in all rooms in the server.
 String getServiceDomain()
          Returns the fully-qualifed domain name of this chat service.
 String getServiceName()
          Returns the subdomain of the chat service.
 Collection<String> getSysadmins()
          Returns the collection of JIDs that are system administrators of the MUC service.
 long getTotalChatTime()
          Returns the total chat time of all rooms combined.
 int getUserIdleTime()
          Returns the number of milliseconds a user must be idle before he/she gets kicked from all the rooms.
 Collection<String> getUsersAllowedToCreate()
          Returns the collection of JIDs that are allowed to create MUC rooms.
 boolean hasChatRoom(String roomName)
          Returns true if the server includes a chatroom with the requested name.
 boolean hasInfo(String name, String node, JID senderJID)
          Returns true if we can provide information related to the requested name and node.
 void initialize(JID jid, ComponentManager componentManager)
          Initializes this component with a ComponentManager and the JID that this component is available at (e.g.
 void initialize(XMPPServer server)
          Initializes the basic module.
 boolean isAllowToDiscoverLockedRooms()
          Returns the flag that indicates if the service should provide information about locked rooms when handling service discovery requests.
 boolean isRoomCreationRestricted()
          Returns false if anyone can create rooms or true if only the returned JIDs in getUsersAllowedToCreate are allowed to create rooms.
 boolean isServiceEnabled()
          Returns true if the MUC service is available.
 void logConversation(MUCRoom room, Message message, JID sender)
          Logs that a given message was sent to a room as part of a conversation.
 void messageBroadcastedTo(int numOccupants)
          Notification message indicating the server that an incoming message was broadcasted to a given number of occupants.
 void process(Packet packet)
          Process an XMPP packet.
 void processPacket(Packet packet)
          Processes a packet sent to this Component.
 void removeChatRoom(String roomName)
          Removes the room associated with the given name.
 void removeSysadmin(String userJID)
          Removes a system administrator of the MUC service.
 void removeUser(JID jabberID)
          Removes a user from all chat rooms.
 void removeUserAllowedToCreate(String userJID)
          Removes a user from list of JIDs that are allowed to create MUC rooms.
 void serverBroadcast(String msg)
          Broadcast a given message to all members of this chat room.
 void setAllowToDiscoverLockedRooms(boolean allowToDiscoverLockedRooms)
          Sets the flag that indicates if the service should provide information about locked rooms when handling service discovery requests.
 void setKickIdleUsersTimeout(int timeout)
          Sets the time to elapse between clearing of idle chat users.
 void setLogConversationBatchSize(int size)
          Sets the number of messages to save to the database on each run of the logging process.
 void setLogConversationsTimeout(int timeout)
          Sets the time to elapse between logging the room conversations.
 void setRoomCreationRestricted(boolean roomCreationRestricted)
          Sets if anyone can create rooms or if only the returned JIDs in getUsersAllowedToCreate are allowed to create rooms.
 void setServiceName(String name)
          Set the name of this chat service.
 void setUserIdleTime(int idleTime)
          Sets the number of milliseconds a user must be idle before he/she gets kicked from all the rooms.
 void shutdown()
          Shuts down this component.
 void start()
          Starts the basic module.
 void stop()
          Stops the basic module.
 
Methods inherited from class org.jivesoftware.wildfire.container.BasicModule
destroy, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmpp.component.Component
getName
 

Field Detail

totalChatTime

public long totalChatTime
The total time all agents took to chat *

Constructor Detail

MultiUserChatServerImpl

public MultiUserChatServerImpl()
Create a new group chat server.

Method Detail

getDescription

public String getDescription()
Description copied from interface: Component
Returns the description of this component.

Specified by:
getDescription in interface Component
Returns:
the description of this component.

process

public void process(Packet packet)
             throws UnauthorizedException,
                    PacketException
Description copied from interface: ChannelHandler
Process an XMPP packet.

Specified by:
process in interface ChannelHandler
Parameters:
packet - a packet to process.
Throws:
UnauthorizedException - if not allowed to process the packet.
PacketException - thrown if the packet is malformed (results in the sender's session being shutdown).

processPacket

public void processPacket(Packet packet)
Description copied from interface: Component
Processes a packet sent to this Component.

Specified by:
processPacket in interface Component
Parameters:
packet - the packet.
See Also:
ComponentManager.sendPacket(Component, Packet)

initialize

public void initialize(JID jid,
                       ComponentManager componentManager)
Description copied from interface: Component
Initializes this component with a ComponentManager and the JID that this component is available at (e.g. service.example.com). If a ComponentException is thrown then the component will not be loaded.

The initialization code must not rely on receiving packets from the server since the component has not been fully initialized yet. This means that at this point the component must not rely on information that is obtained from the server such us discovered items.

Specified by:
initialize in interface Component
Parameters:
jid - the XMPP address that this component is available at.
componentManager - the component manager.

shutdown

public void shutdown()
Description copied from interface: Component
Shuts down this component. All component resources must be released as part of shutdown.

Specified by:
shutdown in interface Component

getServiceDomain

public String getServiceDomain()
Description copied from interface: MultiUserChatServer
Returns the fully-qualifed domain name of this chat service. The domain is composed by the service name and the name of the XMPP server where the service is running.

Specified by:
getServiceDomain in interface MultiUserChatServer
Returns:
the chat server domain (service name + host name).

getAddress

public JID getAddress()
Description copied from interface: RoutableChannelHandler
Returns the XMPP address. The address is used by services like the core server packet router to determine if a packet should be sent to the handler. Handlers that are working on behalf of the server should use the generic server hostname address (e.g. server.com).

Specified by:
getAddress in interface RoutableChannelHandler
Returns:
the XMPP address.

getChatRoom

public MUCRoom getChatRoom(String roomName,
                           JID userjid)
                    throws NotAllowedException
Description copied from interface: MultiUserChatServer
Obtains a chatroom by name. A chatroom is created for that name if none exists and the user has permission. The user that asked for the chatroom will be the room's owner if the chatroom was created.

Specified by:
getChatRoom in interface MultiUserChatServer
Parameters:
roomName - Name of the room to get.
userjid - The user's normal jid, not the chat nickname jid.
Returns:
The chatroom for the given name.
Throws:
NotAllowedException - If the caller doesn't have permission to create a new room.

getChatRoom

public MUCRoom getChatRoom(String roomName)
Description copied from interface: MultiUserChatServer
Obtains a chatroom by name. If the chatroom does not exists then null will be returned.

Specified by:
getChatRoom in interface MultiUserChatServer
Parameters:
roomName - Name of the room to get.
Returns:
The chatroom for the given name or null if the room does not exists.

getChatRooms

public List<MUCRoom> getChatRooms()
Description copied from interface: MultiUserChatServer
Retuns a list with a snapshot of all the rooms in the server (i.e. persistent or not, in memory or not).

Specified by:
getChatRooms in interface MultiUserChatServer
Returns:
a list with a snapshot of all the rooms.

hasChatRoom

public boolean hasChatRoom(String roomName)
Description copied from interface: MultiUserChatServer
Returns true if the server includes a chatroom with the requested name.

Specified by:
hasChatRoom in interface MultiUserChatServer
Parameters:
roomName - the name of the chatroom to check.
Returns:
true if the server includes a chatroom with the requested name.

removeChatRoom

public void removeChatRoom(String roomName)
Description copied from interface: MultiUserChatServer
Removes the room associated with the given name.

Specified by:
removeChatRoom in interface MultiUserChatServer
Parameters:
roomName - The room to remove.

getServiceName

public String getServiceName()
Description copied from interface: MultiUserChatServer
Returns the subdomain of the chat service.

Specified by:
getServiceName in interface MultiUserChatServer
Returns:
the subdomain of the chat service.

getHistoryStrategy

public HistoryStrategy getHistoryStrategy()
Description copied from interface: MultiUserChatServer
Obtain the server-wide default message history settings.

Specified by:
getHistoryStrategy in interface MultiUserChatServer
Returns:
The message history strategy defaults for the server.

removeUser

public void removeUser(JID jabberID)
Description copied from interface: MultiUserChatServer
Removes a user from all chat rooms.

Specified by:
removeUser in interface MultiUserChatServer
Parameters:
jabberID - The user's normal jid, not the chat nickname jid.

getChatUser

public MUCUser getChatUser(JID userjid)
                    throws UserNotFoundException
Description copied from interface: MultiUserChatServer
Obtain a chat user by XMPPAddress.

Specified by:
getChatUser in interface MultiUserChatServer
Parameters:
userjid - The XMPPAddress of the user.
Returns:
The chatuser corresponding to that XMPPAddress.
Throws:
UserNotFoundException - If the user is not found and can't be auto-created.

serverBroadcast

public void serverBroadcast(String msg)
                     throws UnauthorizedException
Description copied from interface: MultiUserChatServer
Broadcast a given message to all members of this chat room. The sender is always set to be the chatroom.

Specified by:
serverBroadcast in interface MultiUserChatServer
Parameters:
msg - The message to broadcast.
Throws:
UnauthorizedException

setServiceName

public void setServiceName(String name)
Description copied from interface: MultiUserChatServer
Set the name of this chat service. The new name won't go into effect until the server is restarted.

Specified by:
setServiceName in interface MultiUserChatServer
Parameters:
name - The chat service name (host name).

setKickIdleUsersTimeout

public void setKickIdleUsersTimeout(int timeout)
Description copied from interface: MultiUserChatServer
Sets the time to elapse between clearing of idle chat users. A TimerTask will be added to a Timer scheduled for repeated fixed-delay execution whose main responsibility is to kick users that have been idle for a certain time. A user is considered idle if he/she didn't send any message to any group chat room for a certain amount of time. See MultiUserChatServer.setUserIdleTime(int).

Specified by:
setKickIdleUsersTimeout in interface MultiUserChatServer
Parameters:
timeout - the time to elapse between clearing of idle chat users.

getKickIdleUsersTimeout

public int getKickIdleUsersTimeout()
Description copied from interface: MultiUserChatServer
Returns the time to elapse between clearing of idle chat users. A user is considered idle if he/she didn't send any message to any group chat room for a certain amount of time. See MultiUserChatServer.getUserIdleTime().

Specified by:
getKickIdleUsersTimeout in interface MultiUserChatServer
Returns:
the time to elapse between clearing of idle chat users.

setUserIdleTime

public void setUserIdleTime(int idleTime)
Description copied from interface: MultiUserChatServer
Sets the number of milliseconds a user must be idle before he/she gets kicked from all the rooms. By idle we mean that the user didn't send any message to any group chat room.

Specified by:
setUserIdleTime in interface MultiUserChatServer
Parameters:
idleTime - the amount of time to wait before considering a user idle.

getUserIdleTime

public int getUserIdleTime()
Description copied from interface: MultiUserChatServer
Returns the number of milliseconds a user must be idle before he/she gets kicked from all the rooms. By idle we mean that the user didn't send any message to any group chat room.

Specified by:
getUserIdleTime in interface MultiUserChatServer
Returns:
the amount of time to wait before considering a user idle.

setLogConversationsTimeout

public void setLogConversationsTimeout(int timeout)
Description copied from interface: MultiUserChatServer
Sets the time to elapse between logging the room conversations. A TimerTask will be added to a Timer scheduled for repeated fixed-delay execution whose main responsibility is to log queued rooms conversations. The number of queued conversations to save on each run can be configured. See MultiUserChatServer.setLogConversationBatchSize(int).

Specified by:
setLogConversationsTimeout in interface MultiUserChatServer
Parameters:
timeout - the time to elapse between logging the room conversations.

getLogConversationsTimeout

public int getLogConversationsTimeout()
Description copied from interface: MultiUserChatServer
Returns the time to elapse between logging the room conversations. A TimerTask will be added to a Timer scheduled for repeated fixed-delay execution whose main responsibility is to log queued rooms conversations. The number of queued conversations to save on each run can be configured. See MultiUserChatServer.getLogConversationBatchSize().

Specified by:
getLogConversationsTimeout in interface MultiUserChatServer
Returns:
the time to elapse between logging the room conversations.

setLogConversationBatchSize

public void setLogConversationBatchSize(int size)
Description copied from interface: MultiUserChatServer
Sets the number of messages to save to the database on each run of the logging process. Even though the saving of queued conversations takes place in another thread it is not recommended specifying a big number.

Specified by:
setLogConversationBatchSize in interface MultiUserChatServer
Parameters:
size - the number of messages to save to the database on each run of the logging process.

getLogConversationBatchSize

public int getLogConversationBatchSize()
Description copied from interface: MultiUserChatServer
Returns the number of messages to save to the database on each run of the logging process.

Specified by:
getLogConversationBatchSize in interface MultiUserChatServer
Returns:
the number of messages to save to the database on each run of the logging process.

getUsersAllowedToCreate

public Collection<String> getUsersAllowedToCreate()
Description copied from interface: MultiUserChatServer
Returns the collection of JIDs that are allowed to create MUC rooms. An empty list means that anyone can create a room.

Specified by:
getUsersAllowedToCreate in interface MultiUserChatServer
Returns:
a list of bare JIDs.

getSysadmins

public Collection<String> getSysadmins()
Description copied from interface: MultiUserChatServer
Returns the collection of JIDs that are system administrators of the MUC service. A sysadmin has the same permissions as a room owner.

Specified by:
getSysadmins in interface MultiUserChatServer
Returns:
a list of bare JIDs.

addSysadmin

public void addSysadmin(String userJID)
Description copied from interface: MultiUserChatServer
Adds a new system administrator of the MUC service. A sysadmin has the same permissions as a room owner.

Specified by:
addSysadmin in interface MultiUserChatServer
Parameters:
userJID - the bare JID of the new user to add as a system administrator.

removeSysadmin

public void removeSysadmin(String userJID)
Description copied from interface: MultiUserChatServer
Removes a system administrator of the MUC service.

Specified by:
removeSysadmin in interface MultiUserChatServer
Parameters:
userJID - the bare JID of the user to remove from the list.

isAllowToDiscoverLockedRooms

public boolean isAllowToDiscoverLockedRooms()
Returns the flag that indicates if the service should provide information about locked rooms when handling service discovery requests.

Returns:
true if the service should provide information about locked rooms.

setAllowToDiscoverLockedRooms

public void setAllowToDiscoverLockedRooms(boolean allowToDiscoverLockedRooms)
Sets the flag that indicates if the service should provide information about locked rooms when handling service discovery requests. Note: Setting this flag in false is not compliant with the spec. A user may try to join a locked room thinking that the room doesn't exist because the user didn't discover it before.

Parameters:
allowToDiscoverLockedRooms - if the service should provide information about locked rooms.

isRoomCreationRestricted

public boolean isRoomCreationRestricted()
Description copied from interface: MultiUserChatServer
Returns false if anyone can create rooms or true if only the returned JIDs in getUsersAllowedToCreate are allowed to create rooms.

Specified by:
isRoomCreationRestricted in interface MultiUserChatServer
Returns:
true if only some JIDs are allowed to create rooms.

setRoomCreationRestricted

public void setRoomCreationRestricted(boolean roomCreationRestricted)
Description copied from interface: MultiUserChatServer
Sets if anyone can create rooms or if only the returned JIDs in getUsersAllowedToCreate are allowed to create rooms.

Specified by:
setRoomCreationRestricted in interface MultiUserChatServer
Parameters:
roomCreationRestricted - whether anyone can create rooms or not.

addUserAllowedToCreate

public void addUserAllowedToCreate(String userJID)
Description copied from interface: MultiUserChatServer
Adds a new user to the list of JIDs that are allowed to create MUC rooms.

Specified by:
addUserAllowedToCreate in interface MultiUserChatServer
Parameters:
userJID - the bare JID of the new user to add to list.

removeUserAllowedToCreate

public void removeUserAllowedToCreate(String userJID)
Description copied from interface: MultiUserChatServer
Removes a user from list of JIDs that are allowed to create MUC rooms.

Specified by:
removeUserAllowedToCreate in interface MultiUserChatServer
Parameters:
userJID - the bare JID of the user to remove from the list.

initialize

public void initialize(XMPPServer server)
Description copied from class: BasicModule

Initializes the basic module.

Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

Specified by:
initialize in interface Module
Overrides:
initialize in class BasicModule
Parameters:
server - the server hosting this module.

start

public void start()
Description copied from class: BasicModule

Starts the basic module.

Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

Specified by:
start in interface Module
Specified by:
start in interface Component
Overrides:
start in class BasicModule

stop

public void stop()
Description copied from class: BasicModule

Stops the basic module.

Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

Specified by:
stop in interface Module
Overrides:
stop in class BasicModule

enableService

public void enableService(boolean enabled)
Description copied from interface: MultiUserChatServer
Enables or disables the MUC service. When disabled the MUC service will disappear from the disco#items list. Moreover, service discovery features will be disabled.

Specified by:
enableService in interface MultiUserChatServer
Parameters:
enabled - true if the service is enabled.

isServiceEnabled

public boolean isServiceEnabled()
Description copied from interface: MultiUserChatServer
Returns true if the MUC service is available. Use MultiUserChatServer.enableService(boolean) to enable or disable the service.

Specified by:
isServiceEnabled in interface MultiUserChatServer
Returns:
true if the MUC service is available.

getTotalChatTime

public long getTotalChatTime()
Description copied from interface: MultiUserChatServer
Returns the total chat time of all rooms combined.

Specified by:
getTotalChatTime in interface MultiUserChatServer
Returns:
total chat time in milliseconds.

getNumberChatRooms

public int getNumberChatRooms()
Retuns the number of existing rooms in the server (i.e. persistent or not, in memory or not).

Returns:
the number of existing rooms in the server.

getNumberConnectedUsers

public int getNumberConnectedUsers()
Retuns the total number of occupants in all rooms in the server.

Returns:
the number of existing rooms in the server.

getNumberRoomOccupants

public int getNumberRoomOccupants()
Retuns the total number of users that have joined in all rooms in the server.

Returns:
the number of existing rooms in the server.

logConversation

public void logConversation(MUCRoom room,
                            Message message,
                            JID sender)
Description copied from interface: MultiUserChatServer
Logs that a given message was sent to a room as part of a conversation. Every message sent to the room that is allowed to be broadcasted and that was sent either from the room itself or from an occupant will be logged.

Note: For performane reasons, the logged message won't be immediately saved. Instead we keep the logged messages in memory until the logging process saves them to the database. It's possible to configure the logging process to run every X milliseconds and also the number of messages to log on each execution.

Specified by:
logConversation in interface MultiUserChatServer
Parameters:
room - the room that received the message.
message - the message to log as part of the conversation in the room.
sender - the real XMPPAddress of the sender (e.g. john@example.org).
See Also:
initialize(org.jivesoftware.wildfire.XMPPServer)

messageBroadcastedTo

public void messageBroadcastedTo(int numOccupants)
Description copied from interface: MultiUserChatServer
Notification message indicating the server that an incoming message was broadcasted to a given number of occupants.

Specified by:
messageBroadcastedTo in interface MultiUserChatServer
Parameters:
numOccupants - number of occupants that received the message.

getItems

public Iterator<DiscoServerItem> getItems()
Description copied from interface: ServerItemsProvider
Returns an Iterator (of DiscoServerItem) with the items associated with the server or null if none.

Specified by:
getItems in interface ServerItemsProvider
Returns:
an Iterator (of DiscoServerItem) with the items associated with the server or null if none.

getIdentities

public Iterator<org.dom4j.Element> getIdentities(String name,
                                                 String node,
                                                 JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns an Iterator (of Element) with the target entity's identities. Each Element must include the categoty, type and name attributes of the entity.

Specified by:
getIdentities in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
an Iterator (of Element) with the target entity's identities.

getFeatures

public Iterator<String> getFeatures(String name,
                                    String node,
                                    JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns an Iterator (of String) with the supported features. The features to include are the features offered and supported protocols by the target entity identified by the requested name and node.

Specified by:
getFeatures in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
an Iterator (of String) with the supported features.

getExtendedInfo

public XDataFormImpl getExtendedInfo(String name,
                                     String node,
                                     JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns an XDataForm with the extended information about the entity or null if none. Each bit of information about the entity must be included as a value of a field of the form.

Specified by:
getExtendedInfo in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
an XDataForm with the extended information about the entity or null if none.

hasInfo

public boolean hasInfo(String name,
                       String node,
                       JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns true if we can provide information related to the requested name and node. For example, if the requested name refers to a non-existant MUC room then the answer will be false. In case that the sender of the disco request is not authorized to discover this information an UnauthorizedException will be thrown.

Specified by:
hasInfo in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
true if we can provide information related to the requested name and node.

getItems

public Iterator<org.dom4j.Element> getItems(String name,
                                            String node,
                                            JID senderJID)
Description copied from interface: DiscoItemsProvider
Returns an Iterator (of Element) with the target entity's items or null if none. Each Element must include a JID attribute and may include the name and node attributes of the entity. In case that the sender of the disco request is not authorized to discover items an UnauthorizedException will be thrown.

Specified by:
getItems in interface DiscoItemsProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco items request.
Returns:
an Iterator (of Element) with the target entity's items or null if none.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.