public class ChatRoomListImpl extends java.lang.Object implements RegistrationStateChangeListener, org.osgi.framework.ServiceListener
Constructor and Description |
---|
ChatRoomListImpl()
Constructs and initializes new ChatRoomListImpl objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addChatProvider(ProtocolProviderService pps)
Adds a listener to wait for provider to be registered or unregistered.
|
void |
addChatRoom(ChatRoomWrapper chatRoomWrapper)
Adds a chat room to this list.
|
void |
addChatRoomListChangeListener(ChatRoomListChangeListener l)
Adds the given ChatRoomListChangeListener that will listen for
all changes of the chat room list data model.
|
void |
addChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
Adds a ChatRoomProviderWrapperListener to the listener list.
|
(package private) ChatRoomProviderWrapper |
addRegisteredChatProvider(ProtocolProviderService pps)
Adds a chat server which is registered and all its existing chat rooms.
|
ChatRoomWrapper |
findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
Returns the ChatRoomWrapper that correspond to the given
ChatRoom.
|
ChatRoomWrapper |
findChatRoomWrapperFromChatRoomID(java.lang.String chatRoomID,
ProtocolProviderService pps)
Returns the ChatRoomWrapper that correspond to the given id of
chat room and provider.
|
ChatRoomProviderWrapper |
findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
Returns the ChatRoomProviderWrapper that correspond to the
given ProtocolProviderService.
|
void |
fireChatRoomListChangedEvent(ChatRoomWrapper chatRoomWrapper,
int eventID)
Notifies all interested listeners that a change in the chat room list
model has occurred.
|
java.util.Iterator<ChatRoomProviderWrapper> |
getChatRoomProviders()
Returns an iterator to the list of chat room providers.
|
void |
loadList()
Initializes the list of chat rooms.
|
void |
registrationStateChanged(RegistrationStateChangeEvent evt)
Listens for changes of providers registration state, so we can use only
registered providers.
|
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 |
removeChatRoomListChangeListener(ChatRoomListChangeListener l)
Removes the given ChatRoomListChangeListener.
|
void |
removeChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
Removes a ChatRoomProviderWrapperListener from the listener list.
|
void |
serviceChanged(org.osgi.framework.ServiceEvent event) |
public ChatRoomListImpl()
public void loadList()
public void addChatRoomListChangeListener(ChatRoomListChangeListener l)
l
- the listener to add.public void removeChatRoomListChangeListener(ChatRoomListChangeListener l)
l
- the listener to remove.public void fireChatRoomListChangedEvent(ChatRoomWrapper chatRoomWrapper, int eventID)
chatRoomWrapper
- the chat room wrapper that identifies the chat
roomeventID
- the identifier of the eventChatRoomProviderWrapper addRegisteredChatProvider(ProtocolProviderService pps)
pps
- the ProtocolProviderService corresponding to the chat
serverpublic void addChatProvider(ProtocolProviderService pps)
pps
- the ProtocolProviderService corresponding to the chat
serverpublic void removeChatProvider(ProtocolProviderService pps)
pps
- the ProtocolProviderService corresponding to the
server to removepublic void addChatRoom(ChatRoomWrapper chatRoomWrapper)
chatRoomWrapper
- the ChatRoom to addpublic void removeChatRoom(ChatRoomWrapper chatRoomWrapper)
chatRoomWrapper
- the ChatRoomWrapper to removepublic ChatRoomWrapper findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
chatRoom
- the ChatRoom that we're looking forpublic ChatRoomWrapper findChatRoomWrapperFromChatRoomID(java.lang.String chatRoomID, ProtocolProviderService pps)
chatRoomID
- the id of ChatRoom that we're looking forpps
- the procol provider associated with the chat room.public ChatRoomProviderWrapper findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
protocolProvider
- the protocol provider that we're looking forpublic java.util.Iterator<ChatRoomProviderWrapper> getChatRoomProviders()
public void addChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
listener
- the ChatRoomProviderWrapperListener to be addedpublic void removeChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
listener
- the ChatRoomProviderWrapperListener to be removedpublic void registrationStateChanged(RegistrationStateChangeEvent evt)
registrationStateChanged
in interface RegistrationStateChangeListener
evt
- a RegistrationStateChangeEvent which describes the
event that occurred.public void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged
in interface org.osgi.framework.ServiceListener
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.