- java.lang.Object
- 
- java.util.EventObject
- 
- jakarta.mail.event.MailEvent
- 
- jakarta.mail.event.TransportEvent
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class TransportEvent extends MailEvent This class models Transport events.- Author:
- John Mani, Max Spivak
- See Also:
- Transport,- TransportListener, Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected Address[]invalidThe invalid addresses.static intMESSAGE_DELIVEREDMessage has been successfully delivered to all recipients by the transport firing this event.static intMESSAGE_NOT_DELIVEREDMessage was not sent for some reason.static intMESSAGE_PARTIALLY_DELIVEREDMessage was successfully sent to some recipients but not to all.protected MessagemsgThe Message to which this event applies.protected inttypeThe event type.protected Address[]validSentThe valid address to which the message was sent.protected Address[]validUnsentThe valid address to which the message was not sent.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(java.lang.Object listener)Invokes the appropriate TransportListener method.Address[]getInvalidAddresses()Return the addresses to which this message could not be sent.MessagegetMessage()Get the Message object associated with this Transport Event.intgetType()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.
 
- 
- 
- 
Field Detail- 
MESSAGE_DELIVEREDpublic 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,- See Also:
- Constant Field Values
 
 - 
MESSAGE_NOT_DELIVEREDpublic 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.- See Also:
- Constant Field Values
 
 - 
MESSAGE_PARTIALLY_DELIVEREDpublic 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.- See Also:
- Constant Field Values
 
 - 
typeprotected int type The event type.
 - 
validSentprotected transient Address[] validSent The valid address to which the message was sent.
 - 
validUnsentprotected transient Address[] validUnsent The valid address to which the message was not sent.
 - 
invalidprotected transient Address[] invalid The invalid addresses.
 - 
msgprotected transient Message msg The Message to which this event applies.
 
- 
 - 
Constructor Detail- 
TransportEventpublic TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg) Constructor.- Parameters:
- transport- The Transport object
- type- the event type (MESSAGE_DELIVERED, etc.)
- validSent- the valid addresses to which the message was sent
- validUnsent- the valid addresses to which the message was not sent
- invalid- the invalid addresses
- msg- the message being sent
 
 
- 
 - 
Method Detail- 
getTypepublic int getType() Return the type of this event.- Returns:
- type
 
 - 
getValidSentAddressespublic Address[] getValidSentAddresses() Return the addresses to which this message was sent succesfully.- Returns:
- Addresses to which the message was sent successfully or null
 
 - 
getValidUnsentAddressespublic Address[] 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
 
 - 
getInvalidAddressespublic Address[] getInvalidAddresses() Return the addresses to which this message could not be sent.- Returns:
- Addresses to which the message sending failed or null
 
 - 
getMessagepublic Message getMessage() Get the Message object associated with this Transport Event.- Returns:
- the Message object
 
 
- 
 
-