Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Class AbstractOperationSetMultiUserChat

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractOperationSetMultiUserChat
All Implemented Interfaces:
OperationSet, OperationSetMultiUserChat
Direct Known Subclasses:
MockMultiUserChat, OperationSetMultiUserChatIrcImpl, OperationSetMultiUserChatJabberImpl

public abstract class AbstractOperationSetMultiUserChat
extends Object
implements OperationSetMultiUserChat

Represents a default implementation of OperationSetMultiUserChat in order to make it easier for implementers to provide complete solutions while focusing on implementation-specific details.

Author:
Lubomir Marinov

Constructor Summary
AbstractOperationSetMultiUserChat()
           
 
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.
protected  void fireInvitationReceived(ChatRoomInvitation invitation)
          Fires a new ChatRoomInvitationReceivedEvent to all currently registered ChatRoomInvitationListeners to notify about the receipt of a specific ChatRoomInvitation.
protected  void fireInvitationRejectedEvent(ChatRoom sourceChatRoom, String invitee, String reason)
          Delivers a ChatRoomInvitationRejectedEvent to all registered ChatRoomInvitationRejectionListeners.
 void fireLocalUserPresenceEvent(ChatRoom chatRoom, String eventType, String reason)
          Delivers a LocalUserChatRoomPresenceChangeEvent to all registered LocalUserChatRoomPresenceListeners.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.OperationSetMultiUserChat
createChatRoom, findRoom, getCurrentlyJoinedChatRooms, getCurrentlyJoinedChatRooms, getExistingChatRooms, isMultiChatSupportedByContact, rejectInvitation
 

Constructor Detail

AbstractOperationSetMultiUserChat

public AbstractOperationSetMultiUserChat()
Method Detail

addInvitationListener

public void addInvitationListener(ChatRoomInvitationListener listener)
Description copied from interface: OperationSetMultiUserChat
Adds a listener to invitation notifications. The listener will be fired anytime an invitation is received.

Specified by:
addInvitationListener in interface OperationSetMultiUserChat
Parameters:
listener - an invitation listener.

addInvitationRejectionListener

public void addInvitationRejectionListener(ChatRoomInvitationRejectionListener listener)
Description copied from interface: OperationSetMultiUserChat
Adds a listener to invitation notifications. The listener will be fired anytime an invitation is received.

Specified by:
addInvitationRejectionListener in interface OperationSetMultiUserChat
Parameters:
listener - an invitation listener.

addPresenceListener

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

Specified by:
addPresenceListener in interface OperationSetMultiUserChat
Parameters:
listener - a local user participation listener.

fireInvitationReceived

protected void fireInvitationReceived(ChatRoomInvitation invitation)
Fires a new ChatRoomInvitationReceivedEvent to all currently registered ChatRoomInvitationListeners to notify about the receipt of a specific ChatRoomInvitation.

Parameters:
invitation - the ChatRoomInvitation which has been received

fireInvitationRejectedEvent

protected void fireInvitationRejectedEvent(ChatRoom sourceChatRoom,
                                           String invitee,
                                           String reason)
Delivers a ChatRoomInvitationRejectedEvent to all registered ChatRoomInvitationRejectionListeners.

Parameters:
sourceChatRoom - the room that invitation refers to
invitee - the name of the invitee that rejected the invitation
reason - the reason of the rejection

fireLocalUserPresenceEvent

public void fireLocalUserPresenceEvent(ChatRoom chatRoom,
                                       String eventType,
                                       String reason)
Delivers a LocalUserChatRoomPresenceChangeEvent to all registered LocalUserChatRoomPresenceListeners.

Parameters:
chatRoom - the ChatRoom which has been joined, left, etc.
eventType - the type of this event; one of LOCAL_USER_JOINED, LOCAL_USER_LEFT, etc.
reason - the reason

removeInvitationListener

public void removeInvitationListener(ChatRoomInvitationListener listener)
Description copied from interface: OperationSetMultiUserChat
Removes listener from the list of invitation listeners registered to receive invitation events.

Specified by:
removeInvitationListener in interface OperationSetMultiUserChat
Parameters:
listener - the invitation listener to remove.

removeInvitationRejectionListener

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

Specified by:
removeInvitationRejectionListener in interface OperationSetMultiUserChat
Parameters:
listener - the invitation listener to remove.

removePresenceListener

public void removePresenceListener(LocalUserChatRoomPresenceListener listener)
Description copied from interface: OperationSetMultiUserChat
Removes a listener that was being notified of changes in our participation in a room such as us being kicked, joined, left.

Specified by:
removePresenceListener in interface OperationSetMultiUserChat
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.