Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.chatroomslist
Class ChatRoomList

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.chatroomslist.ChatRoomList

public class ChatRoomList
extends Object

The ChatRoomsList is the list containing all chat rooms.

Author:
Yana Stamcheva

Nested Class Summary
static interface ChatRoomList.ChatRoomProviderWrapperListener
          Listener which registers for provider add/remove changes.
 
Constructor Summary
ChatRoomList()
           
 
Method Summary
 void addChatProvider(ProtocolProviderService pps)
          Adds a chat server and all its existing chat rooms.
 void addChatRoom(ChatRoomWrapper chatRoomWrapper)
          Adds a chat room to this list.
 void addChatRoomProviderWrapperListener(ChatRoomList.ChatRoomProviderWrapperListener listener)
          Adds a ChatRoomProviderWrapperListener to the listener list.
 ChatRoomWrapper findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
          Returns the ChatRoomWrapper that correspond to the given ChatRoom.
 ChatRoomProviderWrapper findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
          Returns the ChatRoomProviderWrapper that correspond to the given ProtocolProviderService.
 Iterator<ChatRoomProviderWrapper> getChatRoomProviders()
          Returns an iterator to the list of chat room providers.
 void loadList()
          Initializes the list of chat rooms.
 void removeChatProvider(ProtocolProviderService pps)
          Removes the corresponding server and all related chat rooms from this list.
 void removeChatRoom(ChatRoomWrapper chatRoomWrapper)
          Removes the given ChatRoom from the list of all chat rooms.
 void removeChatRoomProviderWrapperListener(ChatRoomList.ChatRoomProviderWrapperListener listener)
          Removes a ChatRoomProviderWrapperListener from the listener list.
 void synchronizeOpSetWithLocalContactList(ProtocolProviderService protocolProvider, OperationSetMultiUserChat opSet)
          Goes through the locally stored chat rooms list and for each ChatRoomWrapper tries to find the corresponding server stored ChatRoom in the specified operation set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatRoomList

public ChatRoomList()
Method Detail

loadList

public void loadList()
Initializes the list of chat rooms.


addChatProvider

public void addChatProvider(ProtocolProviderService pps)
Adds a chat server and all its existing chat rooms.

Parameters:
pps - the ProtocolProviderService corresponding to the chat server

removeChatProvider

public void removeChatProvider(ProtocolProviderService pps)
Removes the corresponding server and all related chat rooms from this list.

Parameters:
pps - the ProtocolProviderService corresponding to the server to remove

addChatRoom

public void addChatRoom(ChatRoomWrapper chatRoomWrapper)
Adds a chat room to this list.

Parameters:
chatRoomWrapper - the ChatRoom to add

removeChatRoom

public void removeChatRoom(ChatRoomWrapper chatRoomWrapper)
Removes the given ChatRoom from the list of all chat rooms.

Parameters:
chatRoomWrapper - the ChatRoomWrapper to remove

findChatRoomWrapperFromChatRoom

public ChatRoomWrapper findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
Returns the ChatRoomWrapper that correspond to the given ChatRoom. If the list of chat rooms doesn't contain a corresponding wrapper - returns null.

Parameters:
chatRoom - the ChatRoom that we're looking for
Returns:
the ChatRoomWrapper object corresponding to the given ChatRoom

findServerWrapperFromProvider

public ChatRoomProviderWrapper findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
Returns the ChatRoomProviderWrapper that correspond to the given ProtocolProviderService. If the list doesn't contain a corresponding wrapper - returns null.

Parameters:
protocolProvider - the protocol provider that we're looking for
Returns:
the ChatRoomProvider object corresponding to the given ProtocolProviderService

synchronizeOpSetWithLocalContactList

public void synchronizeOpSetWithLocalContactList(ProtocolProviderService protocolProvider,
                                                 OperationSetMultiUserChat opSet)
Goes through the locally stored chat rooms list and for each ChatRoomWrapper tries to find the corresponding server stored ChatRoom in the specified operation set. Joins automatically all found chat rooms.

Parameters:
protocolProvider - the protocol provider for the account to synchronize
opSet - the multi user chat operation set, which give us access to chat room server

getChatRoomProviders

public Iterator<ChatRoomProviderWrapper> getChatRoomProviders()
Returns an iterator to the list of chat room providers.

Returns:
an iterator to the list of chat room providers.

addChatRoomProviderWrapperListener

public void addChatRoomProviderWrapperListener(ChatRoomList.ChatRoomProviderWrapperListener listener)
Adds a ChatRoomProviderWrapperListener to the listener list.

Parameters:
listener - the ChatRoomProviderWrapperListener to be added

removeChatRoomProviderWrapperListener

public void removeChatRoomProviderWrapperListener(ChatRoomList.ChatRoomProviderWrapperListener listener)
Removes a ChatRoomProviderWrapperListener from the listener list.

Parameters:
listener - the ChatRoomProviderWrapperListener to be removed

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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