Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class MessageDeliveryFailedEvent
extends EventObject

MessageDeliveredEvents confirm successful delivery of an instant message.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
static int INTERNAL_ERROR
          Set when delivery fails for implementation specific reasons.
static int NETWORK_FAILURE
          Set when delivery fails due to a failure in network communications or a transport error.
static int OFFLINE_MESSAGES_NOT_SUPPORTED
          Set when delivery fails because we're trying to send a message to a contact that is currently offline and the server does not support offline messages.
static int PROVIDER_NOT_REGISTERED
          Set to indicate that delivery has failed because the provider was not registered.
static int UNKNOWN_ERROR
          Set when no other error code can describe the exception that occurred.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MessageDeliveryFailedEvent(Message source, Contact to, int errorCode)
          Constructor.
MessageDeliveryFailedEvent(Message source, Contact to, int errorCode, long timestamp)
          Creates a MessageDeliveryFailedEvent indicating failure of delivery of the source message to the specified to contact.
MessageDeliveryFailedEvent(Message source, Contact to, int errorCode, long timestamp, String reason)
          Creates a MessageDeliveryFailedEvent indicating failure of delivery of the source message to the specified to contact.
 
Method Summary
 Contact getDestinationContact()
          Returns a reference to the Contact that the source (failed) Message was sent to.
 int getErrorCode()
          Returns an error code descibing the reason for the failure of the message delivery.
 String getReason()
          Returns a human readable message indicating the reason for the failure or null if the reason is unknown.
 Message getSourceMessage()
          Returns the message that triggered this event
 long getTimestamp()
          A timestamp indicating the exact date when the event ocurred (in this case it is the moment when it was determined that message delivery has failed).
 
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

UNKNOWN_ERROR

public static final int UNKNOWN_ERROR
Set when no other error code can describe the exception that occurred.

See Also:
Constant Field Values

NETWORK_FAILURE

public static final int NETWORK_FAILURE
Set when delivery fails due to a failure in network communications or a transport error.

See Also:
Constant Field Values

PROVIDER_NOT_REGISTERED

public static final int PROVIDER_NOT_REGISTERED
Set to indicate that delivery has failed because the provider was not registered.

See Also:
Constant Field Values

INTERNAL_ERROR

public static final int INTERNAL_ERROR
Set when delivery fails for implementation specific reasons.

See Also:
Constant Field Values

OFFLINE_MESSAGES_NOT_SUPPORTED

public static final int OFFLINE_MESSAGES_NOT_SUPPORTED
Set when delivery fails because we're trying to send a message to a contact that is currently offline and the server does not support offline messages.

See Also:
Constant Field Values
Constructor Detail

MessageDeliveryFailedEvent

public MessageDeliveryFailedEvent(Message source,
                                  Contact to,
                                  int errorCode)
Constructor.

Parameters:
source - the message
to - the "to" contact
errorCode - error code

MessageDeliveryFailedEvent

public MessageDeliveryFailedEvent(Message source,
                                  Contact to,
                                  int errorCode,
                                  long timestamp)
Creates a MessageDeliveryFailedEvent indicating failure of delivery of the source message to the specified to contact.

Parameters:
source - the Message whose delivery this event represents.
to - the Contact that this message was sent to.
errorCode - an errorCode indicating the reason of the failure.
timestamp - the exacte Date when it was determined that delivery had failed.

MessageDeliveryFailedEvent

public MessageDeliveryFailedEvent(Message source,
                                  Contact to,
                                  int errorCode,
                                  long timestamp,
                                  String reason)
Creates a MessageDeliveryFailedEvent indicating failure of delivery of the source message to the specified to contact.

Parameters:
source - the Message whose delivery this event represents.
to - the Contact that this message was sent to.
errorCode - an errorCode indicating the reason of the failure.
timestamp - the exact timestamp when it was determined that delivery had failed.
reason - a human readable message indicating the reason for the failure or null if the reason is unknown.
Method Detail

getDestinationContact

public Contact getDestinationContact()
Returns a reference to the Contact that the source (failed) Message was sent to.

Returns:
a reference to the Contact that the source failed Message wwas sent to.

getSourceMessage

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

Returns:
the Message that triggered this event.

getErrorCode

public int getErrorCode()
Returns an error code descibing the reason for the failure of the message delivery.

Returns:
an error code descibing the reason for the failure of the message delivery.

getTimestamp

public long getTimestamp()
A timestamp indicating the exact date when the event ocurred (in this case it is the moment when it was determined that message delivery has failed).

Returns:
a long indicating when the event ocurred in the form of date timestamp.

getReason

public String getReason()
Returns a human readable message indicating the reason for the failure or null if the reason is unknown.

Returns:
a human readable message indicating the reason for the failure or null if the reason is unknown.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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