Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class MessageReceivedEvent
extends EventObject

MessageReceivedEvents indicate reception of an instant message.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
static int CONVERSATION_MESSAGE_RECEIVED
          An event type indicating that the message being received is a standard conversation message sent by another contact.
static int SMS_MESSAGE_RECEIVED
          an event type indicating that the message being received is an SMS message.
static int SYSTEM_MESSAGE_RECEIVED
          An event type indicating that the message being received is a system message being sent by the server or a system administrator.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MessageReceivedEvent(Message source, Contact from, long timestamp)
          Creates a MessageReceivedEvent representing reception of the source message received from the specified from contact.
MessageReceivedEvent(Message source, Contact from, long timestamp, 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.
 Contact getSourceContact()
          Returns a reference to the Contact that has send the Message whose reception this event represents.
 Message getSourceMessage()
          Returns the message that triggered this event
 long getTimestamp()
          A timestamp indicating the exact date when the event occurred.
 
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 contact.

See Also:
Constant Field Values

SYSTEM_MESSAGE_RECEIVED

public static final int SYSTEM_MESSAGE_RECEIVED
An event type indicating that the message being received is a system message being sent by the server or a system administrator.

See Also:
Constant Field Values

SMS_MESSAGE_RECEIVED

public static final int SMS_MESSAGE_RECEIVED
an event type indicating that the message being received is an SMS message.

See Also:
Constant Field Values
Constructor Detail

MessageReceivedEvent

public MessageReceivedEvent(Message source,
                            Contact from,
                            long timestamp)
Creates a MessageReceivedEvent representing reception of the source message received from the specified from contact.

Parameters:
source - the Message whose reception this event represents.
from - the Contact that has sent this message.
timestamp - the exact date when the event ocurred.

MessageReceivedEvent

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

Parameters:
source - the Message whose reception this event represents.
from - the Contact that has sent this message.
timestamp - the exact date when the event occurred.
eventType - the type of message event that this instance represents (one of the XXX_MESSAGE_RECEIVED static fields).
Method Detail

getSourceContact

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

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

getSourceMessage

public Message getSourceMessage()
Returns the message that triggered this event

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.

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.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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