📄 mucroom.java
字号:
public String getNaturalLanguageName();
/**
* Sets the natural language name of the room. This name can only be modified by room owners.
* It's mainly used for users while discovering rooms hosted by the Multi-User Chat service.
*
* @param naturalLanguageName the natural language name of the room.
*/
public void setNaturalLanguageName(String naturalLanguageName);
/**
* Returns a description set by the room's owners about the room. This information will be used
* when discovering extended information about the room.
*
* @return a description set by the room's owners about the room.
*/
public String getDescription();
/**
* Sets a description set by the room's owners about the room. This information will be used
* when discovering extended information about the room.
*
* @param description a description set by the room's owners about the room.
*/
public void setDescription(String description);
/**
* Returns true if the room requires an invitation to enter. That is if the room is
* members-only.
*
* @return true if the room requires an invitation to enter.
*/
public boolean isMembersOnly();
/**
* Sets if the room requires an invitation to enter. That is if the room is members-only.
*
* @param membersOnly if true then the room is members-only.
* @return the list of updated presences of all the occupants that aren't members of the room if
* the room is now members-only.
*/
public List<Presence> setMembersOnly(boolean membersOnly);
/**
* Returns true if the room's conversation is being logged. If logging is activated the room
* conversation will be saved to the database every couple of minutes. The saving frequency is
* the same for all the rooms and can be configured by changing the property
* "xmpp.muc.tasks.log.timeout" of MultiUserChatServerImpl.
*
* @return true if the room's conversation is being logged.
*/
public boolean isLogEnabled();
/**
* Sets if the room's conversation is being logged. If logging is activated the room
* conversation will be saved to the database every couple of minutes. The saving frequency is
* the same for all the rooms and can be configured by changing the property
* "xmpp.muc.tasks.log.timeout" of MultiUserChatServerImpl.
*
* @param logEnabled boolean that specified if the room's conversation must be logged.
*/
public void setLogEnabled(boolean logEnabled);
/**
* Returns true if registered users can only join the room using their registered nickname. By
* default, registered users can join the room using any nickname. A not_acceptable error
* will be returned if the user tries to join the room with a nickname different than the
* reserved nickname.
*
* @return true if registered users can only join the room using their registered nickname.
*/
public boolean isLoginRestrictedToNickname();
/**
* Sets if registered users can only join the room using their registered nickname. A
* not_acceptable error will be returned if the user tries to join the room with a nickname
* different than the reserved nickname.
*
* @param restricted if registered users can only join the room using their registered nickname.
*/
public void setLoginRestrictedToNickname(boolean restricted);
/**
* Returns true if room occupants are allowed to change their nicknames in the room. By
* default, occupants are allowed to change their nicknames. A not_acceptable error will be
* returned if an occupant tries to change his nickname and this feature is not enabled.<p>
*
* Notice that this feature is not supported by the MUC spec so answering a not_acceptable
* error may break some cliens.
*
* @return true if room occupants are allowed to change their nicknames in the room.
*/
public boolean canChangeNickname();
/**
* Sets if room occupants are allowed to change their nicknames in the room. By default,
* occupants are allowed to change their nicknames. A not_acceptable error will be returned if
* an occupant tries to change his nickname and this feature is not enabled.<p>
*
* Notice that this feature is not supported by the MUC spec so answering a not_acceptable
* error may break some cliens.
*
* @param canChange if room occupants are allowed to change their nicknames in the room.
*/
public void setChangeNickname(boolean canChange);
/**
* Returns true if users are allowed to register with the room. By default, room registration
* is enabled. A not_allowed error will be returned if a user tries to register with the room
* and this feature is disabled.
*
* @return true if users are allowed to register with the room.
*/
public boolean isRegistrationEnabled();
/**
* Sets if users are allowed to register with the room. By default, room registration
* is enabled. A not_allowed error will be returned if a user tries to register with the room
* and this feature is disabled.
*
* @param registrationEnabled if users are allowed to register with the room.
*/
public void setRegistrationEnabled(boolean registrationEnabled);
/**
* Returns the maximum number of occupants that can be simultaneously in the room. If the number
* is zero then there is no limit.
*
* @return the maximum number of occupants that can be simultaneously in the room. Zero means
* unlimited number of occupants.
*/
public int getMaxUsers();
/**
* Sets the maximum number of occupants that can be simultaneously in the room. If the number
* is zero then there is no limit.
*
* @param maxUsers the maximum number of occupants that can be simultaneously in the room. Zero
* means unlimited number of occupants.
*/
public void setMaxUsers(int maxUsers);
/**
* Returns if the room in which only those with "voice" may send messages to all occupants.
*
* @return if the room in which only those with "voice" may send messages to all occupants.
*/
public boolean isModerated();
/**
* Sets if the room in which only those with "voice" may send messages to all occupants.
*
* @param moderated if the room in which only those with "voice" may send messages to all
* occupants.
*/
public void setModerated(boolean moderated);
/**
* Returns true if a user cannot enter without first providing the correct password.
*
* @return true if a user cannot enter without first providing the correct password.
*/
public boolean isPasswordProtected();
/**
* Returns the password that the user must provide to enter the room.
*
* @return the password that the user must provide to enter the room.
*/
public String getPassword();
/**
* Sets the password that the user must provide to enter the room.
*
* @param password the password that the user must provide to enter the room.
*/
public void setPassword(String password);
/**
* Returns true if the room is not destroyed if the last occupant exits. Persistent rooms are
* saved to the database to make their configurations persistent together with the affiliation
* of the users.
*
* @return true if the room is not destroyed if the last occupant exits.
*/
public boolean isPersistent();
/**
* Sets if the room is not destroyed if the last occupant exits. Persistent rooms are
* saved to the database to make their configurations persistent together with the affiliation
* of the users.
*
* @param persistent if the room is not destroyed if the last occupant exits.
*/
public void setPersistent(boolean persistent);
/**
* Returns true if the room has already been made persistent. If the room is temporary the
* answer will always be false.
*
* @return true if the room has already been made persistent.
*/
public boolean wasSavedToDB();
/**
* Sets if the room has already been made persistent.
*
* @param saved boolean that indicates if the room was saved to the database.
*/
public void setSavedToDB(boolean saved);
/**
* Saves the room configuration to the DB. After the room has been saved to the DB it will
* become persistent.
*/
public void saveToDB();
/**
* Returns true if the room is searchable and visible through service discovery.
*
* @return true if the room is searchable and visible through service discovery.
*/
public boolean isPublicRoom();
/**
* Sets if the room is searchable and visible through service discovery.
*
* @param publicRoom if the room is searchable and visible through service discovery.
*/
public void setPublicRoom(boolean publicRoom);
/**
* Returns the list of roles of which presence will be broadcasted to the rest of the occupants.
* This feature is useful for implementing "invisible" occupants.
*
* @return the list of roles of which presence will be broadcasted to the rest of the occupants.
*/
public List<String> getRolesToBroadcastPresence();
/**
* Sets the list of roles of which presence will be broadcasted to the rest of the occupants.
* This feature is useful for implementing "invisible" occupants.
*
* @param rolesToBroadcastPresence the list of roles of which presence will be broadcasted to
* the rest of the occupants.
*/
public void setRolesToBroadcastPresence(List<String> rolesToBroadcastPresence);
/**
* Returns true if the presences of the requested role will be broadcasted.
*
* @param roleToBroadcast the role to check if its presences will be broadcasted.
* @return true if the presences of the requested role will be broadcasted.
*/
public boolean canBroadcastPresence(String roleToBroadcast);
/**
* Locks the room so that users cannot join the room. Only the owner of the room can lock/unlock
* the room.
*
* @param senderRole the role of the occupant that locked the room.
* @throws ForbiddenException If the user is not an owner of the room.
*/
public void lock(MUCRole senderRole) throws ForbiddenException;
/**
* Unlocks the room so that users can join the room. The room is locked when created and only
* the owner of the room can unlock it by sending the configuration form to the Multi-User Chat
* service.
*
* @param senderRole the role of the occupant that unlocked the room.
* @throws ForbiddenException If the user is not an owner of the room.
*/
public void unlock(MUCRole senderRole) throws ForbiddenException;
/**
* Sends an invitation to a user. The invitation will be sent as if the room is inviting the
* user. The invitation will include the original occupant the sent the invitation together with
* the reason for the invitation if any. Since the invitee could be offline at the moment we
* need the originating session so that the offline strategy could potentially bounce the
* message with the invitation.
*
* @param to the JID of the user that is being invited.
* @param reason the reason of the invitation or null if none.
* @param role the role of the occupant that sent the invitation.
* @param extensions the list of extensions sent with the original message invitation or null
* if none.
* @throws ForbiddenException If the user is not allowed to send the invitation.
*/
public void sendInvitation(JID to, String reason, MUCRole role, List<Element> extensions)
throws ForbiddenException;
/**
* Sends the rejection to the inviter. The rejection will be sent as if the room is rejecting
* the invitation is named of the invitee. The rejection will include the address of the invitee
* together with the reason for the rejection if any. Since the inviter could be offline at the
* moment we need the originating session so that the offline strategy could potentially bounce
* the message with the rejection.
*
* @param to the JID of the user that is originated the invitation.
* @param reason the reason for the rejection or null if none.
* @param from the JID of the invitee that is rejecting the invitation.
*/
public void sendInvitationRejection(JID to, String reason, JID from);
/**
* Sends a packet to the user.
*
* @param packet The packet to send
*/
public void send(Packet packet);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -