|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.Multipart
javax.mail.internet.MimeMultipart
com.nitido.nim.NotificationMessage
public class NotificationMessage
An object that contains all of the information about the message that the application wants to send. To set the content of the message the setPlainTextMessage() (for simple string messages) or add MimeBodyPart objects using addBodyPart() for other types of content (for example html and attachments)
Field Summary | |
---|---|
protected Entity |
_from
The sender of this message. |
protected java.util.List<Member> |
_members
|
protected java.lang.String |
_nonMember
|
protected java.lang.String |
_subject
|
Fields inherited from class javax.mail.internet.MimeMultipart |
---|
ds, parsed |
Fields inherited from class javax.mail.Multipart |
---|
contentType, parent, parts |
Constructor Summary | |
---|---|
NotificationMessage(Entity sender,
java.util.List<Member> recipients,
java.lang.String subject)
Construct a new message with a list of Member objects as recipients. |
|
NotificationMessage(Entity sender,
java.lang.String recipient,
java.lang.String subject)
Construct a new message with a single recipient. |
Method Summary | |
---|---|
void |
addBodyPart(javax.mail.BodyPart part)
Deprecated. |
void |
addBodyPart(javax.mail.BodyPart part,
int index)
Deprecated. |
void |
addNotificationBodyPart(NotificationBodyPart part)
This method is a recommended replacement for the generic addBodyPart(BodyPart part) method. |
void |
addNotificationBodyPart(NotificationBodyPart part,
int index)
This method is a recommended replacement for the generic addBodyPart(BodyPart part, int index) method. |
void |
addTextMessage(java.lang.String text,
java.lang.String charset,
java.lang.String subtype)
Add a text message as a body part of this object with the specified charset encoding and declared subtype. |
java.util.List<Member> |
getMemberRecipients()
|
Entity |
getSender()
|
java.lang.String |
getStringRecipient()
|
java.lang.String |
getSubject()
|
void |
removeAllBodyParts()
This method will remove all the existing body parts of the message. |
void |
setMemberRecipients(java.util.List<Member> members)
|
void |
setPlainTextMessage(java.lang.String text)
Set a plain text message as a body part to this object. |
void |
setSender(Entity sender)
|
void |
setStringRecipient(java.lang.String recipient)
|
void |
setSubject(java.lang.String subject)
|
void |
setTextMessage(java.lang.String text,
java.lang.String charset,
java.lang.String subtype)
Set a text message as a body part of this object with the specified charset encoding and declared subtype. |
Methods inherited from class javax.mail.internet.MimeMultipart |
---|
createInternetHeaders, createMimeBodyPart, createMimeBodyPart, getBodyPart, getBodyPart, getCount, getPreamble, isComplete, parse, removeBodyPart, removeBodyPart, setPreamble, setSubType, updateHeaders, writeTo |
Methods inherited from class javax.mail.Multipart |
---|
getContentType, getParent, setMultipartDataSource, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Entity _from
protected java.lang.String _nonMember
protected java.util.List<Member> _members
protected java.lang.String _subject
Constructor Detail |
---|
public NotificationMessage(Entity sender, java.util.List<Member> recipients, java.lang.String subject)
sender
- the sender of this messagerecipients
- the list of Member objects to whom this message is to
be sentsubject
- the message's subject (will be used if it supported by the
delivery channel)public NotificationMessage(Entity sender, java.lang.String recipient, java.lang.String subject)
sender
- the sender of this messagerecipient
- a single recipient properly encoded with the protocol
string (for example "mailto://") followed by the addresssubject
- the message's subject (will be used if it supported by the
delivery channel)Method Detail |
---|
public Entity getSender()
public void setSender(Entity sender)
public java.util.List<Member> getMemberRecipients()
public void setMemberRecipients(java.util.List<Member> members)
public java.lang.String getStringRecipient()
public void setStringRecipient(java.lang.String recipient)
public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
public void addBodyPart(javax.mail.BodyPart part) throws javax.mail.MessagingException
SPECIAL WARNING: The BodyPart object passed to this method must be extended from the NotificationBodyPart object. If you use the regular MimeBodyPart, you will LOST ALL CHARSET/ENCODING information. All email content will be sent as the ASCII encoding (or whatever encoding you defined in the JVM system property for mail.mime.charset or file.encoding).
We are keeping this method just for backward compatability
addBodyPart
in class javax.mail.internet.MimeMultipart
javax.mail.MessagingException
public void addBodyPart(javax.mail.BodyPart part, int index) throws javax.mail.MessagingException
SPECIAL WARNING: The BodyPart object passed to this method must be extended from the NotificationBodyPart object. If you use the regular MimeBodyPart, you will LOST ALL CHARSET/ENCODING information. All email content will be sent as the ASCII encoding (or whatever encoding you defined in the JVM system property for mail.mime.charset or file.encoding).
We are keeping this method just for backward compatability
addBodyPart
in class javax.mail.internet.MimeMultipart
javax.mail.MessagingException
public void addNotificationBodyPart(NotificationBodyPart part) throws javax.mail.MessagingException
It will append the specified body part to the end of the message.
part
- The new body part object
javax.mail.MessagingException
public void addNotificationBodyPart(NotificationBodyPart part, int index) throws javax.mail.MessagingException
It will insert the new body part to the specified index. All existing body part with an index greater or equal to the specified index is shifted upward to have an index one larger than its original value.
part
- The new body part objectindex
- The index to inser the new body part to. It must be larger or equal
to 0. It cannot be larger than the current count of the body parts
in this message.
javax.mail.MessagingException
public void setPlainTextMessage(java.lang.String text) throws javax.mail.MessagingException
The content type of this plain text message is "text/plain". It will utilizes the JavaMail's default encoding.
text
- the text that becomes the body of the message
javax.mail.MessagingException
public void setTextMessage(java.lang.String text, java.lang.String charset, java.lang.String subtype) throws javax.mail.MessagingException
The content type will be in the format of "text/<subtype>; charset=<charset>".
This mehtod takes the parameters in the order of text, charset, subtype (which is the same order as the MimeBodyPart.setText() method.
text
- the text that becomes the body of the messagecharset
- the character set for the text encoding (e.g. utf-8)subtype
- the subtype of the text's content type (e.g. "plain",
"html", "xhtml+xml", "wml").
javax.mail.MessagingException
public void removeAllBodyParts() throws javax.mail.MessagingException
javax.mail.MessagingException
public void addTextMessage(java.lang.String text, java.lang.String charset, java.lang.String subtype) throws javax.mail.MessagingException
The content type will be in the format of "text/<subtype>; charset=<charset>".
This mehtod takes the parameters in the order of text, charset, subtype (which is the same order as the MimeBodyPart.setText() method.
text
- the text that becomes the body of the messagecharset
- the character set for the text encoding (e.g. utf-8)subtype
- the subtype of the text's content type (e.g. "plain",
"html", "xhtml+xml", "wml").
javax.mail.MessagingException
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.