public interface ChatRoom
Modifier and Type | Method and Description |
---|---|
void |
addConferencePublishedListener(ChatRoomConferencePublishedListener listener)
Adds a listener that will be notified when a member of this chat room
has published a ConferenceDescription to the room.
|
void |
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
Adds a listener that will be notified of changes in our role in the room
such as us being granded operator.
|
void |
addMemberPresenceListener(ChatRoomMemberPresenceListener listener)
Adds a listener that will be notified of changes in our participation in
the room such as us being kicked, join, left...
|
void |
addMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
Adds a listener that will be notified of changes in the property of a
room member such as the nickname being changed.
|
void |
addMemberRoleListener(ChatRoomMemberRoleListener listener)
Adds a listener that will be notified of changes of a member role in the
room such as being granded operator.
|
void |
addMessageListener(ChatRoomMessageListener listener)
Registers listener so that it would receive events every time a
new message is received on this chat room.
|
void |
addPropertyChangeListener(ChatRoomPropertyChangeListener listener)
Adds a listener that will be notified of changes in the property of the
room such as the subject being change or the room state being changed.
|
void |
banParticipant(ChatRoomMember chatRoomMember,
java.lang.String reason)
Bans a user from the room.
|
Message |
createMessage(byte[] content,
java.lang.String contentType,
java.lang.String contentEncoding,
java.lang.String subject)
Create a Message instance for sending arbitrary MIME-encoding content.
|
Message |
createMessage(java.lang.String messageText)
Create a Message instance for sending a simple text messages with default
(text/plain) content type and encoding.
|
boolean |
destroy(java.lang.String reason,
java.lang.String alternateAddress)
Destroys the chat room.
|
java.util.Iterator<ChatRoomMember> |
getBanList()
Returns an Iterator over a set of ban masks for this chat room.
|
java.util.Map<java.lang.String,ConferenceDescription> |
getCachedConferenceDescriptions()
Returns cached ConferenceDescription instances.
|
int |
getCachedConferenceDescriptionSize()
Returns the number of cached ConferenceDescription instances.
|
ChatRoomConfigurationForm |
getConfigurationForm()
Returns the ChatRoomConfigurationForm containing all
configuration properties for this chat room.
|
java.lang.String |
getIdentifier()
Returns the identifier of this ChatRoom.
|
java.util.List<ChatRoomMember> |
getMembers()
Returns a List of ChatRoomMembers corresponding to all
members currently participating in this room.
|
int |
getMembersCount()
Returns the number of participants that are currently in this chat room.
|
java.util.List<java.lang.String> |
getMembersWhiteList()
Returns the ids of the users that has the member role in the room.
|
java.lang.String |
getName()
Returns the name of this ChatRoom.
|
ProtocolProviderService |
getParentProvider()
Returns a reference to the provider that created this room.
|
Contact |
getPrivateContactByNickname(java.lang.String name)
Finds private messaging contact by nickname.
|
java.lang.String |
getSubject()
Returns the last known room subject/theme or null if the user
hasn't joined the room or the room does not have a subject yet.
|
java.lang.String |
getUserNickname()
Returns the local user's nickname in the context of this chat room or
null if not currently joined.
|
ChatRoomMemberRole |
getUserRole()
Returns the local user's role in the context of this chat room or
null if not currently joined.
|
void |
grantAdmin(java.lang.String address)
Grants administrator privileges to another user.
|
void |
grantMembership(java.lang.String address)
Grants membership to a user.
|
void |
grantModerator(java.lang.String nickname)
Grants moderator privileges to a participant or visitor.
|
void |
grantOwnership(java.lang.String address)
Grants ownership privileges to another user.
|
void |
grantVoice(java.lang.String nickname)
Grants voice to a visitor in the room.
|
void |
invite(java.lang.String userAddress,
java.lang.String reason)
Invites another user to this room.
|
boolean |
isJoined()
Returns true if the local user is currently in the multi user chat
(after calling one of the
join() methods). |
boolean |
isPersistent()
Determines whether this chat room should be stored in the configuration
file or not.
|
boolean |
isSystem()
Returns
true if this chat room is a system room and
false otherwise. |
void |
join()
Joins this chat room with the nickname of the local user so that the
user would start receiving events and messages for it.
|
void |
join(byte[] password)
Joins this chat room so that the user would start receiving events and
messages for it.
|
void |
joinAs(java.lang.String nickname)
Joins this chat room with the specified nickname so that the user would
start receiving events and messages for it.
|
void |
joinAs(java.lang.String nickname,
byte[] password)
Joins this chat room with the specified nickname and password so that the
user would start receiving events and messages for it.
|
void |
kickParticipant(ChatRoomMember chatRoomMember,
java.lang.String reason)
Kicks a visitor or participant from the room.
|
void |
leave()
Leave this chat room.
|
ConferenceDescription |
publishConference(ConferenceDescription cd,
java.lang.String name)
Publishes a ConferenceDescription to the chat room.
|
void |
removeConferencePublishedListener(ChatRoomConferencePublishedListener listener)
Removes a listener that was being notified when a member of this chat
room had published a ConferenceDescription to the room.
|
void |
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
Removes a listener that was being notified of changes in our role in this
chat room such as us being granded operator.
|
void |
removeMemberPresenceListener(ChatRoomMemberPresenceListener listener)
Removes a listener that was being notified of changes in the
participation of other chat room participants such as users being kicked,
join, left.
|
void |
removeMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
Removes a listener that was being notified of changes in the property of
a chat room member such as the nickname being changed.
|
void |
removeMemberRoleListener(ChatRoomMemberRoleListener listener)
Removes a listener that was being notified of changes of a member role in
this chat room such as us being granded operator.
|
void |
removeMessageListener(ChatRoomMessageListener listener)
Removes listener so that it won't receive any further message
events from this room.
|
void |
removePropertyChangeListener(ChatRoomPropertyChangeListener listener)
Removes a listener that was being notified of changes in the property of
the chat room such as the subject being change or the room state being
changed.
|
void |
revokeAdmin(java.lang.String address)
Revokes administrator privileges from a user.
|
void |
revokeMembership(java.lang.String address)
Revokes a user's membership.
|
void |
revokeModerator(java.lang.String nickname)
Revokes moderator privileges from another user.
|
void |
revokeOwnership(java.lang.String address)
Revokes ownership privileges from another user.
|
void |
revokeVoice(java.lang.String nickname)
Revokes voice from a participant in the room.
|
void |
sendMessage(Message message)
Sends the message to this chat room.
|
void |
setLocalUserRole(ChatRoomMemberRole role)
Changes the the local user's nickname in the context of this chatroom.
|
void |
setMembersWhiteList(java.util.List<java.lang.String> members)
Changes the list of users that has role member for this room.
|
void |
setSubject(java.lang.String subject)
Sets the subject of this chat room.
|
void |
setUserNickname(java.lang.String nickname)
Changes the the local user's nickname in the context of this chatroom.
|
void |
updatePrivateContactPresenceStatus(Contact contact)
Updates the presence status of private messaging contact.
|
void |
updatePrivateContactPresenceStatus(java.lang.String nickname)
Updates the presence status of private messaging contact.
|
java.lang.String getName()
java.lang.String getIdentifier()
void join() throws OperationFailedException
OperationFailedException
- with the corresponding code if an error
occurs while joining the room.void join(byte[] password) throws OperationFailedException
password
- the password to use when authenticating on the chatroom.OperationFailedException
- with the corresponding code if an error
occurs while joining the room.void joinAs(java.lang.String nickname) throws OperationFailedException
nickname
- the nickname to use.OperationFailedException
- with the corresponding code if an error
occurs while joining the room.void joinAs(java.lang.String nickname, byte[] password) throws OperationFailedException
nickname
- the nickname to use.password
- a password necessary to authenticate when joining the
room.OperationFailedException
- with the corresponding code if an error
occurs while joining the room.boolean isJoined()
join()
methods).void leave()
java.lang.String getSubject()
To be notified every time the room's subject change you should add a
ChatRoomChangelistener to this room.
addPropertyChangeListener(ChatRoomPropertyChangeListener)
To change the room's subject use setSubject(String)
.
void setSubject(java.lang.String subject) throws OperationFailedException
subject
- the new subject that we'd like this room to haveOperationFailedException
- if the user doesn't have the right to
change this property.java.lang.String getUserNickname()
ChatRoomMemberRole getUserRole()
void setLocalUserRole(ChatRoomMemberRole role) throws OperationFailedException
role
- the new role to set for the local user.OperationFailedException
- if an error occurs.void setUserNickname(java.lang.String nickname) throws OperationFailedException
nickname
- the new nickname within the room.OperationFailedException
- if the new nickname already exist in
this roomvoid addMemberPresenceListener(ChatRoomMemberPresenceListener listener)
listener
- a member participation listener.void removeMemberPresenceListener(ChatRoomMemberPresenceListener listener)
listener
- a member participation listener.void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
listener
- a local user role listener.void removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
listener
- a local user role listener.void addMemberRoleListener(ChatRoomMemberRoleListener listener)
listener
- a member role listener.void removeMemberRoleListener(ChatRoomMemberRoleListener listener)
listener
- a member role listener.void addPropertyChangeListener(ChatRoomPropertyChangeListener listener)
listener
- a property change listener.void removePropertyChangeListener(ChatRoomPropertyChangeListener listener)
listener
- a property change listener.void addMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
listener
- a room member property change listener.void removeMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
listener
- a room member property change listener.void invite(java.lang.String userAddress, java.lang.String reason)
If the room is password-protected, the invitee will receive a password to use to join the room. If the room is members-only, the the invitee may be added to the member list.
userAddress
- the address of the user to invite to the room.(one
may also invite users not on their contact list).reason
- a reason, subject, or welcome message that would tell the
the user why they are being invited.java.util.List<ChatRoomMember> getMembers()
int getMembersCount()
void addMessageListener(ChatRoomMessageListener listener)
listener
- a MessageListener that would be notified every
time a new message is received on this chat room.void removeMessageListener(ChatRoomMessageListener listener)
listener
- the MessageListener to remove from this roomMessage createMessage(byte[] content, java.lang.String contentType, java.lang.String contentEncoding, java.lang.String subject)
content
- content valuecontentType
- the MIME-type for contentcontentEncoding
- encoding used for contentsubject
- a String subject or null for now subject.Message createMessage(java.lang.String messageText)
messageText
- the string content of the message.void sendMessage(Message message) throws OperationFailedException
message
- the Message to send.OperationFailedException
- if sending the message fails for some
reason.ProtocolProviderService getParentProvider()
java.util.Iterator<ChatRoomMember> getBanList() throws OperationFailedException
OperationFailedException
- if an error occured while performing the
request to the server or you don't have enough privileges to get this
informationvoid banParticipant(ChatRoomMember chatRoomMember, java.lang.String reason) throws OperationFailedException
chatRoomMember
- the ChatRoomMember to be banned.reason
- the reason why the user was banned.OperationFailedException
- if an error occurs while banning a user.
In particular, an error can occur if a moderator or a user with an
affiliation of "owner" or "admin" was tried to be banned or if the user
that is banning have not enough permissions to ban.void kickParticipant(ChatRoomMember chatRoomMember, java.lang.String reason) throws OperationFailedException
chatRoomMember
- the ChatRoomMember to kick from the roomreason
- the reason why the participant is being kicked from the
roomOperationFailedException
- if an error occurs while kicking the
participant. In particular, an error can occur if a moderator or a user
with an affiliation of "owner" or "administrator" was intended to be
kicked; or if the participant that intended to kick another participant
does not have kicking privileges;ChatRoomConfigurationForm getConfigurationForm() throws OperationFailedException
OperationFailedException
- if the user doesn't have
permissions to see and change chat room configurationboolean isSystem()
true
if this chat room is a system room and
false
otherwise.true
if this chat room is a system room and
false
otherwise.boolean isPersistent()
Contact getPrivateContactByNickname(java.lang.String name)
name
- the nickname of the contact.void grantAdmin(java.lang.String address)
address
- the user address of the user to grant administrator
privileges (e.g. "[email protected]").void grantMembership(java.lang.String address)
address
- the user address of the user to grant membership
privileges (e.g. "[email protected]").void grantModerator(java.lang.String nickname)
nickname
- the nickname of the occupant to grant moderator
privileges.void grantOwnership(java.lang.String address)
address
- the user address of the user to grant ownership
privileges (e.g. "[email protected]").void grantVoice(java.lang.String nickname)
nickname
- the nickname of the visitor to grant voice in the room
(e.g. "john").void revokeAdmin(java.lang.String address)
address
- the user address of the user to grant administrator
privileges (e.g. "[email protected]").void revokeMembership(java.lang.String address)
address
- the user address of the user to revoke membership
(e.g. "[email protected]").void revokeModerator(java.lang.String nickname)
nickname
- the nickname of the occupant to revoke moderator
privileges.void revokeOwnership(java.lang.String address)
address
- the user address of the user to revoke ownership
(e.g. "[email protected]").void revokeVoice(java.lang.String nickname)
nickname
- the nickname of the participant to revoke voice
(e.g. "john").ConferenceDescription publishConference(ConferenceDescription cd, java.lang.String name)
cd
- the description to publishname
- the name of the conferencevoid updatePrivateContactPresenceStatus(java.lang.String nickname)
nickname
- the nickname of the contact.void updatePrivateContactPresenceStatus(Contact contact)
contact
- the contact.void addConferencePublishedListener(ChatRoomConferencePublishedListener listener)
listener
- the listener to add.void removeConferencePublishedListener(ChatRoomConferencePublishedListener listener)
listener
- the listener to remove.java.util.Map<java.lang.String,ConferenceDescription> getCachedConferenceDescriptions()
int getCachedConferenceDescriptionSize()
boolean destroy(java.lang.String reason, java.lang.String alternateAddress)
reason
- the reason for destroying.alternateAddress
- the alternate addressjava.util.List<java.lang.String> getMembersWhiteList()
void setMembersWhiteList(java.util.List<java.lang.String> members)
members
- the ids of user to have member role.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.