public class MockMultiUserChat extends AbstractOperationSetMultiUserChat
Constructor and Description |
---|
MockMultiUserChat(MockProvider provider)
Creates an instance of this operation set keeping a reference to the
parent protocol provider and presence operation set.
|
Modifier and Type | Method and Description |
---|---|
ChatRoom |
createChatRoom(java.lang.String roomName,
java.util.Map<java.lang.String,java.lang.Object> roomProperties)
Creates a room with the named roomName and according to the
specified roomProperties on the server that this protocol
provider is currently connected to.
|
ChatRoom |
findRoom(java.lang.String roomName)
Returns a reference to a chatRoom named roomName or null if no
such room exists.
|
java.util.List<ChatRoom> |
getCurrentlyJoinedChatRooms()
Returns a list of the chat rooms that we have joined and are currently
active in.
|
java.util.List<java.lang.String> |
getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
Returns a list of the chat rooms that chatRoomMember has joined
and is currently active in.
|
java.util.List<java.lang.String> |
getExistingChatRooms()
Returns the List of Strings indicating chat rooms
currently available on the server that this protocol provider is
connected to.
|
boolean |
isMultiChatSupportedByContact(Contact contact)
Returns true if contact supports multi user chat sessions.
|
boolean |
isPrivateMessagingContact(java.lang.String contactAddress)
Always returns false.
|
void |
rejectInvitation(ChatRoomInvitation invitation,
java.lang.String reason)
Informs the sender of an invitation that we decline their invitation.
|
addInvitationListener, addInvitationRejectionListener, addPresenceListener, fireInvitationReceived, fireInvitationRejectedEvent, fireLocalUserPresenceEvent, fireLocalUserPresenceEvent, removeInvitationListener, removeInvitationRejectionListener, removePresenceListener
public MockMultiUserChat(MockProvider provider)
provider
- The provider instance that creates us.public java.util.List<java.lang.String> getExistingChatRooms() throws OperationFailedException, OperationNotSupportedException
OperationFailedException
- if we failed retrieving this list from
the server.OperationNotSupportedException
- if the server does not support
multi user chatpublic java.util.List<ChatRoom> getCurrentlyJoinedChatRooms()
public java.util.List<java.lang.String> getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember) throws OperationFailedException, OperationNotSupportedException
chatRoomMember
- the chatRoomMember whose current ChatRooms we will
be querying.OperationFailedException
- if an error occurs while trying to
discover the room on the server.OperationNotSupportedException
- if the server does not support
multi user chatpublic ChatRoom createChatRoom(java.lang.String roomName, java.util.Map<java.lang.String,java.lang.Object> roomProperties) throws OperationFailedException, OperationNotSupportedException
roomName
- the name of the ChatRoom to create.roomProperties
- properties specifying how the room should be
created.OperationFailedException
- if the room couldn't be created for some
reason (e.g. room already exists; user already joined to an existing
room or user has no permissions to create a chat room).OperationNotSupportedException
- if chat room creation is not
supported by this serverpublic ChatRoom findRoom(java.lang.String roomName) throws OperationFailedException, OperationNotSupportedException
roomName
- the name of the ChatRoom that we're looking for.OperationFailedException
- if an error occurs while trying to
discover the room on the server.OperationNotSupportedException
- if the server does not support
multi user chatpublic void rejectInvitation(ChatRoomInvitation invitation, java.lang.String reason)
invitation
- the invitation we are rejecting.reason
- the reason for rejecting.public boolean isMultiChatSupportedByContact(Contact contact)
contact
- reference to the contact whose support for chat rooms
we are currently querying.public boolean isPrivateMessagingContact(java.lang.String contactAddress)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.