| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class MultipartReport extends MimeMultipart
A multipart/report message content, as defined in RFC 3462. A multipart/report content is a container for mail reports of any kind, and is most often used to return a delivery status report. This class only supports that most common usage.
A MultipartReport object is a special type of MimeMultipart object with a restricted set of body parts. A MultipartReport object contains:
Field Summary | |
---|---|
protected boolean |
constructed
|
Fields inherited from class javax.mail.internet.MimeMultipart |
---|
ds, parsed |
Fields inherited from class javax.mail.Multipart |
---|
contentType, parent, parts |
Constructor Summary | |
---|---|
Construct a multipart/report object with no content. |
|
Constructs a MultipartReport object and its bodyparts from the given DataSource. |
|
MultipartReport(String text, DeliveryStatus status) Construct a multipart/report object with the specified plain text and delivery status to be returned to the user. |
|
MultipartReport(String text, DeliveryStatus status, InternetHeaders hdr) Construct a multipart/report object with the specified plain text, delivery status, and headers from the original message to be returned to the user. |
|
MultipartReport(String text, DeliveryStatus status, MimeMessage msg) Construct a multipart/report object with the specified plain text, delivery status, and original message to be returned to the user. |
Method Summary | |
---|---|
void |
addBodyPart(BodyPart part) Adds a Part to the multipart. |
void |
addBodyPart(BodyPart part, int index) Adds a BodyPart at position index .
|
DeliveryStatus |
Get the delivery status associated with this multipart/report. |
MimeMessage |
Get the original message that is being returned along with this multipart/report. |
String |
getText() Get the plain text to be presented to the user, if there is any. |
MimeBodyPart |
Return the body part containing the message to be presented to the user, usually just a text/plain part. |
boolean |
removeBodyPart(BodyPart part) Remove the specified part from the multipart message. |
void |
removeBodyPart(int index) Remove the part at specified location (starting from 0). |
void |
setDeliveryStatus(DeliveryStatus status) Set the delivery status associated with this multipart/report. |
void |
Set the original message to be returned as part of the multipart/report. |
void |
setSubType(String subtype) Set the subtype. |
void |
Set the message to be presented to the user as just a text/plain part containing the specified text. |
void |
Set the body part containing the text to be presented to the user. |
Methods inherited from class javax.mail.internet.MimeMultipart |
---|
addBodyPart, addBodyPart, createInternetHeaders, createMimeBodyPart, createMimeBodyPart, getBodyPart, getBodyPart, getCount, getPreamble, isComplete, parse, removeBodyPart, removeBodyPart, setPreamble, setSubType, updateHeaders, writeTo |
Methods inherited from class javax.mail.Multipart |
---|
addBodyPart, addBodyPart, getBodyPart, getContentType, getCount, getParent, removeBodyPart, removeBodyPart, setMultipartDataSource, setParent, writeTo |
Field Detail |
---|
protected boolean constructed
Constructor Detail |
---|
public MultipartReport() throws MessagingException
MessagingException
public MultipartReport(DataSource ds) throws MessagingException
ds
- DataSource, can be a MultipartDataSourceMessagingException
public MultipartReport(String text, DeliveryStatus status) throws MessagingException
text
status
MessagingException
public MultipartReport(String text, DeliveryStatus status, InternetHeaders hdr) throws MessagingException
text
status
hdr
MessagingException
public MultipartReport(String text, DeliveryStatus status, MimeMessage msg) throws MessagingException
text
status
msg
MessagingException
Method Detail |
---|
public synchronized void addBodyPart(BodyPart part) throws MessagingException
addBodyPart
in class MimeMultipart
part
- The Part to be appendedMessagingException
- alwayspublic synchronized void addBodyPart(BodyPart part, int index) throws MessagingException
index
.
Not allowed on a multipart/report object.
addBodyPart
in class MimeMultipart
part
- The BodyPart to be insertedindex
- Location where to insert the partMessagingException
- alwayspublic synchronized DeliveryStatus getDeliveryStatus() throws MessagingException
MessagingException
public synchronized MimeMessage getReturnedMessage() throws MessagingException
MessagingException
public synchronized String getText() throws MessagingException
MessagingException
public synchronized MimeBodyPart getTextBodyPart() throws MessagingException
MessagingException
public boolean removeBodyPart(BodyPart part) throws MessagingException
removeBodyPart
in class MimeMultipart
part
- The part to removeMessagingException
- alwayspublic void removeBodyPart(int index) throws MessagingException
removeBodyPart
in class MimeMultipart
index
- Index of the part to removeMessagingException
- alwayspublic synchronized void setDeliveryStatus(DeliveryStatus status) throws MessagingException
status
MessagingException
public synchronized void setReturnedMessage(MimeMessage msg) throws MessagingException
msg
MessagingException
public synchronized void setSubType(String subtype) throws MessagingException
setSubType
in class MimeMultipart
subtype
- SubtypeMessagingException
- always; can't change subtypepublic synchronized void setText(String text) throws MessagingException
text
MessagingException
public synchronized void setTextBodyPart(MimeBodyPart mbp) throws MessagingException
mbp
MessagingException
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |