Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol.event
Class ChatRoomMemberPresenceChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.java.sip.communicator.service.protocol.event.ChatRoomMemberPresenceChangeEvent
All Implemented Interfaces:
Serializable

public class ChatRoomMemberPresenceChangeEvent
extends EventObject

Dispatched to notify interested parties that a change in the presence of a chat room member has occurred. Changes may include the participant being kicked, join, left...

Author:
Emil Ivov, Lyubomir Marinov
See Also:
Serialized Form

Field Summary
static String MEMBER_JOINED
          Indicates that this event was triggered as a result of the participant joining the source chat room.
static String MEMBER_KICKED
          Indicates that this event was triggered as a result of the participant being "kicked" out of the chat room.
static String MEMBER_LEFT
          Indicates that this event was triggered as a result of the participant leaving the source chat room.
static String MEMBER_QUIT
          Indicates that this event was triggered as a result of the participant being disconnected from the server brutally, or due to a ping timeout.
static String REASON_USER_LIST
          The well-known reason for a ChatRoomMemberPresenceChangeEvent to occur as part of an operation which lists all users in a ChatRoom.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ChatRoomMemberPresenceChangeEvent(ChatRoom sourceRoom, ChatRoomMember sourceMember, ChatRoomMember actorMember, String eventType, String reason)
          Creates a ChatRoomMemberPresenceChangeEvent representing that a change in the presence of a ChatRoomMember has occurred.
ChatRoomMemberPresenceChangeEvent(ChatRoom sourceRoom, ChatRoomMember sourceMember, String eventType, String reason)
          Creates a ChatRoomMemberPresenceChangeEvent representing that a change in the presence of a ChatRoomMember has occurred.
 
Method Summary
 ChatRoom getChatRoom()
          Returns the chat room that produced this event.
 ChatRoomMember getChatRoomMember()
          Returns the chat room member that this event is about.
 String getEventType()
          Returns the type of this event which could be one of the MEMBER_XXX member field values.
 String getReason()
          A reason String indicating a human readable reason for this event.
 boolean isReasonUserList()
          Gets the indicator which determines whether this event has occurred with the well-known reason of listing all users in a ChatRoom.
 String toString()
          Returns a String representation of this event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MEMBER_JOINED

public static final String MEMBER_JOINED
Indicates that this event was triggered as a result of the participant joining the source chat room.

See Also:
Constant Field Values

MEMBER_LEFT

public static final String MEMBER_LEFT
Indicates that this event was triggered as a result of the participant leaving the source chat room.

See Also:
Constant Field Values

MEMBER_KICKED

public static final String MEMBER_KICKED
Indicates that this event was triggered as a result of the participant being "kicked" out of the chat room.

See Also:
Constant Field Values

MEMBER_QUIT

public static final String MEMBER_QUIT
Indicates that this event was triggered as a result of the participant being disconnected from the server brutally, or due to a ping timeout.

See Also:
Constant Field Values

REASON_USER_LIST

public static final String REASON_USER_LIST
The well-known reason for a ChatRoomMemberPresenceChangeEvent to occur as part of an operation which lists all users in a ChatRoom.

See Also:
Constant Field Values
Constructor Detail

ChatRoomMemberPresenceChangeEvent

public ChatRoomMemberPresenceChangeEvent(ChatRoom sourceRoom,
                                         ChatRoomMember sourceMember,
                                         String eventType,
                                         String reason)
Creates a ChatRoomMemberPresenceChangeEvent representing that a change in the presence of a ChatRoomMember has occurred. Changes may include the participant being kicked, join, left, etc.

Parameters:
sourceRoom - the ChatRoom that produced this event
sourceMember - the ChatRoomMember that this event is about
eventType - the event type; one of the MEMBER_XXX constants
reason - the reason explaining why this event might have occurred

ChatRoomMemberPresenceChangeEvent

public ChatRoomMemberPresenceChangeEvent(ChatRoom sourceRoom,
                                         ChatRoomMember sourceMember,
                                         ChatRoomMember actorMember,
                                         String eventType,
                                         String reason)
Creates a ChatRoomMemberPresenceChangeEvent representing that a change in the presence of a ChatRoomMember has occurred. Changes may include the participant being kicked, join, left, etc.

Parameters:
sourceRoom - the ChatRoom that produced this event
sourceMember - the ChatRoomMember who this event is about
actorMember - the ChatRoomMember who participated as an actor in the new event. For example, in the case of a MEMBER_KICKED event the actorMember is the moderator who kicked the sourceMember.
eventType - the event type; one of the MEMBER_XXX constants
reason - the reason explaining why this event might have occurred
Method Detail

getChatRoom

public ChatRoom getChatRoom()
Returns the chat room that produced this event.

Returns:
the ChatRoom that produced this event

getChatRoomMember

public ChatRoomMember getChatRoomMember()
Returns the chat room member that this event is about.

Returns:
the ChatRoomMember that this event is about.

getReason

public String getReason()
A reason String indicating a human readable reason for this event.

Returns:
a human readable String containing the reason for this event, or null if no particular reason was specified.

isReasonUserList

public boolean isReasonUserList()
Gets the indicator which determines whether this event has occurred with the well-known reason of listing all users in a ChatRoom.

Returns:
true if this event has occurred with the well-known reason of listing all users in a ChatRoom i.e. getReason() returns a value of REASON_USER_LIST; otherwise, false

getEventType

public String getEventType()
Returns the type of this event which could be one of the MEMBER_XXX member field values.

Returns:
one of the MEMBER_XXX member field values indicating the type of this event.

toString

public String toString()
Returns a String representation of this event.

Overrides:
toString in class EventObject
Returns:
String representation of this event

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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