Top Description Fields Constructors Methods
javax.mail.event

public Class TransportEvent

extends MailEvent
Class Inheritance
Imports
java.util.*, javax.mail.*

This class models Transport events.
Authors
John Mani, Max Spivak
See Also
javax.mail.Transport, javax.mail.event.TransportListener

Field Summary

Modifier and TypeField and Description
protected transient Address[]
invalid

The invalid addresses.

public static final int
MESSAGE_DELIVERED

Message has been successfully delivered to all recipients by the transport firing this event.

public static final int
MESSAGE_NOT_DELIVERED

Message was not sent for some reason.

public static final int
MESSAGE_PARTIALLY_DELIVERED

Message was successfully sent to some recipients but not to all.

protected transient Message
msg

The Message to which this event applies.

private static final long
protected int
type

The event type.

protected transient Address[]
validSent

The valid address to which the message was sent.

protected transient Address[]
validUnsent

The valid address to which the message was not sent.

Constructor Summary

AccessConstructor and Description
public
TransportEvent(Transport
The Transport object
transport
,
int
the event type (MESSAGE_DELIVERED, etc.)
type
,
Address[]
the valid addresses to which the message was sent
validSent
,
Address[]
the valid addresses to which the message was not sent
validUnsent
,
Address[]
the invalid addresses
invalid
,
Message
the message being sent
msg
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
dispatch(Object
the listener to invoke on
listener
)

Implements abstract javax.mail.event.MailEvent.dispatch.

Invokes the appropriate TransportListener method.
public Address[]

Returns:

Addresses to which the message sending failed or null
getInvalidAddresses
()

Return the addresses to which this message could not be sent.

public Message

Returns:

the Message object
getMessage
()

Get the Message object associated with this Transport Event.

public int

Returns:

type
getType
()

Return the type of this event.

public Address[]

Returns:

Addresses to which the message was sent successfully or null
getValidSentAddresses
()

Return the addresses to which this message was sent succesfully.

public Address[]

Returns:

Addresses that are valid but to which the message was not sent successfully or null
getValidUnsentAddresses
()

Return the addresses that are valid but to which this message was not sent.

Field Detail

invalidback to summary
protected transient Address[] invalid

The invalid addresses.

MESSAGE_DELIVEREDback to summary
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,

MESSAGE_NOT_DELIVEREDback to summary
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.

MESSAGE_PARTIALLY_DELIVEREDback to summary
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.

msgback to summary
protected transient Message msg

The Message to which this event applies.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.mail.event.MailEvent.serialVersionUID.

typeback to summary
protected int type

The event type.

validSentback to summary
protected transient Address[] validSent

The valid address to which the message was sent.

validUnsentback to summary
protected transient Address[] validUnsent

The valid address to which the message was not sent.

Constructor Detail

TransportEventback to summary
public TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)

Constructor.

Parameters
transport:Transport

The Transport object

type:int

the event type (MESSAGE_DELIVERED, etc.)

validSent:Address[]

the valid addresses to which the message was sent

validUnsent:Address[]

the valid addresses to which the message was not sent

invalid:Address[]

the invalid addresses

msg:Message

the message being sent

Method Detail

dispatchback to summary
public void dispatch(Object listener)

Implements abstract javax.mail.event.MailEvent.dispatch.

Invokes the appropriate TransportListener method.

Parameters
listener:Object

Doc from javax.mail.event.MailEvent.dispatch.

the listener to invoke on

Annotations
@Override
getInvalidAddressesback to summary
public Address[] getInvalidAddresses()

Return the addresses to which this message could not be sent.

Returns:Address[]

Addresses to which the message sending failed or null

getMessageback to summary
public Message getMessage()

Get the Message object associated with this Transport Event.

Returns:Message

the Message object

Since
JavaMail 1.2
getTypeback to summary
public int getType()

Return the type of this event.

Returns:int

type

getValidSentAddressesback to summary
public Address[] getValidSentAddresses()

Return the addresses to which this message was sent succesfully.

Returns:Address[]

Addresses to which the message was sent successfully or null

getValidUnsentAddressesback to summary
public Address[] getValidUnsentAddresses()

Return the addresses that are valid but to which this message was not sent.

Returns:Address[]

Addresses that are valid but to which the message was not sent successfully or null