public class LocalMUCRoom extends Object implements MUCRoom, GroupEventListener
When running in a cluster each cluster node will have its own copy of local rooms. Persistent rooms will be loaded by each cluster node when starting up. Not persistent rooms will be copied from the senior cluster member. All room occupants will be copied from the senior cluster member too.
| Constructor and Description |
|---|
LocalMUCRoom()
Do not use this constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.xmpp.packet.Presence> |
addAdmin(org.xmpp.packet.JID jid,
MUCRole sendRole)
Adds a new user to the list of admins.
|
List<org.xmpp.packet.Presence> |
addAdmins(List<org.xmpp.packet.JID> newAdmins,
MUCRole senderRole)
Adds a list of users to the list of admins.
|
void |
addFirstOwner(org.xmpp.packet.JID bareJID)
Adds a new user to the list of owners.
|
List<org.xmpp.packet.Presence> |
addMember(org.xmpp.packet.JID jid,
String nickname,
MUCRole sendRole)
Adds a new user to the list of members.
|
org.xmpp.packet.Presence |
addModerator(org.xmpp.packet.JID jid,
MUCRole senderRole)
Changes the role of the user within the room to moderator.
|
List<org.xmpp.packet.Presence> |
addNone(org.xmpp.packet.JID jid,
MUCRole senderRole)
Removes the user from all the other affiliation list thus giving the user a NONE affiliation.
|
List<org.xmpp.packet.Presence> |
addOutcast(org.xmpp.packet.JID jid,
String reason,
MUCRole senderRole)
Adds a new user to the list of outcast users.
|
List<org.xmpp.packet.Presence> |
addOwner(org.xmpp.packet.JID jid,
MUCRole sendRole)
Adds a new user to the list of owners.
|
List<org.xmpp.packet.Presence> |
addOwners(List<org.xmpp.packet.JID> newOwners,
MUCRole senderRole)
Adds a list of users to the list of owners.
|
org.xmpp.packet.Presence |
addParticipant(org.xmpp.packet.JID jid,
String reason,
MUCRole senderRole)
Changes the role of the user within the room to participant.
|
org.xmpp.packet.Presence |
addVisitor(org.xmpp.packet.JID jid,
MUCRole senderRole)
Changes the role of the user within the room to visitor.
|
void |
adminAdded(Group group,
Map params)
An administrator was added to a group.
|
void |
adminRemoved(Group group,
Map params)
An administrator was removed from a group.
|
void |
affiliationAdded(AddAffiliation affiliation) |
void |
broadcast(BroadcastMessageRequest messageRequest) |
void |
broadcast(BroadcastPresenceRequest presenceRequest) |
boolean |
canAnyoneDiscoverJID()
Returns true if every presence packet will include the JID of every occupant.
|
boolean |
canBroadcastPresence(String roleToBroadcast)
Returns true if the presences of the requested role will be broadcasted.
|
boolean |
canChangeNickname()
Returns true if room occupants are allowed to change their nicknames in the room.
|
boolean |
canOccupantsChangeSubject()
Returns true if participants are allowed to change the room's subject.
|
boolean |
canOccupantsInvite()
Returns true if occupants can invite other users to the room.
|
String |
canSendPrivateMessage()
Returns the minimal role of persons that are allowed to send private messages in the room.
|
void |
changeSubject(org.xmpp.packet.Message packet,
MUCRole role)
Changes the room's subject if the occupant has enough permissions.
|
org.xmpp.packet.Presence |
createPresence(org.xmpp.packet.Presence.Type presenceType)
Create a new presence in this room for the given role.
|
void |
destroyRoom(DestroyRoomRequest destroyRequest) |
void |
destroyRoom(org.xmpp.packet.JID alternateJID,
String reason)
Destroys the room.
|
boolean |
equals(Object obj) |
Collection<org.xmpp.packet.JID> |
getAdmins()
Returns a collection with the current list of admins.
|
MUCRole.Affiliation |
getAffiliation(org.xmpp.packet.JID jid)
Returns the affiliation state of the user in the room.
|
long |
getChatLength()
Returns the total length of the chat session.
|
Date |
getCreationDate()
Returns the date when the room was created.
|
String |
getDescription()
Returns a description set by the room's owners about the room.
|
Date |
getEmptyDate()
Returns the date when the last occupant left the room.
|
long |
getID()
Obtain a unique numerical id for this room.
|
IQAdminHandler |
getIQAdminHandler() |
IQOwnerHandler |
getIQOwnerHandler() |
org.xmpp.packet.JID |
getJID()
Get the full JID of this room.
|
int |
getMaxUsers()
Returns the maximum number of occupants that can be simultaneously in the room.
|
Collection<org.xmpp.packet.JID> |
getMembers()
Returns a collection with the current list of room members.
|
Collection<MUCRole> |
getModerators()
Returns a collection with the current list of room moderators.
|
Date |
getModificationDate()
Returns the last date when the room's configuration was modified.
|
MultiUserChatService |
getMUCService()
Get the multi user chat service the room is attached to.
|
String |
getName()
Get the name of this room.
|
String |
getNaturalLanguageName()
Returns the natural language name of the room.
|
MUCRole |
getOccupant(String nickname)
Deprecated.
Prefer
getOccupantsByNickname(String) (user can be connected more than once) |
MUCRole |
getOccupantByFullJID(org.xmpp.packet.JID jid)
Returns the role of a given user in the room by his full JID or null
if no role was found for the specified user.
|
Collection<MUCRole> |
getOccupants()
Obtain the roles of all users in the chatroom.
|
List<MUCRole> |
getOccupantsByBareJID(org.xmpp.packet.JID jid)
Obtain the roles of a given user in the room by his bare JID.
|
List<MUCRole> |
getOccupantsByNickname(String nickname)
Obtain the roles of a given user by nickname.
|
int |
getOccupantsCount()
Returns the number of occupants in the chatroom at the moment.
|
Collection<org.xmpp.packet.JID> |
getOutcasts()
Returns a collection with the current list of outcast users.
|
Collection<org.xmpp.packet.JID> |
getOwners()
Returns a collection with the current list of owners.
|
Collection<MUCRole> |
getParticipants()
Returns a collection with the current list of room participants.
|
String |
getPassword()
Returns the password that the user must provide to enter the room.
|
String |
getReservedNickname(org.xmpp.packet.JID jid)
Returns the reserved room nickname for the bare JID or null if none.
|
MUCRole |
getRole()
Obtain the role of the chat server (mainly for addressing messages and presence).
|
List<String> |
getRolesToBroadcastPresence()
Returns the list of roles of which presence will be broadcasted to the rest of the occupants.
|
MUCRoomHistory |
getRoomHistory()
Returns the history of the room which includes chat transcripts.
|
String |
getSubject()
Returns the last subject that some occupant set to the room.
|
String |
getUID() |
void |
groupCreated(Group group,
Map params)
A group was created.
|
void |
groupDeleting(Group group,
Map params)
A group is being deleted.
|
void |
groupModified(Group group,
Map params)
A group's name, description, or an extended property was changed.
|
int |
hashCode() |
boolean |
hasOccupant(String nickname)
Determine if a given nickname is taken.
|
boolean |
isLocked()
Returns true if the room is locked.
|
boolean |
isLogEnabled()
Returns true if the room's conversation is being logged.
|
boolean |
isLoginRestrictedToNickname()
Returns true if registered users can only join the room using their registered nickname.
|
boolean |
isManuallyLocked()
Returns true if the room is locked and it was locked by a room owner after the room was
initially configured.
|
boolean |
isMembersOnly()
Returns true if the room requires an invitation to enter.
|
boolean |
isModerated()
Returns if the room in which only those with "voice" may send messages to all occupants.
|
boolean |
isPasswordProtected()
Returns true if a user cannot enter without first providing the correct password.
|
boolean |
isPersistent()
Returns true if the room is not destroyed if the last occupant exits.
|
boolean |
isPublicRoom()
Returns true if the room is searchable and visible through service discovery.
|
boolean |
isRegistrationEnabled()
Returns true if users are allowed to register with the room.
|
LocalMUCRole |
joinRoom(String nickname,
String password,
HistoryRequest historyRequest,
LocalMUCUser user,
org.xmpp.packet.Presence presence)
Joins the room using the given nickname.
|
org.xmpp.packet.Presence |
kickOccupant(org.xmpp.packet.JID jid,
org.xmpp.packet.JID actorJID,
String actorNickname,
String reason)
Kicks a user from the room.
|
void |
leaveRoom(MUCRole leaveRole)
Remove a member from the chat room.
|
void |
leaveRoom(OccupantLeftEvent event) |
void |
lock(MUCRole senderRole)
Locks the room so that users cannot join the room.
|
void |
memberAdded(AddMember addMember) |
void |
memberAdded(Group group,
Map params)
A member was added to a group.
|
void |
memberRemoved(Group group,
Map params)
A member was removed from a group.
|
void |
nicknameChanged(ChangeNickname changeNickname) |
void |
nicknameChanged(MUCRole occupantRole,
org.xmpp.packet.Presence newPresence,
String oldNick,
String newNick)
An event callback fired whenever an occupant changes his nickname within the chatroom.
|
void |
occupantAdded(OccupantAddedEvent event) |
void |
occupantUpdated(UpdateOccupant update) |
void |
presenceUpdated(MUCRole occupantRole,
org.xmpp.packet.Presence newPresence)
Handles occupants updating their presence in the chatroom.
|
void |
presenceUpdated(UpdatePresence updatePresence)
Updates the presence of an occupant with the new presence included in the request.
|
void |
readExternal(ObjectInput in) |
void |
saveToDB()
Saves the room configuration to the DB.
|
void |
send(org.xmpp.packet.Packet packet)
Sends a packet to the user.
|
void |
sendInvitation(org.xmpp.packet.JID to,
String reason,
MUCRole senderRole,
List<org.dom4j.Element> extensions)
Sends an invitation to a user.
|
void |
sendInvitationRejection(org.xmpp.packet.JID to,
String reason,
org.xmpp.packet.JID sender)
Sends the rejection to the inviter.
|
void |
sendPrivatePacket(org.xmpp.packet.Packet packet,
MUCRole senderRole)
Sends a private packet to a selected occupant.
|
void |
sendPublicMessage(org.xmpp.packet.Message message,
MUCRole senderRole)
Sends a message to the all the occupants.
|
void |
serverBroadcast(String msg)
Broadcast a given message to all members of this chat room.
|
void |
setCanAnyoneDiscoverJID(boolean canAnyoneDiscoverJID)
Sets if every presence packet will include the JID of every occupant.
|
void |
setCanOccupantsChangeSubject(boolean canOccupantsChangeSubject)
Sets if participants are allowed to change the room's subject.
|
void |
setCanOccupantsInvite(boolean canOccupantsInvite)
Sets if occupants can invite other users to the room.
|
void |
setCanSendPrivateMessage(String role)
Sets the minimal role of persons that are allowed to send private messages in the room.
|
void |
setChangeNickname(boolean canChange)
Sets if room occupants are allowed to change their nicknames in the room.
|
void |
setCreationDate(Date creationDate)
Sets the date when the room was created.
|
void |
setDescription(String description)
Sets a description set by the room's owners about the room.
|
void |
setEmptyDate(Date emptyDate)
Sets the date when the last occupant left the room.
|
void |
setID(long roomID)
Sets a new room ID if the room has just been saved to the database or sets the saved ID of
the room in the database while loading the room.
|
void |
setLogEnabled(boolean logEnabled)
Sets if the room's conversation is being logged.
|
void |
setLoginRestrictedToNickname(boolean restricted)
Sets if registered users can only join the room using their registered nickname.
|
void |
setMaxUsers(int maxUsers)
Sets the maximum number of occupants that can be simultaneously in the room.
|
List<org.xmpp.packet.Presence> |
setMembersOnly(boolean membersOnly)
Sets if the room requires an invitation to enter.
|
void |
setModerated(boolean moderated)
Sets if the room in which only those with "voice" may send messages to all occupants.
|
void |
setModificationDate(Date modificationDate)
Sets the last date when the room's configuration was modified.
|
void |
setMUCService(MultiUserChatService service)
Sets the multi user chat service the room is attached to.
|
void |
setNaturalLanguageName(String naturalLanguageName)
Sets the natural language name of the room.
|
void |
setPassword(String password)
Sets the password that the user must provide to enter the room.
|
void |
setPersistent(boolean persistent)
Sets if the room is not destroyed if the last occupant exits.
|
void |
setPublicRoom(boolean publicRoom)
Sets if the room is searchable and visible through service discovery.
|
void |
setRegistrationEnabled(boolean registrationEnabled)
Sets if users are allowed to register with the room.
|
void |
setRolesToBroadcastPresence(List<String> rolesToBroadcastPresence)
Sets the list of roles of which presence will be broadcasted to the rest of the occupants.
|
void |
setSavedToDB(boolean saved)
Sets if the room has already been made persistent.
|
void |
setSubject(String subject)
Sets the last subject that some occupant set to the room.
|
void |
unlock(MUCRole senderRole)
Unlocks the room so that users can join the room.
|
void |
updateConfiguration(LocalMUCRoom otherRoom) |
org.xmpp.packet.Presence |
updateOccupant(UpdateOccupantRequest updateRequest) |
boolean |
wasSavedToDB()
Returns true if the room has already been made persistent.
|
void |
writeExternal(ObjectOutput out) |
public LocalMUCRoom()
public String getName()
MUCRoompublic org.xmpp.packet.JID getJID()
MUCRoompublic MultiUserChatService getMUCService()
MUCRoomgetMUCService in interface MUCRoompublic void setMUCService(MultiUserChatService service)
MUCRoomsetMUCService in interface MUCRoomservice - The MultiUserChatService that the room is attached to (cannot be null).public long getID()
MUCRoompublic void setID(long roomID)
MUCRoompublic Date getCreationDate()
MUCRoomgetCreationDate in interface MUCRoompublic void setCreationDate(Date creationDate)
MUCRoomsetCreationDate in interface MUCRoomcreationDate - the date when the room was created (cannot be null).public Date getModificationDate()
MUCRoomgetModificationDate in interface MUCRoompublic void setModificationDate(Date modificationDate)
MUCRoomsetModificationDate in interface MUCRoommodificationDate - the last date when the room's configuration was modified (cannot be null).public void setEmptyDate(Date emptyDate)
MUCRoomsetEmptyDate in interface MUCRoomemptyDate - the date when the last occupant left the room or null if there are occupants in the room (can be null).public Date getEmptyDate()
MUCRoomgetEmptyDate in interface MUCRoompublic MUCRole getRole()
MUCRoompublic MUCRole getOccupant(String nickname) throws UserNotFoundException
getOccupantsByNickname(String) (user can be connected more than once)MUCRoomgetOccupant in interface MUCRoomnickname - The nickname of the user you'd like to obtain (cannot be null)UserNotFoundException - If there is no user with the given nicknamepublic List<MUCRole> getOccupantsByNickname(String nickname) throws UserNotFoundException
MUCRoomgetOccupantsByNickname in interface MUCRoomnickname - The nickname of the user you'd like to obtain (cannot be null)UserNotFoundException - If there is no user with the given nicknamepublic List<MUCRole> getOccupantsByBareJID(org.xmpp.packet.JID jid) throws UserNotFoundException
MUCRoomgetOccupantsByBareJID in interface MUCRoomjid - The bare jid of the user you'd like to obtain (cannot be null).UserNotFoundException - If there is no user with the given nicknamepublic MUCRole getOccupantByFullJID(org.xmpp.packet.JID jid)
MUCRoomgetOccupantByFullJID in interface MUCRoomjid - The full jid of the user you'd like to obtain (cannot be null).public Collection<MUCRole> getOccupants()
MUCRoomgetOccupants in interface MUCRoompublic int getOccupantsCount()
MUCRoomgetOccupantsCount in interface MUCRoompublic boolean hasOccupant(String nickname)
MUCRoomhasOccupant in interface MUCRoomnickname - The nickname of the user you'd like to obtain (cannot be null).public String getReservedNickname(org.xmpp.packet.JID jid)
MUCRoomgetReservedNickname in interface MUCRoomjid - The bare jid of the user of which you'd like to obtain his reserved nickname (cannot be null).public MUCRole.Affiliation getAffiliation(org.xmpp.packet.JID jid)
MUCRoomNote: Prerequisite - A lock must already be obtained before sending this message.
getAffiliation in interface MUCRoomjid - The bare jid of the user of which you'd like to obtain his affiliation (cannot be null).public LocalMUCRole joinRoom(String nickname, String password, HistoryRequest historyRequest, LocalMUCUser user, org.xmpp.packet.Presence presence) throws UnauthorizedException, UserAlreadyExistsException, RoomLockedException, ForbiddenException, RegistrationRequiredException, ConflictException, ServiceUnavailableException, NotAcceptableException
MUCRoomjoinRoom in interface MUCRoomnickname - The nickname the user wants to use in the chatroom (cannot be null).password - The password provided by the user to enter the chatroom or null if none.historyRequest - The amount of history that the user request or null meaning default.user - The user joining (cannot be null).presence - The presence sent by the user to join the room (cannot be null).UnauthorizedException - If the user doesn't have permission to join the room.UserAlreadyExistsException - If the nickname is already taken.RoomLockedException - If the user is trying to join a locked room.ForbiddenException - If the user is an outcast.RegistrationRequiredException - If the user is not a member of a members-only room.ConflictException - If another user attempts to join the room with a
nickname reserved by the first user.ServiceUnavailableException - If the user cannot join the room since the max number
of users has been reached.NotAcceptableException - If the registered user is trying to join with a
nickname different than the reserved nickname.public void occupantAdded(OccupantAddedEvent event)
public void leaveRoom(MUCRole leaveRole)
MUCRoompublic void leaveRoom(OccupantLeftEvent event)
public void destroyRoom(DestroyRoomRequest destroyRequest)
public void destroyRoom(org.xmpp.packet.JID alternateJID,
String reason)
MUCRoomdestroyRoom in interface MUCRoomalternateJID - an optional alternate JID. Commonly used to provide a replacement room. (can be null)reason - an optional reason why the room was destroyed (can be null).public org.xmpp.packet.Presence createPresence(org.xmpp.packet.Presence.Type presenceType)
throws UnauthorizedException
MUCRoomcreatePresence in interface MUCRoompresenceType - Type of presence to create (cannot be null).UnauthorizedException - If the user doesn't have permission to leave the roompublic void serverBroadcast(String msg)
MUCRoomserverBroadcast in interface MUCRoommsg - The message to broadcast (cannot be null)public void sendPublicMessage(org.xmpp.packet.Message message,
MUCRole senderRole)
throws ForbiddenException
MUCRoomsendPublicMessage in interface MUCRoommessage - The message to send (cannot be null).senderRole - the role of the user that is trying to send a public message (cannot be null).ForbiddenException - If the user is not allowed to send a public message (i.e. does not
have voice in the room).public void sendPrivatePacket(org.xmpp.packet.Packet packet,
MUCRole senderRole)
throws NotFoundException,
ForbiddenException
MUCRoomsendPrivatePacket in interface MUCRoompacket - The packet to send.senderRole - the role of the user that is trying to send a public message.NotFoundException - If the user is sending a packet to a room JID that does not exist.ForbiddenException - If a user of this role is not permitted to send private messages in this room.public void send(org.xmpp.packet.Packet packet)
MUCRoompublic void broadcast(BroadcastPresenceRequest presenceRequest)
public void broadcast(BroadcastMessageRequest messageRequest)
public long getChatLength()
MUCRoomgetChatLength in interface MUCRoompublic void addFirstOwner(org.xmpp.packet.JID bareJID)
MUCRoomMUCRoom.addOwner(JID jid,MUCRole).addFirstOwner in interface MUCRoombareJID - The bare JID of the user to add as owner (cannot be null).public List<org.xmpp.packet.Presence> addOwner(org.xmpp.packet.JID jid, MUCRole sendRole) throws ForbiddenException
MUCRoomaddOwner in interface MUCRoomjid - The JID of the user to add as owner (cannot be null).sendRole - the role of the user that is trying to modify the owners list (cannot be null).ForbiddenException - If the user is not allowed to modify the owner list.public List<org.xmpp.packet.Presence> addAdmin(org.xmpp.packet.JID jid, MUCRole sendRole) throws ForbiddenException, ConflictException
MUCRoomaddAdmin in interface MUCRoomjid - The JID of the user to add as admin (cannot be null).sendRole - The role of the user that is trying to modify the admins list (cannot be null).ForbiddenException - If the user is not allowed to modify the admin list.ConflictException - If the room was going to lose all its owners.public List<org.xmpp.packet.Presence> addMember(org.xmpp.packet.JID jid, String nickname, MUCRole sendRole) throws ForbiddenException, ConflictException
MUCRoomaddMember in interface MUCRoomjid - The JID of the user to add as a member (cannot be null).nickname - The reserved nickname of the member for the room or null if none.sendRole - the role of the user that is trying to modify the members list (cannot be null).ForbiddenException - If the user is not allowed to modify the members list.ConflictException - If the desired room nickname is already reserved for the room or if
the room was going to lose all its owners.public List<org.xmpp.packet.Presence> addOutcast(org.xmpp.packet.JID jid, String reason, MUCRole senderRole) throws NotAllowedException, ForbiddenException, ConflictException
MUCRoomaddOutcast in interface MUCRoomjid - The JID of the user to add as an outcast (cannot be null).reason - an optional reason why the user was banned (can be null).senderRole - The role of the user that initiated the ban (cannot be null).NotAllowedException - Thrown if trying to ban an owner or an administrator.ForbiddenException - If the user is not allowed to modify the outcast list.ConflictException - If the room was going to lose all its owners.public List<org.xmpp.packet.Presence> addNone(org.xmpp.packet.JID jid, MUCRole senderRole) throws ForbiddenException, ConflictException
MUCRoomaddNone in interface MUCRoomjid - The JID of the user to keep with a NONE affiliation (cannot be null).senderRole - The role of the user that set the affiliation to none (cannot be null).ForbiddenException - If the user is not allowed to modify the none list.ConflictException - If the room was going to lose all its owners.public boolean isLocked()
MUCRoompublic boolean isManuallyLocked()
MUCRoomisManuallyLocked in interface MUCRoompublic void presenceUpdated(MUCRole occupantRole, org.xmpp.packet.Presence newPresence)
presenceUpdated in interface MUCRoomoccupantRole - occupant that changed his presence in the room (cannot be null).newPresence - presence sent by the occupant (cannot be null).public void presenceUpdated(UpdatePresence updatePresence)
updatePresence - request to update an occupant's presence.public void occupantUpdated(UpdateOccupant update)
public org.xmpp.packet.Presence updateOccupant(UpdateOccupantRequest updateRequest) throws NotAllowedException
NotAllowedExceptionpublic void memberAdded(AddMember addMember)
public void affiliationAdded(AddAffiliation affiliation)
public void nicknameChanged(MUCRole occupantRole, org.xmpp.packet.Presence newPresence, String oldNick, String newNick)
MUCRoomnicknameChanged in interface MUCRoomoccupantRole - occupant that changed his nickname in the room (cannot be null).newPresence - presence sent by the occupant with the new nickname (cannot be null).oldNick - old nickname within the room (cannot be null).newNick - new nickname within the room (cannot be null).public void nicknameChanged(ChangeNickname changeNickname)
public void changeSubject(org.xmpp.packet.Message packet,
MUCRole role)
throws ForbiddenException
MUCRoomThe new subject will be added to the history of the room.
changeSubject in interface MUCRoompacket - the sent packet to change the room's subject (cannot be null).role - the role of the user that is trying to change the subject (cannot be null).ForbiddenException - If the user is not allowed to change the subject.public String getSubject()
MUCRoomgetSubject in interface MUCRoompublic void setSubject(String subject)
MUCRoomsetSubject in interface MUCRoomsubject - the last known subject of the room (cannot be null).public void sendInvitation(org.xmpp.packet.JID to,
String reason,
MUCRole senderRole,
List<org.dom4j.Element> extensions)
throws ForbiddenException,
CannotBeInvitedException
MUCRoomsendInvitation in interface MUCRoomto - the JID of the user that is being invited.reason - the reason of the invitation or null if none.senderRole - the role of the occupant that sent the invitation.extensions - the list of extensions sent with the original message invitation or null
if none.ForbiddenException - If the user is not allowed to send the invitation.CannotBeInvitedException - (Optionally) If the user being invited does not have access to the roompublic void sendInvitationRejection(org.xmpp.packet.JID to,
String reason,
org.xmpp.packet.JID sender)
MUCRoomsendInvitationRejection in interface MUCRoomto - the JID of the user that is originated the invitation.reason - the reason for the rejection or null if none.sender - the JID of the invitee that is rejecting the invitation.public IQOwnerHandler getIQOwnerHandler()
getIQOwnerHandler in interface MUCRoompublic IQAdminHandler getIQAdminHandler()
getIQAdminHandler in interface MUCRoompublic MUCRoomHistory getRoomHistory()
MUCRoomgetRoomHistory in interface MUCRoompublic Collection<org.xmpp.packet.JID> getOwners()
MUCRoompublic Collection<org.xmpp.packet.JID> getAdmins()
MUCRoompublic Collection<org.xmpp.packet.JID> getMembers()
MUCRoomgetMembers in interface MUCRoompublic Collection<org.xmpp.packet.JID> getOutcasts()
MUCRoomgetOutcasts in interface MUCRoompublic Collection<MUCRole> getModerators()
MUCRoomgetModerators in interface MUCRoompublic Collection<MUCRole> getParticipants()
MUCRoomgetParticipants in interface MUCRoompublic org.xmpp.packet.Presence addModerator(org.xmpp.packet.JID jid,
MUCRole senderRole)
throws ForbiddenException
MUCRoomaddModerator in interface MUCRoomjid - The full JID of the occupant to give moderator privileges (cannot be null).senderRole - The role of the user that is granting moderator privileges to an occupant (cannot be null).ForbiddenException - If the user is not allowed to grant moderator privileges.public org.xmpp.packet.Presence addParticipant(org.xmpp.packet.JID jid,
String reason,
MUCRole senderRole)
throws NotAllowedException,
ForbiddenException
MUCRoomaddParticipant in interface MUCRoomjid - The full JID of the occupant to give participant privileges (cannot be null).reason - The reason why participant privileges were gave to the user or null
if none.senderRole - The role of the user that is granting participant privileges to an occupant (cannot be null).NotAllowedException - If trying to change the moderator role to an owner or an admin.ForbiddenException - If the user is not allowed to grant participant privileges.public org.xmpp.packet.Presence addVisitor(org.xmpp.packet.JID jid,
MUCRole senderRole)
throws NotAllowedException,
ForbiddenException
MUCRoomaddVisitor in interface MUCRoomjid - the full JID of the occupant to change to visitor (cannot be null).senderRole - the role of the user that is changing the role to visitor (cannot be null).NotAllowedException - if trying to change the moderator role to an owner or an admin.ForbiddenException - if the user is not a moderator.public org.xmpp.packet.Presence kickOccupant(org.xmpp.packet.JID jid,
org.xmpp.packet.JID actorJID,
String actorNickname,
String reason)
throws NotAllowedException
MUCRoomkickOccupant in interface MUCRoomjid - The full JID of the kicked user (cannot be null).actorJID - The JID of the actor that initiated the kick (cannot be null).actorNickname - The actor nickname.reason - An optional reason why the user was kicked (can be null).NotAllowedException - Thrown if trying to ban an owner or an administrator.public boolean canAnyoneDiscoverJID()
MUCRoomcanAnyoneDiscoverJID in interface MUCRoompublic void setCanAnyoneDiscoverJID(boolean canAnyoneDiscoverJID)
MUCRoomsetCanAnyoneDiscoverJID in interface MUCRoomcanAnyoneDiscoverJID - boolean that specifies if every presence packet will include the
JID of every occupant.public String canSendPrivateMessage()
MUCRoomcanSendPrivateMessage in interface MUCRoompublic void setCanSendPrivateMessage(String role)
MUCRoomsetCanSendPrivateMessage in interface MUCRoomrole - The minimal role of persons that are allowed to send private messages in the room (never null).public boolean canOccupantsChangeSubject()
MUCRoomcanOccupantsChangeSubject in interface MUCRoompublic void setCanOccupantsChangeSubject(boolean canOccupantsChangeSubject)
MUCRoomsetCanOccupantsChangeSubject in interface MUCRoomcanOccupantsChangeSubject - boolean that specifies if participants are allowed to
change the room's subject.public boolean canOccupantsInvite()
MUCRoomcanOccupantsInvite in interface MUCRoompublic void setCanOccupantsInvite(boolean canOccupantsInvite)
MUCRoomsetCanOccupantsInvite in interface MUCRoomcanOccupantsInvite - boolean that specified in any occupant can invite other users to
the room.public String getNaturalLanguageName()
MUCRoomgetNaturalLanguageName in interface MUCRoompublic void setNaturalLanguageName(String naturalLanguageName)
MUCRoomsetNaturalLanguageName in interface MUCRoomnaturalLanguageName - the natural language name of the room.public String getDescription()
MUCRoomgetDescription in interface MUCRoompublic void setDescription(String description)
MUCRoomsetDescription in interface MUCRoomdescription - a description set by the room's owners about the room.public boolean isMembersOnly()
MUCRoomisMembersOnly in interface MUCRoompublic List<org.xmpp.packet.Presence> setMembersOnly(boolean membersOnly)
MUCRoomsetMembersOnly in interface MUCRoommembersOnly - if true then the room is members-only.public boolean isLogEnabled()
MUCRoomisLogEnabled in interface MUCRoompublic void setLogEnabled(boolean logEnabled)
MUCRoomsetLogEnabled in interface MUCRoomlogEnabled - boolean that specified if the room's conversation must be logged.public void setLoginRestrictedToNickname(boolean restricted)
MUCRoomsetLoginRestrictedToNickname in interface MUCRoomrestricted - if registered users can only join the room using their registered nickname.public boolean isLoginRestrictedToNickname()
MUCRoomisLoginRestrictedToNickname in interface MUCRoompublic void setChangeNickname(boolean canChange)
MUCRoomNotice that this feature is not supported by the MUC spec so answering a not_acceptable error may break some cliens.
setChangeNickname in interface MUCRoomcanChange - if room occupants are allowed to change their nicknames in the room.public boolean canChangeNickname()
MUCRoomNotice that this feature is not supported by the MUC spec so answering a not_acceptable error may break some cliens.
canChangeNickname in interface MUCRoompublic void setRegistrationEnabled(boolean registrationEnabled)
MUCRoomsetRegistrationEnabled in interface MUCRoomregistrationEnabled - if users are allowed to register with the room.public boolean isRegistrationEnabled()
MUCRoomisRegistrationEnabled in interface MUCRoompublic int getMaxUsers()
MUCRoomgetMaxUsers in interface MUCRoompublic void setMaxUsers(int maxUsers)
MUCRoomsetMaxUsers in interface MUCRoommaxUsers - the maximum number of occupants that can be simultaneously in the room. Zero
means unlimited number of occupants.public boolean isModerated()
MUCRoomisModerated in interface MUCRoompublic void setModerated(boolean moderated)
MUCRoomsetModerated in interface MUCRoommoderated - if the room in which only those with "voice" may send messages to all
occupants.public String getPassword()
MUCRoomgetPassword in interface MUCRoompublic void setPassword(String password)
MUCRoomsetPassword in interface MUCRoompassword - the password that the user must provide to enter the room.public boolean isPasswordProtected()
MUCRoomisPasswordProtected in interface MUCRoompublic boolean isPersistent()
MUCRoomisPersistent in interface MUCRoompublic boolean wasSavedToDB()
MUCRoomwasSavedToDB in interface MUCRoompublic void setSavedToDB(boolean saved)
MUCRoomsetSavedToDB in interface MUCRoomsaved - boolean that indicates if the room was saved to the database.public void setPersistent(boolean persistent)
MUCRoomsetPersistent in interface MUCRoompersistent - if the room is not destroyed if the last occupant exits.public boolean isPublicRoom()
MUCRoomisPublicRoom in interface MUCRoompublic void setPublicRoom(boolean publicRoom)
MUCRoomsetPublicRoom in interface MUCRoompublicRoom - if the room is searchable and visible through service discovery.public List<String> getRolesToBroadcastPresence()
MUCRoomgetRolesToBroadcastPresence in interface MUCRoompublic void setRolesToBroadcastPresence(List<String> rolesToBroadcastPresence)
MUCRoomsetRolesToBroadcastPresence in interface MUCRoomrolesToBroadcastPresence - the list of roles of which presence will be broadcasted to
the rest of the occupants.public boolean canBroadcastPresence(String roleToBroadcast)
MUCRoomcanBroadcastPresence in interface MUCRoomroleToBroadcast - the role to check if its presences will be broadcasted.public void lock(MUCRole senderRole) throws ForbiddenException
MUCRoomlock in interface MUCRoomsenderRole - the role of the occupant that locked the room.ForbiddenException - If the user is not an owner of the room.public void unlock(MUCRole senderRole) throws ForbiddenException
MUCRoomunlock in interface MUCRoomsenderRole - the role of the occupant that unlocked the room.ForbiddenException - If the user is not an owner of the room.public List<org.xmpp.packet.Presence> addAdmins(List<org.xmpp.packet.JID> newAdmins, MUCRole senderRole) throws ForbiddenException, ConflictException
MUCRoomaddAdmins in interface MUCRoomnewAdmins - the list of bare JIDs of the users to add to the list of existing admins (cannot be null).senderRole - the role of the user that is trying to modify the admins list (cannot be null).ForbiddenException - If the user is not allowed to modify the admin list.ConflictException - If the room was going to lose all its owners.public List<org.xmpp.packet.Presence> addOwners(List<org.xmpp.packet.JID> newOwners, MUCRole senderRole) throws ForbiddenException
MUCRoomaddOwners in interface MUCRoomnewOwners - the list of bare JIDs of the users to add to the list of existing owners (cannot be null).senderRole - the role of the user that is trying to modify the owners list (cannot be null).ForbiddenException - If the user is not allowed to modify the owner list.public void saveToDB()
MUCRoompublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void updateConfiguration(LocalMUCRoom otherRoom)
public String getUID()
getUID in interface org.xmpp.resultsetmanagement.Resultpublic void groupDeleting(Group group, Map params)
GroupEventListenergroupDeleting in interface GroupEventListenergroup - the group.params - event parameters.public void groupModified(Group group, Map params)
GroupEventListenergroupModified in interface GroupEventListenergroup - the group.params - event parameters.public void memberAdded(Group group, Map params)
GroupEventListenermemberAdded in interface GroupEventListenergroup - the group.params - event parameters.public void memberRemoved(Group group, Map params)
GroupEventListenermemberRemoved in interface GroupEventListenergroup - the group.params - event parameters.public void adminAdded(Group group, Map params)
GroupEventListeneradminAdded in interface GroupEventListenergroup - the group.params - event parameters.public void adminRemoved(Group group, Map params)
GroupEventListeneradminRemoved in interface GroupEventListenergroup - the group.params - event parameters.public void groupCreated(Group group, Map params)
GroupEventListenergroupCreated in interface GroupEventListenergroup - the group.params - event parameters.Copyright © 2003-2008 Jive Software.