|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultiUserChatServer
Manages groupchat conversations, chatrooms, and users. This class is designed to operate independently from the rest of the Jive server infrastruture. This theoretically allows deployment of the groupchat on a separate server from the main IM 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. |
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. |
HistoryStrategy |
getHistoryStrategy()
Obtain the server-wide default message history settings. |
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. |
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 |
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 |
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 |
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 idle)
Sets the number of milliseconds a user must be idle before he/she gets kicked from all the rooms. |
Methods inherited from interface org.xmpp.component.Component |
---|
getDescription, getName, initialize, processPacket, shutdown, start |
Method Detail |
---|
String getServiceDomain()
String getServiceName()
void setServiceName(String name)
name
- The chat service name (host name).Collection<String> getSysadmins()
void addSysadmin(String userJID)
userJID
- the bare JID of the new user to add as a system administrator.void removeSysadmin(String userJID)
userJID
- the bare JID of the user to remove from the list.boolean isRoomCreationRestricted()
getUsersAllowedToCreate
are allowed to create rooms.
void setRoomCreationRestricted(boolean roomCreationRestricted)
getUsersAllowedToCreate
are allowed to create rooms.
roomCreationRestricted
- whether anyone can create rooms or not.Collection<String> getUsersAllowedToCreate()
void addUserAllowedToCreate(String userJID)
userJID
- the bare JID of the new user to add to list.void removeUserAllowedToCreate(String userJID)
userJID
- the bare JID of the user to remove from the list.void setKickIdleUsersTimeout(int timeout)
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 setUserIdleTime(int)
.
timeout
- the time to elapse between clearing of idle chat users.int getKickIdleUsersTimeout()
getUserIdleTime()
.
void setUserIdleTime(int idle)
idle
- the amount of time to wait before considering a user idle.int getUserIdleTime()
void setLogConversationsTimeout(int timeout)
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 setLogConversationBatchSize(int)
.
timeout
- the time to elapse between logging the room conversations.int getLogConversationsTimeout()
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 getLogConversationBatchSize()
.
void setLogConversationBatchSize(int size)
size
- the number of messages to save to the database on each run of the logging process.int getLogConversationBatchSize()
HistoryStrategy getHistoryStrategy()
MUCRoom getChatRoom(String roomName, JID userjid) throws NotAllowedException
roomName
- Name of the room to get.userjid
- The user's normal jid, not the chat nickname jid.
NotAllowedException
- If the caller doesn't have permission to create a new room.MUCRoom getChatRoom(String roomName)
roomName
- Name of the room to get.
List<MUCRoom> getChatRooms()
boolean hasChatRoom(String roomName)
roomName
- the name of the chatroom to check.
void removeChatRoom(String roomName)
roomName
- The room to remove.void removeUser(JID jabberID)
jabberID
- The user's normal jid, not the chat nickname jid.MUCUser getChatUser(JID userjid) throws UserNotFoundException
userjid
- The XMPPAddress of the user.
UserNotFoundException
- If the user is not found and can't be auto-created.void serverBroadcast(String msg) throws UnauthorizedException
msg
- The message to broadcast.
UnauthorizedException
long getTotalChatTime()
void logConversation(MUCRoom room, Message message, JID sender)
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.
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).MultiUserChatServerImpl.initialize(org.jivesoftware.wildfire.XMPPServer)
void messageBroadcastedTo(int numOccupants)
numOccupants
- number of occupants that received the message.void enableService(boolean enabled)
enabled
- true if the service is enabled.boolean isServiceEnabled()
enableService(boolean)
to
enable or disable the service.
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |