public interface MultiUserChatService
extends org.xmpp.component.Component
Modifier and Type | Method and Description |
---|---|
void |
addExtraFeature(String feature)
Adds an extra Disco feature to the list of features returned for the conference service.
|
void |
addExtraIdentity(String category,
String name,
String type)
Adds an extra Disco identity to the list of identities returned for the conference service.
|
void |
addIQHandler(IQHandler handler)
Add a IQHandler to MUC rooms and services.
|
void |
addSysadmin(org.xmpp.packet.JID userJID)
Adds a new system administrator of the MUC service.
|
void |
addSysadmins(Collection<org.xmpp.packet.JID> userJIDs)
Adds multiple system administrators for the MUC service.
|
void |
addUserAllowedToCreate(org.xmpp.packet.JID userJID)
Adds a new user/group to the list of JIDs that are allowed to create MUC rooms.
|
void |
addUsersAllowedToCreate(Collection<org.xmpp.packet.JID> userJIDs)
Adds new users/groups 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(LocalMUCRoom room)
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.
|
Archiver<?> |
getArchiver() |
MUCRoom |
getChatRoom(String roomName)
Obtains a chatroom by name.
|
MUCRoom |
getChatRoom(String roomName,
org.xmpp.packet.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.
|
HistoryStrategy |
getHistoryStrategy()
Obtain the server-wide default message history settings.
|
long |
getIncomingMessageCount(boolean resetAfter)
Returns the total number of incoming messages since last reset.
|
int |
getKickIdleUsersTimeout()
Returns the time to elapse between clearing of idle chat users.
|
default int |
getLogConversationBatchSize()
Deprecated.
No longer used in Openfire 4.4.0 and later (replaced with continuous writes to database: see
ArchiveManager ). |
default int |
getLogConversationsTimeout()
Deprecated.
No longer used in Openfire 4.4.0 and later (replaced with continuous writes to database: see
ArchiveManager ). |
Collection<MUCRole> |
getMUCRoles(org.xmpp.packet.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.
|
long |
getOutgoingMessageCount(boolean resetAfter)
Returns the total number of outgoing messages since last reset.
|
String |
getServiceDomain()
Returns the fully-qualifed domain name of this chat service.
|
String |
getServiceName()
Returns the subdomain of the chat service.
|
Collection<org.xmpp.packet.JID> |
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<org.xmpp.packet.JID> |
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 |
isAllRegisteredUsersAllowedToCreate()
Sets if all registered users of Openfire are allowed to create rooms.
|
boolean |
isHidden()
Returns true if the MUC service is a hidden, externally managed, service.
|
default boolean |
isPasswordRequiredForSysadminsToJoinRoom()
Returns true when a system administrator of the MUC service can join a
password-protected room, without supplying the password.
|
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.
|
boolean |
isSysadmin(org.xmpp.packet.JID bareJID)
Validates the given JID as a MUC service administrator.
|
void |
logConversation(MUCRoom room,
org.xmpp.packet.Message message,
org.xmpp.packet.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 |
refreshChatRoom(String roomName)
Forces a re-read of the room.
|
void |
removeChatRoom(String roomName)
Removes the room associated with the given name.
|
void |
removeExtraFeature(String feature)
Removes an extra Disco feature from the list of features returned for the conference service.
|
void |
removeExtraIdentity(String name)
Removes an extra Disco identity from the list of identities returned for the conference service.
|
void |
removeIQHandler(IQHandler handler) |
void |
removeSysadmin(org.xmpp.packet.JID userJID)
Removes a system administrator of the MUC service.
|
void |
removeUserAllowedToCreate(org.xmpp.packet.JID userJID)
Removes a user/group from list of JIDs that are allowed to create MUC rooms.
|
void |
removeUsersAllowedToCreate(Collection<org.xmpp.packet.JID> userJIDs)
Removes users/groups from list of JIDs that are allowed to create MUC rooms.
|
void |
setAllRegisteredUsersAllowedToCreate(boolean allow)
Sets if all registered users of Openfire are allowed to create rooms.
|
void |
setKickIdleUsersTimeout(int timeout)
Sets the time to elapse between clearing of idle chat users.
|
default void |
setLogConversationBatchSize(int size)
Deprecated.
No longer used in Openfire 4.4.0 and later (replaced with continuous writes to database: see
ArchiveManager ). |
default void |
setLogConversationsTimeout(int timeout)
Deprecated.
No longer used in Openfire 4.4.0 and later (replaced with continuous writes to database: see
ArchiveManager ). |
default void |
setPasswordRequiredForSysadminsToJoinRoom(boolean isRequired)
Sets if a system administrator of the MUC service can join a
password-protected room, without supplying the password.
|
void |
setRoomCreationRestricted(boolean roomCreationRestricted)
Sets if anyone can create rooms.
|
void |
setUserIdleTime(int idle)
Sets the number of milliseconds a user must be idle before he/she gets kicked from all
the rooms.
|
String getServiceDomain()
String getServiceName()
Collection<org.xmpp.packet.JID> getSysadmins()
boolean isSysadmin(org.xmpp.packet.JID bareJID)
bareJID
- the bare JID of the uservoid addSysadmin(org.xmpp.packet.JID userJID)
userJID
- the bare JID of the new user/group to add as a system administrator.void addSysadmins(Collection<org.xmpp.packet.JID> userJIDs)
userJIDs
- the JIDs of the new users/groups to add as a system administrator.void removeSysadmin(org.xmpp.packet.JID userJID)
userJID
- the bare JID of the user/group to remove from the list.default boolean isPasswordRequiredForSysadminsToJoinRoom()
default void setPasswordRequiredForSysadminsToJoinRoom(boolean isRequired)
isRequired
- false if a sysadmin is allowed to join a password-protected room without a password, otherwise true.boolean isRoomCreationRestricted()
getUsersAllowedToCreate
are allowed to create rooms.void setRoomCreationRestricted(boolean roomCreationRestricted)
isAllRegisteredUsersAllowedToCreate
or getUsersAllowedToCreate
(or both) allow them to.roomCreationRestricted
- whether anyone can create rooms or not.boolean isAllRegisteredUsersAllowedToCreate()
addUserAllowedToCreate
.void setAllRegisteredUsersAllowedToCreate(boolean allow)
allow
- whether all registered users can create rooms.Collection<org.xmpp.packet.JID> getUsersAllowedToCreate()
isAllRegisteredUsersAllowedToCreate
, this method will
not return a JID of every user in the system.void addUserAllowedToCreate(org.xmpp.packet.JID userJID)
userJID
- the JID of the new user/group to add to list.void addUsersAllowedToCreate(Collection<org.xmpp.packet.JID> userJIDs)
userJIDs
- collection of JIDs for users/groups to add to list.void removeUserAllowedToCreate(org.xmpp.packet.JID userJID)
userJID
- the JID of the user/group to remove from the list.void removeUsersAllowedToCreate(Collection<org.xmpp.packet.JID> userJIDs)
userJIDs
- collection of JIDs of users/groups 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()
@Deprecated default void setLogConversationsTimeout(int timeout)
ArchiveManager
).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.default int getLogConversationsTimeout()
ArchiveManager
).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()
.@Deprecated default void setLogConversationBatchSize(int size)
ArchiveManager
).size
- the number of messages to save to the database on each run of the logging process.@Deprecated default int getLogConversationBatchSize()
ArchiveManager
).Archiver<?> getArchiver()
HistoryStrategy getHistoryStrategy()
MUCRoom getChatRoom(String roomName, org.xmpp.packet.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.void refreshChatRoom(String roomName)
roomName
- Name of the room to refresh.List<MUCRoom> getChatRooms()
boolean hasChatRoom(String roomName)
roomName
- the name of the chatroom to check.void chatRoomRemoved(LocalMUCRoom room)
room
- the removed room in another cluster node.void chatRoomAdded(LocalMUCRoom room)
room
- the created room in another cluster node.void removeChatRoom(String roomName)
roomName
- The room to remove.Collection<MUCRole> getMUCRoles(org.xmpp.packet.JID user)
MUCRole
in all rooms for the specified
user's session. When running in a cluster the list will include
LocalMUCRole
and RemoteMUCRole
.user
- the full JID that identifies the session of the user.long getTotalChatTime()
int getNumberChatRooms()
int getNumberConnectedUsers(boolean onlyLocal)
onlyLocal
- true if only users connected to this JVM will be considered. Otherwise count cluster wise.int getNumberRoomOccupants()
long getIncomingMessageCount(boolean resetAfter)
resetAfter
- True if you want the counter to be reset after results returned.long getOutgoingMessageCount(boolean resetAfter)
resetAfter
- True if you want the counter to be reset after results returned.void logConversation(MUCRoom room, org.xmpp.packet.Message message, org.xmpp.packet.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).MultiUserChatServiceImpl.initialize(org.jivesoftware.openfire.XMPPServer)
void messageBroadcastedTo(int numOccupants)
numOccupants
- number of occupants that received the message.void enableService(boolean enabled, boolean persistent)
enabled
- true if the service is enabled.persistent
- true if the new setting will persist across restarts.boolean isServiceEnabled()
enableService(boolean, boolean)
to
enable or disable the service.boolean isHidden()
void addIQHandler(IQHandler handler)
handler
- the IQ handler to addvoid removeIQHandler(IQHandler handler)
void addExtraFeature(String feature)
feature
- Feature to add.void removeExtraFeature(String feature)
feature
- Feature to remove.void addExtraIdentity(String category, String name, String type)
category
- Category for identity. e.g. conferencename
- Descriptive name for identity. e.g. Public Chatroomstype
- Type for identity. e.g. textvoid removeExtraIdentity(String name)
name
- Name of identity to remove.Copyright © 2003–2020 Ignite Realtime. All rights reserved.