|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.mock.MockChatRoom
public class MockChatRoom
| Constructor Summary | |
|---|---|
MockChatRoom(MockProvider provider,
MockMultiUserChat parentOpSet,
String roomName)
Creates an instance of MockChatRoom by specifying the corresponding protocol provider, the multi user chat operation set and the room name. |
|
| Method Summary | |
|---|---|
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,
String reason)
Bans a user from the room. |
Message |
createMessage(byte[] content,
String contentType,
String contentEncoding,
String subject)
Create a Message instance for sending arbitrary MIME-encoding content. |
Message |
createMessage(String messageText)
Create a Message instance for sending a simple text messages with default (text/plain) content type and encoding. |
void |
deliverMessage(Message msg,
String from)
Methods for manipulating mock operation set as deliver(receive) messageop |
Iterator<ChatRoomMember> |
getBanList()
Returns an Iterator over a set of ban masks for this chat room. |
ChatRoomConfigurationForm |
getConfigurationForm()
Returns the ChatRoomConfigurationForm containing all configuration properties for this chat room. |
String |
getIdentifier()
Returns the identifier of this ChatRoom. |
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. |
String |
getName()
Returns the name of this ChatRoom. |
ProtocolProviderService |
getParentProvider()
Returns a reference to the provider that created this room. |
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. |
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 role. |
void |
grantAdmin(String address)
Grants admin role to the participant given by address. |
void |
grantMembership(String address)
Grants membership role to the participant given by address. |
void |
grantModerator(String address)
Grants moderator role to the participant given by address. |
void |
grantOwnership(String address)
Grants ownership role to the participant given by address. |
void |
grantVoice(String address)
Grants voice to the participant given by address. |
void |
invite(String userAddress,
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(String nickname)
Joins this chat room with the specified nickname so that the user would start receiving events and messages for it. |
void |
joinAs(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,
String reason)
Kicks a visitor or participant from the room. |
void |
leave()
Leave this chat 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(String address)
Revokes the admin role for the participant given by address. |
void |
revokeMembership(String address)
Revokes the membership role for the participant given by address. |
void |
revokeModerator(String address)
Revokes the moderator role for the participant given by address. |
void |
revokeOwnership(String address)
Revokes the ownership role for the participant given by address. |
void |
revokeVoice(String address)
Revokes the voice for the participant given by address. |
void |
sendMessage(Message message)
Sends the message to the destination indicated by the to contact. |
void |
setLocalUserRole(ChatRoomMemberRole role)
Sets the local user role. |
void |
setNickname(String nickname)
Changes the the local user's nickname in the context of this chatroom. |
void |
setSubject(String subject)
Sets the subject of this chat room. |
void |
setUserNickname(String nickname)
Changes the the local user's nickname in the context of this chatroom. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockChatRoom(MockProvider provider,
MockMultiUserChat parentOpSet,
String roomName)
provider - the corresponding ProtocolProviderServiceparentOpSet - the corresponding OperationSetMultiUserChatroomName - the name of the room| Method Detail |
|---|
public String getName()
getName in interface ChatRoom
public void join()
throws OperationFailedException
join in interface ChatRoomOperationFailedException - with the corresponding code if an error
occurs while joining the room.
public void join(byte[] password)
throws OperationFailedException
join in interface ChatRoompassword - the password to use when authenticating on the chatroom.
OperationFailedException - with the corresponding code if an error
occurs while joining the room.
public void joinAs(String nickname)
throws OperationFailedException
joinAs in interface ChatRoomnickname - the nickname to use.
OperationFailedException - with the corresponding code if an error
occurs while joining the room.
public void joinAs(String nickname,
byte[] password)
throws OperationFailedException
joinAs in interface ChatRoomnickname - 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.public boolean isJoined()
join() methods).
isJoined in interface ChatRoompublic void leave()
leave in interface ChatRoompublic 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).
getSubject in interface ChatRoom
public void setSubject(String subject)
throws OperationFailedException
setSubject in interface ChatRoomsubject - the new subject that we'd like this room to have
OperationFailedExceptionpublic String getUserNickname()
getUserNickname in interface ChatRoom
public void setNickname(String nickname)
throws OperationFailedException
nickname - the new nickname within the room.
OperationFailedException - if the setting the new nickname changes
for some reason.public void addMemberPresenceListener(ChatRoomMemberPresenceListener listener)
addMemberPresenceListener in interface ChatRoomlistener - a member participation listener.public void removeMemberPresenceListener(ChatRoomMemberPresenceListener listener)
removeMemberPresenceListener in interface ChatRoomlistener - a member participation listener.public void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
addLocalUserRoleListener in interface ChatRoomlistener - a local user role listener.public void removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
removelocalUserRoleListener in interface ChatRoomlistener - a local user role listener.public void addMemberRoleListener(ChatRoomMemberRoleListener listener)
addMemberRoleListener in interface ChatRoomlistener - a member role listener.public void removeMemberRoleListener(ChatRoomMemberRoleListener listener)
removeMemberRoleListener in interface ChatRoomlistener - a member role listener.public void addPropertyChangeListener(ChatRoomPropertyChangeListener listener)
addPropertyChangeListener in interface ChatRoomlistener - a property change listener.public void removePropertyChangeListener(ChatRoomPropertyChangeListener listener)
removePropertyChangeListener in interface ChatRoomlistener - a property change listener.
public void invite(String userAddress,
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.
invite in interface ChatRoomuserAddress - 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.public List<ChatRoomMember> getMembers()
getMembers in interface ChatRoompublic int getMembersCount()
getMembersCount in interface ChatRoompublic void addMessageListener(ChatRoomMessageListener listener)
addMessageListener in interface ChatRoomlistener - a MessageListener that would be notified every
time a new message is received on this chat room.public void removeMessageListener(ChatRoomMessageListener listener)
removeMessageListener in interface ChatRoomlistener - the MessageListener to remove from this room
public Message createMessage(byte[] content,
String contentType,
String contentEncoding,
String subject)
createMessage in interface ChatRoomcontent - content valuecontentType - the MIME-type for contentcontentEncoding - encoding used for contentsubject - a String subject or null for now subject.
public Message createMessage(String messageText)
createMessage in interface ChatRoommessageText - the string content of the message.
public void sendMessage(Message message)
throws OperationFailedException
sendMessage in interface ChatRoommessage - the Message to send.
OperationFailedException - if sending the message fails for some
reason.public ProtocolProviderService getParentProvider()
getParentProvider in interface ChatRoompublic Iterator<ChatRoomMember> getBanList()
getBanList in interface ChatRoom
public void deliverMessage(Message msg,
String from)
msg - the message that we are to deliver.from - delivered from
public void setUserNickname(String nickname)
throws OperationFailedException
setUserNickname in interface ChatRoomnickname - the new nickname within the room.
OperationFailedException - if the setting the new nickname changes
for some reason.public String getIdentifier()
getIdentifier in interface ChatRoom
public void banParticipant(ChatRoomMember chatRoomMember,
String reason)
throws OperationFailedException
banParticipant in interface ChatRoomchatRoomMember - the ChatRoomMember to be bannedreason - the reason why the user was banned
OperationFailedException - if an error occurs while banning a user
public void kickParticipant(ChatRoomMember chatRoomMember,
String reason)
throws OperationFailedException
kickParticipant in interface ChatRoomchatRoomMember - the ChatRoomMember to kick from the roomreason - the reason why the participant is being kicked from the
room
OperationFailedException - if an error occurs while kicking the
participant
public ChatRoomConfigurationForm getConfigurationForm()
throws OperationFailedException
getConfigurationForm in interface ChatRoomOperationFailedException - if the user doesn't have
permissions to see and change chat room configurationpublic void addMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
addMemberPropertyChangeListener in interface ChatRoomlistener - a room member property change listener.public void removeMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
removeMemberPropertyChangeListener in interface ChatRoomlistener - a room member property change listener.public boolean isSystem()
true if this chat room is a system room and
false otherwise.
isSystem in interface ChatRoomtrue if this chat room is a system room and
false otherwise.public boolean isPersistent()
isPersistent in interface ChatRoompublic void grantAdmin(String address)
grantAdmin in interface ChatRoomaddress - the address of the participant to grant admin role topublic void grantMembership(String address)
grantMembership in interface ChatRoomaddress - the address of the participant to grant membership role topublic void grantModerator(String address)
grantModerator in interface ChatRoomaddress - the address of the participant to grant moderator role topublic void grantOwnership(String address)
grantOwnership in interface ChatRoomaddress - the address of the participant to grant ownership role topublic void grantVoice(String address)
grantVoice in interface ChatRoomaddress - the address of the participant to grant voice topublic void revokeAdmin(String address)
revokeAdmin in interface ChatRoomaddress - the address of the participant to revoke admin role forpublic void revokeMembership(String address)
revokeMembership in interface ChatRoomaddress - the address of the participant to revoke membership role
forpublic void revokeModerator(String address)
revokeModerator in interface ChatRoomaddress - the address of the participant to revoke moderator role
forpublic void revokeOwnership(String address)
revokeOwnership in interface ChatRoomaddress - the address of the participant to revoke ownership role
forpublic void revokeVoice(String address)
revokeVoice in interface ChatRoomaddress - the address of the participant to revoke voice forpublic ChatRoomMemberRole getUserRole()
getUserRole in interface ChatRoom
public void setLocalUserRole(ChatRoomMemberRole role)
throws OperationFailedException
setLocalUserRole in interface ChatRoomrole - the role to set
OperationFailedException - if the operation don't succeed
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||