Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Interface OperationSetMultiUserChat

All Superinterfaces:
OperationSet
All Known Implementing Classes:
AbstractOperationSetMultiUserChat, MockMultiUserChat, OperationSetMultiUserChatIrcImpl, OperationSetMultiUserChatJabberImpl

public interface OperationSetMultiUserChat
extends OperationSet

Allows creating, configuring, joining and administering of individual text-based conference rooms.

Author:
Emil Ivov

Method Summary
 void addInvitationListener(ChatRoomInvitationListener listener)
          Adds a listener to invitation notifications.
 void addInvitationRejectionListener(ChatRoomInvitationRejectionListener listener)
          Adds a listener to invitation notifications.
 void addPresenceListener(LocalUserChatRoomPresenceListener listener)
          Adds a listener that will be notified of changes in our participation in a chat room such as us being kicked, joined, left.
 ChatRoom createChatRoom(String roomName, Map<String,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(String roomName)
          Returns a reference to a chatRoom named roomName or null if no room with the given name exist on the server.
 List<ChatRoom> getCurrentlyJoinedChatRooms()
          Returns a list of the chat rooms that we have joined and are currently active in.
 List<String> getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
          Returns a list of the chat rooms that chatRoomMember has joined and is currently active in.
 List<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.
 void rejectInvitation(ChatRoomInvitation invitation, String rejectReason)
          Informs the sender of an invitation that we decline their invitation.
 void removeInvitationListener(ChatRoomInvitationListener listener)
          Removes listener from the list of invitation listeners registered to receive invitation events.
 void removeInvitationRejectionListener(ChatRoomInvitationRejectionListener listener)
          Removes the given listener from the list of invitation listeners registered to receive events every time an invitation has been rejected.
 void removePresenceListener(LocalUserChatRoomPresenceListener listener)
          Removes a listener that was being notified of changes in our participation in a room such as us being kicked, joined, left.
 

Method Detail

getExistingChatRooms

List<String> getExistingChatRooms()
                                  throws OperationFailedException,
                                         OperationNotSupportedException
Returns the List of Strings indicating chat rooms currently available on the server that this protocol provider is connected to.

Returns:
a java.util.List of the name Strings for chat rooms that are currently available on the server that this protocol provider is connected to.
Throws:
OperationFailedException - if we failed retrieving this list from the server.
OperationNotSupportedException - if the server does not support multi-user chat

getCurrentlyJoinedChatRooms

List<ChatRoom> getCurrentlyJoinedChatRooms()
Returns a list of the chat rooms that we have joined and are currently active in.

Returns:
a List of the rooms where the user has joined using a given connection.

getCurrentlyJoinedChatRooms

List<String> getCurrentlyJoinedChatRooms(ChatRoomMember chatRoomMember)
                                         throws OperationFailedException,
                                                OperationNotSupportedException
Returns a list of the chat rooms that chatRoomMember has joined and is currently active in.

Parameters:
chatRoomMember - the chatRoomMember whose current ChatRooms we will be querying.
Returns:
a list of the chat rooms that chatRoomMember has joined and is currently active in.
Throws:
OperationFailedException - if an error occurs while trying to discover the room on the server.
OperationNotSupportedException - if the server does not support multi-user chat

createChatRoom

ChatRoom createChatRoom(String roomName,
                        Map<String,Object> roomProperties)
                        throws OperationFailedException,
                               OperationNotSupportedException
Creates a room with the named roomName and according to the specified roomProperties on the server that this protocol provider is currently connected to. When the method returns the room the local user will not have joined it and thus will not receive messages on it until the ChatRoom.join() method is called.

Parameters:
roomName - the name of the ChatRoom to create.
roomProperties - properties specifying how the room should be created; null for no properties just like an empty Map
Returns:
the newly created ChatRoom named roomName.
Throws:
OperationFailedException - if the room couldn't be created for some reason (e.g. room already exists; user already joined to an existent room or user has no permissions to create a chat room).
OperationNotSupportedException - if chat room creation is not supported by this server

findRoom

ChatRoom findRoom(String roomName)
                  throws OperationFailedException,
                         OperationNotSupportedException
Returns a reference to a chatRoom named roomName or null if no room with the given name exist on the server.

Parameters:
roomName - the name of the ChatRoom that we're looking for.
Returns:
the ChatRoom named roomName if it exists, null otherwise.
Throws:
OperationFailedException - if an error occurs while trying to discover the room on the server.
OperationNotSupportedException - if the server does not support multi-user chat

rejectInvitation

void rejectInvitation(ChatRoomInvitation invitation,
                      String rejectReason)
Informs the sender of an invitation that we decline their invitation.

Parameters:
invitation - the invitation we are rejecting.
rejectReason - the reason to reject the invitation (optional)

addInvitationListener

void addInvitationListener(ChatRoomInvitationListener listener)
Adds a listener to invitation notifications. The listener will be fired anytime an invitation is received.

Parameters:
listener - an invitation listener.

removeInvitationListener

void removeInvitationListener(ChatRoomInvitationListener listener)
Removes listener from the list of invitation listeners registered to receive invitation events.

Parameters:
listener - the invitation listener to remove.

addInvitationRejectionListener

void addInvitationRejectionListener(ChatRoomInvitationRejectionListener listener)
Adds a listener to invitation notifications. The listener will be fired anytime an invitation is received.

Parameters:
listener - an invitation listener.

removeInvitationRejectionListener

void removeInvitationRejectionListener(ChatRoomInvitationRejectionListener listener)
Removes the given listener from the list of invitation listeners registered to receive events every time an invitation has been rejected.

Parameters:
listener - the invitation listener to remove.

isMultiChatSupportedByContact

boolean isMultiChatSupportedByContact(Contact contact)
Returns true if contact supports multi-user chat sessions.

Parameters:
contact - reference to the contact whose support for chat rooms we are currently querying.
Returns:
a boolean indicating whether contact supports chat rooms.

addPresenceListener

void addPresenceListener(LocalUserChatRoomPresenceListener listener)
Adds a listener that will be notified of changes in our participation in a chat room such as us being kicked, joined, left.

Parameters:
listener - a local user participation listener.

removePresenceListener

void removePresenceListener(LocalUserChatRoomPresenceListener listener)
Removes a listener that was being notified of changes in our participation in a room such as us being kicked, joined, left.

Parameters:
listener - a local user participation listener.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.