FileDocCategorySizeDatePackage
TransportEvent.javaAPI DocJavaMail 1.4.35438Tue Nov 17 10:38:12 GMT 2009javax.mail.event

TransportEvent

public class TransportEvent extends MailEvent
This class models Transport events.
author
John Mani
author
Max Spivak
see
javax.mail.Transport
see
javax.mail.event.TransportListener

Fields 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,
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.
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.
protected int
type
The event type.
protected transient Address[]
validSent
protected transient Address[]
validUnsent
protected transient Address[]
invalid
protected transient Message
msg
private static final long
serialVersionUID
Constructors Summary
public TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)
Constructor.

param
transport The Transport object


                
          
			     
			    
	super(transport);
	this.type = type;
	this.validSent = validSent;
	this.validUnsent = validUnsent;
	this.invalid = invalid;
	this.msg = msg;
    
Methods Summary
public voiddispatch(java.lang.Object listener)
Invokes the appropriate TransportListener method.

	if (type == MESSAGE_DELIVERED)	
	    ((TransportListener)listener).messageDelivered(this);
	else if (type == MESSAGE_NOT_DELIVERED)
	    ((TransportListener)listener).messageNotDelivered(this);
	else // MESSAGE_PARTIALLY_DELIVERED
	    ((TransportListener)listener).messagePartiallyDelivered(this);
    
public javax.mail.Address[]getInvalidAddresses()
Return the addresses to which this message could not be sent.

return
Addresses to which the message sending failed or null

	return invalid;
    
public MessagegetMessage()
Get the Message object associated with this Transport Event.

return
the Message object
since
JavaMail 1.2

        return msg;
    
public intgetType()
Return the type of this event.

return
type

	return type;
    
public javax.mail.Address[]getValidSentAddresses()
Return the addresses to which this message was sent succesfully.

return
Addresses to which the message was sent successfully or null

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

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

	return validUnsent;