Package jakarta.mail.event
Class TransportEvent
java.lang.Object
java.util.EventObject
jakarta.mail.event.MailEvent
jakarta.mail.event.TransportEvent
- All Implemented Interfaces:
Serializable
This class models Transport events.
- Author:
- John Mani, Max Spivak
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Address[]
The invalid addresses.static final int
Message has been successfully delivered to all recipients by the transport firing this event.static final int
Message was not sent for some reason.static final int
Message was successfully sent to some recipients but not to all.protected Message
The Message to which this event applies.protected int
The event type.protected Address[]
The valid address to which the message was sent.protected Address[]
The valid address to which the message was not sent.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invokes the appropriate TransportListener method.Address[]
Return the addresses to which this message could not be sent.Get the Message object associated with this Transport Event.int
getType()
Return the type of this event.Address[]
Return the addresses to which this message was sent succesfully.Address[]
Return the addresses that are valid but to which this message was not sent.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
MESSAGE_DELIVERED
public static final int MESSAGE_DELIVEREDMessage 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,- See Also:
-
MESSAGE_NOT_DELIVERED
public static final int MESSAGE_NOT_DELIVEREDMessage 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.- See Also:
-
MESSAGE_PARTIALLY_DELIVERED
public static final int MESSAGE_PARTIALLY_DELIVEREDMessage 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.- See Also:
-
type
protected int typeThe event type. -
validSent
The valid address to which the message was sent. -
validUnsent
The valid address to which the message was not sent. -
invalid
The invalid addresses. -
msg
The Message to which this event applies.
-
-
Constructor Details
-
TransportEvent
public TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg) Constructor.- Parameters:
transport
- The Transport objecttype
- the event type (MESSAGE_DELIVERED, etc.)validSent
- the valid addresses to which the message was sentvalidUnsent
- the valid addresses to which the message was not sentinvalid
- the invalid addressesmsg
- the message being sent
-
-
Method Details
-
getType
public int getType()Return the type of this event.- Returns:
- type
-
getValidSentAddresses
Return the addresses to which this message was sent succesfully.- Returns:
- Addresses to which the message was sent successfully or null
-
getValidUnsentAddresses
Return the addresses that are valid but to which this message was not sent.- Returns:
- Addresses that are valid but to which the message was not sent successfully or null
-
getInvalidAddresses
Return the addresses to which this message could not be sent.- Returns:
- Addresses to which the message sending failed or null
-
getMessage
Get the Message object associated with this Transport Event.- Returns:
- the Message object
- Since:
- JavaMail 1.2
-
dispatch
Invokes the appropriate TransportListener method.
-