Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class ChatRoomMessageReceivedEvent
extends EventObject

MessageReceivedEvents indicate reception of an instant message.

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

Field Summary
static int ACTION_MESSAGE_RECEIVED
          An event type indicating that the message being received is a special message that sent by either another member or the server itself, indicating that some kind of action (other than the delivery of a conversation message) has occurred.
static int CONVERSATION_MESSAGE_RECEIVED
          An event type indicating that the message being received is a standard conversation message sent by another member of the chatroom to all current participants.
static int SYSTEM_MESSAGE_RECEIVED
          An event type indicting that the message being received is a system message being sent by the server or a system administrator, possibly notifying us of something important such as ongoing maintenance activities or server downtime.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ChatRoomMessageReceivedEvent(ChatRoom source, ChatRoomMember from, long timestamp, Message message, int eventType)
          Creates a MessageReceivedEvent representing reception of the source message received from the specified from contact.
 
Method Summary
 int getEventType()
          Returns the type of message event represented by this event instance.
 Message getMessage()
          Returns the received message.
 ChatRoom getSourceChatRoom()
          Returns the ChatRoom that triggered this event.
 ChatRoomMember getSourceChatRoomMember()
          Returns a reference to the ChatRoomMember that has send the Message whose reception this event represents.
 long getTimestamp()
          A timestamp indicating the exact date when the event occurred.
 boolean isHistoryMessage()
          Is current event for history message.
 void setHistoryMessage(boolean historyMessage)
          Changes property, whether this event is for a history message.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONVERSATION_MESSAGE_RECEIVED

public static final int CONVERSATION_MESSAGE_RECEIVED
An event type indicating that the message being received is a standard conversation message sent by another member of the chatroom to all current participants.

See Also:
Constant Field Values

ACTION_MESSAGE_RECEIVED

public static final int ACTION_MESSAGE_RECEIVED
An event type indicating that the message being received is a special message that sent by either another member or the server itself, indicating that some kind of action (other than the delivery of a conversation message) has occurred. Action messages are widely used in IRC through the /action and /me commands

See Also:
Constant Field Values

SYSTEM_MESSAGE_RECEIVED

public static final int SYSTEM_MESSAGE_RECEIVED
An event type indicting that the message being received is a system message being sent by the server or a system administrator, possibly notifying us of something important such as ongoing maintenance activities or server downtime.

See Also:
Constant Field Values
Constructor Detail

ChatRoomMessageReceivedEvent

public ChatRoomMessageReceivedEvent(ChatRoom source,
                                    ChatRoomMember from,
                                    long timestamp,
                                    Message message,
                                    int eventType)
Creates a MessageReceivedEvent representing reception of the source message received from the specified from contact.

Parameters:
source - the ChatRoom for which the message is received.
from - the ChatRoomMember that has sent this message.
timestamp - the exact date when the event occurred.
message - the received Message.
eventType - the type of message event that this instance represents (one of the XXX_MESSAGE_RECEIVED static fields).
Method Detail

getSourceChatRoomMember

public ChatRoomMember getSourceChatRoomMember()
Returns a reference to the ChatRoomMember that has send the Message whose reception this event represents.

Returns:
a reference to the ChatRoomMember that has send the Message whose reception this event represents.

getMessage

public Message getMessage()
Returns the received message.

Returns:
the Message that triggered this event.

getTimestamp

public long getTimestamp()
A timestamp indicating the exact date when the event occurred.

Returns:
a Date indicating when the event occurred.

getSourceChatRoom

public ChatRoom getSourceChatRoom()
Returns the ChatRoom that triggered this event.

Returns:
the ChatRoom that triggered this event.

getEventType

public int getEventType()
Returns the type of message event represented by this event instance. Message event type is one of the XXX_MESSAGE_RECEIVED fields of this class.

Returns:
one of the XXX_MESSAGE_RECEIVED fields of this class indicating the type of this event.

isHistoryMessage

public boolean isHistoryMessage()
Is current event for history message.

Returns:
is current event for history message.

setHistoryMessage

public void setHistoryMessage(boolean historyMessage)
Changes property, whether this event is for a history message.

Parameters:
historyMessage - whether its event for history message.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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