Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.4 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.muc.spi
Class MultiUserChatServerImpl

    java.lang.Object
      org.jivesoftware.openfire.container.BasicModule
          org.jivesoftware.openfire.muc.spi.MultiUserChatServerImpl

All Implemented Interfaces:
  ChannelHandler, ClusterEventListener, Module, DiscoInfoProvider, DiscoItemsProvider, ServerItemsProvider, MultiUserChatServer, RoutableChannelHandler, Component

    public class MultiUserChatServerImpl

extends BasicModule
implements MultiUserChatServer, ServerItemsProvider, DiscoInfoProvider, DiscoItemsProvider, RoutableChannelHandler, ClusterEventListener

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 persistent rooms that have been forgotten or abandoned 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` | `addListener(MUCEventListener listener)` Registers a listener to receive events.
`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` | `chatRoomAdded(LocalMUCRoom room)` Notification message indicating that a chat room has been created in another cluster member.
`void` | `chatRoomRemoved(String roomName)` Notification message indicating that the specified chat room was removed from some other cluster member.
`void` | `enableService(boolean enabled, boolean persistent)` 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.
`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<DiscoItem>` | `getItems(String name, String node, JID senderJID)` Returns an Iterator (of DiscoItem) 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.
`Collection<MUCRole>` | `getMUCRoles(JID user)` Returns the list of `MUCRole` in all rooms for the specified user's session.
`int` | `getNumberChatRooms()` Retuns the number of existing rooms in the server (i.e.
`int` | `getNumberConnectedUsers(boolean onlyLocal)` 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` | `joinedCluster()` Notification event indicating that this JVM is now part of a cluster.
`void` | `joinedCluster(byte[] nodeID)` Notification event indicating that another JVM is now part of a cluster.
`void` | `leftCluster()` Notification event indicating that this JVM is no longer part of the cluster.
`void` | `leftCluster(byte[] nodeID)` Notification event indicating that another JVM is no longer part of the cluster.
`void` | `logConversation(MUCRoom room, Message message, JID sender)` Logs that a given message was sent to a room as part of a conversation.
`void` | `markedAsSeniorClusterMember()` Notification event indicating that this JVM is now the senior cluster member.
`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` | `removeListener(MUCEventListener listener)` Unregisters a listener to receive events.
`void` | `removeSysadmin(String userJID)` Removes a system administrator of the MUC service.
`void` | `removeUserAllowedToCreate(String userJID)` Removes a user from list of JIDs that are allowed to create MUC rooms.
`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.openfire.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.

### chatRoomRemoved

    public void chatRoomRemoved(String roomName)

  Notification message indicating that the specified chat room was removed from some other cluster member.

  Parameters:
    `roomName` - the name of the room removed from the cluster.

### chatRoomAdded

    public void chatRoomAdded(LocalMUCRoom room)

  Notification message indicating that a chat room has been created in another cluster member.

  Parameters:
    `room` - the created room in another cluster node.

### 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.

### getMUCRoles

    public Collection<MUCRole> getMUCRoles(JID user)

  Description copied from interface: `MultiUserChatServer`
  Returns the list of `MUCRole` in all rooms for the specified user's session. When running in a cluster the list will include `LocalMUCRole` and `RemoteMUCRole`.

  Specified by:
    `getMUCRoles` in interface `MultiUserChatServer`
  Parameters:
    `user` - the full JID that identifies the session of the user.
  Returns:
    the list of MUCRoles in all rooms for the specified user's session.

### 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,
                              boolean persistent)

  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.
    `persistent` - true if the new setting will persist accorss restarts.

### isServiceEnabled

    public boolean isServiceEnabled()

  Description copied from interface: `MultiUserChatServer`
  Returns true if the MUC service is available. Use `MultiUserChatServer.enableService(boolean, 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(boolean onlyLocal)

  Retuns the total number of occupants in all rooms in the server.

  Parameters:
    `onlyLocal` - true if only users connected to this JVM will be considered. Otherwise count cluster wise.
  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.openfire.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.

### joinedCluster

    public void joinedCluster()

  Description copied from interface: `ClusterEventListener`
  Notification event indicating that this JVM is now part of a cluster. At this point the `XMPPServer.getNodeID()` holds the new nodeID value.

  When joining the cluster as the senior cluster member the `ClusterEventListener.markedAsSeniorClusterMember()` event will be sent right after this event.

  At this point the CacheFactory holds clustered caches. That means that modifications to the caches will be reflected in the cluster. The clustered caches were just obtained from the cluster and no local cached data was automatically moved.

  Specified by:
    `joinedCluster` in interface `ClusterEventListener`

### joinedCluster

    public void joinedCluster(byte[] nodeID)

  Description copied from interface: `ClusterEventListener`
  Notification event indicating that another JVM is now part of a cluster.

  At this point the CacheFactory of the new node holds clustered caches. That means that modifications to the caches of this JVM will be reflected in the cluster and in particular in the new node.

  Specified by:
    `joinedCluster` in interface `ClusterEventListener`
  Parameters:
    `nodeID` - ID of the node that joined the cluster.

### leftCluster

    public void leftCluster()

  Description copied from interface: `ClusterEventListener`
  Notification event indicating that this JVM is no longer part of the cluster. This could happen when disabling clustering support, removing the enterprise plugin that provides clustering support or connection to cluster got lost.

  Moreover, if we were in a "split brain" scenario (ie. separated cluster islands) and the island were this JVM belonged was marked as "old" then all nodes of that island will get the `left cluster event` and `joined cluster events`. That means that caches will be reset and thus will need to be repopulated again with fresh data from this JVM. This also includes the case where this JVM was the senior cluster member and when the islands met again then this JVM stopped being the senior member.

  At this point the CacheFactory holds local caches. That means that modifications to the caches will only affect this JVM.

  Specified by:
    `leftCluster` in interface `ClusterEventListener`

### leftCluster

    public void leftCluster(byte[] nodeID)

  Description copied from interface: `ClusterEventListener`
  Notification event indicating that another JVM is no longer part of the cluster. This could happen when disabling clustering support, removing the enterprise plugin that provides clustering support or connection to cluster got lost.

  Moreover, if we were in a "split brain" scenario (ie. separated cluster islands) and the island were the other JVM belonged was marked as "old" then all nodes of that island will get the `left cluster event` and `joined cluster events`. That means that caches will be reset and thus will need to be repopulated again with fresh data from this JVM. This also includes the case where the other JVM was the senior cluster member and when the islands met again then the other JVM stopped being the senior member.

  At this point the CacheFactory of the leaving node holds local caches. That means that modifications to the caches of this JVM will not affect the leaving node but other cluster members.

  Specified by:
    `leftCluster` in interface `ClusterEventListener`
  Parameters:
    `nodeID` - ID of the node that is left the cluster.

### markedAsSeniorClusterMember

    public void markedAsSeniorClusterMember()

  Description copied from interface: `ClusterEventListener`
  Notification event indicating that this JVM is now the senior cluster member. This could either happen when initially joining the cluster or when the senior cluster member node left the cluster and this JVM was marked as the new senior cluster member.

  Moreover, in the case of a "split brain" scenario (ie. separated cluster islands) each island will have its own senior cluster member. However, when the islands meet again there could only be one senior cluster member so one of the senior cluster members will stop playing that role. When that happens the JVM no longer playing that role will receive the `ClusterEventListener.leftCluster()` and `ClusterEventListener.joinedCluster()` events.

  Specified by:
    `markedAsSeniorClusterMember` in interface `ClusterEventListener`

### 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<DiscoItem> getItems(String name,
                                        String node,
                                        JID senderJID)

  Description copied from interface: `DiscoItemsProvider`
  Returns an Iterator (of DiscoItem) with the target entity's items or null if none. Each DiscoItem 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 DiscoItem) with the target entity's items or null if none.

### addListener

    public void addListener(MUCEventListener listener)

  Description copied from interface: `MultiUserChatServer`
  Registers a listener to receive events.

  Specified by:
    `addListener` in interface `MultiUserChatServer`
  Parameters:
    `listener` - the listener.

### removeListener

    public void removeListener(MUCEventListener listener)

  Description copied from interface: `MultiUserChatServer`
  Unregisters a listener to receive events.

  Specified by:
    `removeListener` in interface `MultiUserChatServer`
  Parameters:
    `listener` - the listener.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.4 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.