javax.mail.event

Class TransportEvent


public class TransportEvent
extends MailEvent

This class models Transport events.

Field Summary

static int
MESSAGE_DELIVERED
Message has been successfully delivered to all recipients by the transport firing this event.
static int
MESSAGE_NOT_DELIVERED
Message was not sent for some reason.
static int
MESSAGE_PARTIALLY_DELIVERED
Message was successfully sent to some recipients but not to all.
protected Address[]
invalid
protected Message
msg
protected int
type
The event type.
protected Address[]
validSent
protected Address[]
validUnsent

Constructor Summary

TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)
Constructor.

Method Summary

void
dispatch(Object listener)
Invokes the appropriate TransportListener method.
Address[]
getInvalidAddresses()
Return the addresses to which this message could not be sent.
Message
getMessage()
Get the Message object associated with this Transport Event.
int
getType()
Return the type of this event.
Address[]
getValidSentAddresses()
Return the addresses to which this message was sent succesfully.
Address[]
getValidUnsentAddresses()
Return the addresses that are valid but to which this message was not sent.

Methods inherited from class javax.mail.event.MailEvent

dispatch

Field Details

MESSAGE_DELIVERED

public static final int MESSAGE_DELIVERED
Message has been successfully delivered to all recipients by the transport firing this event. validSent[] contains all the addresses this transport sent to successfully. validUnsent[] and invalid[] should be null.

Field Value:
1


MESSAGE_NOT_DELIVERED

public static final int MESSAGE_NOT_DELIVERED
Message was not sent for some reason. validSent[] should be null. validUnsent[] may have addresses that are valid(but the message wasn't sent to them). invalid[] should likely contain invalid addresses.

Field Value:
2


MESSAGE_PARTIALLY_DELIVERED

public static final int MESSAGE_PARTIALLY_DELIVERED
Message was successfully sent to some recipients but not to all. validSent[] holds addresses of recipients to whom the message was sent. validUnsent[] holds valid addresses to which the message was not sent. invalid[] holds invalid addresses, if any.

Field Value:
3


invalid

protected Address[] invalid


msg

protected Message msg


type

protected int type
The event type.


validSent

protected Address[] validSent


validUnsent

protected Address[] validUnsent

Constructor Details

TransportEvent

public TransportEvent(Transport transport,
                      int type,
                      Address[] validSent,
                      Address[] validUnsent,
                      Address[] invalid,
                      Message msg)
Constructor.

Parameters:

Method Details

dispatch

public void dispatch(Object listener)
Invokes the appropriate TransportListener method.
Overrides:
dispatch in interface MailEvent


getInvalidAddresses

public Address[] getInvalidAddresses()
Return the addresses to which this message could not be sent.


getMessage

public Message getMessage()
Get the Message object associated with this Transport Event.


getType

public int getType()
Return the type of this event.


getValidSentAddresses

public Address[] getValidSentAddresses()
Return the addresses to which this message was sent succesfully.


getValidUnsentAddresses

public Address[] getValidUnsentAddresses()
Return the addresses that are valid but to which this message was not sent.