|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.adk.mail.IfsMessage
An IfsMessage represents an iFS e-mail message.
This is part of the ADK to provide an easy to use API for iFS e-mail. The purpose of this class is to provide a mean to construct an iFS e-mail message programmatically.
Field Summary | |
static java.lang.String |
ASCII_CHARSET
The default character set that uses only 7-bit characters. |
static java.lang.String |
LATIN1_CHARSET
The widely-used character set that is the superset of the ASCII character set. |
Constructor Summary | |
IfsMessage(LibrarySession session)
Constructor. |
|
IfsMessage(LibrarySession session,
FolderPathResolver resolver,
Folder outbox,
DirectoryUser sender)
Constructor. |
Method Summary | |
void |
attach(Document doc)
Attach a document. |
void |
attach(Document[] doc)
Attach an array of documents. |
void |
attach(java.lang.String path)
Attach a document. |
void |
attach(java.lang.String[] path)
Attach an array of documents. |
oracle.ifs.protocols.email.beans.Message |
createMessage(boolean create)
Gets the internal representation of the message. |
void |
send()
Sends out the email message. |
static void |
sendMessage(LibrarySession session,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.io.InputStream body)
Send a message. |
static void |
sendMessage(LibrarySession session,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.io.InputStream body,
Document[] attachments)
Send a message. |
static void |
sendMessage(LibrarySession session,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.io.Reader body)
Send a message. |
static void |
sendMessage(LibrarySession session,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.io.Reader body,
Document[] attachments)
Send a message. |
static void |
sendMessage(LibrarySession session,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.lang.String body)
Send a message. |
static void |
sendMessage(LibrarySession session,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.lang.String body,
Document[] attachments)
Send a message. |
void |
setAlternativeBodies(oracle.ifs.adk.mail.IfsMessage.MimeBodyPart[] body)
Sets the body of the message with a multipart alternative body. |
void |
setBccHeader(java.lang.String bcc)
Sets the Bcc header of the message. |
void |
setBccHeader(java.lang.String[] bcc)
Sets the Bcc header of the message. |
void |
setBody(Document doc)
Sets the body of the message. |
void |
setBody(java.io.InputStream in)
Sets the body of the message. |
void |
setBody(java.io.InputStream in,
java.lang.String contentType)
Sets the body of the message and the content type of the body. |
void |
setBody(java.io.InputStream in,
java.lang.String contentType,
java.lang.String charset)
Sets the body of the message, and the content type and the character set of the body. |
void |
setBody(java.io.Reader in)
Sets the body of the message. |
void |
setBody(java.io.Reader in,
java.lang.String contentType)
Sets the body of the message and the content type of the body. |
void |
setBody(java.io.Reader in,
java.lang.String contentType,
java.lang.String charset)
Sets the body of the message, and the content type and the character set of the body. |
void |
setBody(java.lang.String body)
Sets the body of the message. |
void |
setBody(java.lang.String body,
java.lang.String contentType)
Sets the body of the message and the content type of the body. |
void |
setBody(java.lang.String body,
java.lang.String contentType,
java.lang.String charset)
Sets the body of the message, and the content type and the character set of the body. |
void |
setCcHeader(java.lang.String cc)
Sets the Cc header of the message. |
void |
setCcHeader(java.lang.String[] cc)
Sets the Cc header of the message. |
void |
setCharset(java.lang.String charset)
Sets the character set of the message body of a single body message. |
void |
setContentType(java.lang.String contentType)
Sets the content type of the message body of a single body message. |
void |
setFromHeader(DirectoryUser sender)
Sets the From header of the message. |
void |
setFromHeader(java.lang.String from)
Sets the From header of the message. |
void |
setFromHeader(java.lang.String[] from)
Sets the From header of the message. |
void |
setInReplyToHeader(oracle.ifs.protocols.email.beans.Message msg)
Sets the In-Reply-To header of the message. |
void |
setMixedBodies(oracle.ifs.adk.mail.IfsMessage.MimeBodyPart[] body)
Sets the body of the message with a multipart mixed body. |
void |
setReplyToHeader(java.lang.String replyTo)
Sets the Reply-To header of the message. |
void |
setReplyToHeader(java.lang.String[] replyTo)
Sets the Reply-To header of the message. |
void |
setSenderHeader(DirectoryUser sender)
Sets the sender of the message. |
void |
setSubject(java.lang.String subject)
Sets the subject of the message. |
void |
setToHeader(java.lang.String to)
Sets the To header of the message. |
void |
setToHeader(java.lang.String[] to)
Sets the To header of the message. |
Field Detail |
public static final java.lang.String ASCII_CHARSET
public static final java.lang.String LATIN1_CHARSET
Constructor Detail |
public IfsMessage(LibrarySession session) throws IfsException
session
- The LibrarySession
object. This argument
cannot be null.IfsException
- if operation failedLibrarySession
public IfsMessage(LibrarySession session, FolderPathResolver resolver, Folder outbox, DirectoryUser sender) throws IfsException
session
- The LibrarySession
object. This argument
cannot be null.resolver
- The FolderPathResolver
object. This
argument can be null.outbox
- The Mailbox
object representing the mailbox
for outbound email messages. This argument can be null.sender
- The DirectoryUser
object representing the
sender of the message. This argument can be null.IfsException
- if operation failedLibrarySession
,
Mailbox
Method Detail |
public void send() throws IfsException
The email message is not fully constructed until right before it is sent. Therefore it is possible for the application developer to modify the message object before this method is called. However, after the method is called, all subsequent send message will send out the constructed email message that does not accept any further modifications.
IfsException
- if operation failedpublic void setSenderHeader(DirectoryUser sender) throws IfsException
sender
- The DiretoryUser
object representing the
sender. The sender's email address will be used in
either the From header or the Sender header.IfsException
- if operation failedDirectoryUser
public void setFromHeader(DirectoryUser sender) throws IfsException
sender
- The DiretoryUser
object representing the
user with the email address for the From header.IfsException
- if operation failedDirectoryUser
public void setFromHeader(java.lang.String from)
from
- The String
with the email address of the user
for the From header.public void setFromHeader(java.lang.String[] from)
sender
- The array of String
with the email addresses
of the users for the From header.public void setToHeader(java.lang.String to)
to
- The String
with the email addresses
of the user for the To header.public void setToHeader(java.lang.String[] to)
sender
- The array of String
with the email addresses
of the users for the To header.public void setCcHeader(java.lang.String cc)
cc
- The String
with the email addresses
of the user for the Cc header.public void setCcHeader(java.lang.String[] cc)
cc
- The array of String
with the email addresses
of the users for the Cc header.public void setBccHeader(java.lang.String bcc)
bcc
- The String
with the email addresses of the user
for the bcc header.public void setBccHeader(java.lang.String[] bcc)
bcc
- The array of String
with the email addresses of
the users for the Bcc header.public void setReplyToHeader(java.lang.String replyTo)
replyTo
- The String
with the email address of the
user for the Reply-To header.public void setReplyToHeader(java.lang.String[] replyTo)
replyTo
- The array of String
with the email addresses
of the users for the Reply-To header.public void setInReplyToHeader(oracle.ifs.protocols.email.beans.Message msg) throws IfsException
msg
- The Message
object representing the email
message to which this particular message is replying.IfsException
- if operation failedMessage
public void setSubject(java.lang.String subject)
subject
- The String
that represents the subject of
the email message.public void setCharset(java.lang.String charset)
To set the character set of the body parts of a multipart body, each of the body part has to be set individually. If character set is not set, the default US-ASCII is assumed (rfc2045).
charset
- The String
that represents the character
set of the email message.public void setContentType(java.lang.String contentType)
To set the content type of the body parts of a multipart body, each of the body part has to be set individually. If content type is not set, the default text/plain is assumed (rfc2045).
contentType
- The String
that represents the content
set of the email message.public void setBody(java.lang.String body)
body
- The body in a String
object.public void setBody(java.io.Reader in)
body
- The body in a Reader
object.Reader
public void setBody(java.io.InputStream in)
body
- The body in an InputStream
object.InputStream
public void setBody(java.lang.String body, java.lang.String contentType)
body
- The body in a String
object.contentType
- The content type of the body.public void setBody(java.io.InputStream in, java.lang.String contentType)
in
- The body in an InputStream
object.contentType
- The content type of the body.InputStream
public void setBody(java.io.Reader in, java.lang.String contentType)
in
- The body in a Reader
object.contentType
- The content type of the body.Reader
public void setBody(java.lang.String body, java.lang.String contentType, java.lang.String charset)
in
- The body in a String
object.contentType
- The content type of the body.charset
- The character set of the body.public void setBody(java.io.InputStream in, java.lang.String contentType, java.lang.String charset)
in
- The body in a InputStream
object.contentType
- The content type of the body.charset
- The character set of the body.InputStream
public void setBody(java.io.Reader in, java.lang.String contentType, java.lang.String charset)
in
- The body in a Reader
object.contentType
- The content type of the body.charset
- The character set of the body.Reader
public void setBody(Document doc) throws IfsException
doc
- The Document
to be used as the body.IfsException
- if operation failedDocument
public void setAlternativeBodies(oracle.ifs.adk.mail.IfsMessage.MimeBodyPart[] body)
If only one element is in the parameter, then this method has the same
effect of useing setBody(MimeBodyPart body)
.
The content type of the message is always multipart/alternative if the
message does not have attachments. Otherwise, the message will be of
content type multipart/mixed with a nested multipart/alternative message.
A multipart/alternative body is a body of multiple body parts of the same
content but in different formats. A compatible client should choose the
most appropriate format to display the message to the user.
body
- The array of MimeBodyPart
objects representing
the alternative bodies.IfsMessage.MimeBodyPart
public void setMixedBodies(oracle.ifs.adk.mail.IfsMessage.MimeBodyPart[] body)
If only one element is in the parameter, then this method has the same
effect of useing setBody(MimeBodyPart body)
.
The multipart/mixed content type is the most general content type for any
multipart message or any message with attachments. The client is free to
choose the method to display the message. Generally, the different body
parts are treated as different part of the message (same as attachment).
body
- The array of MimeBodyPart
objects representing
the mixed bodies.IfsMessage.MimeBodyPart
public void attach(Document doc)
The content type of the message with attachments is always multipart/mixed.
doc
- The Document
to attach.Document
public void attach(java.lang.String path) throws IfsException
The content type of the message with attachments is always multipart/mixed.
path
- The path of the Document
to attach.IfsException
- thrown when the path is invalidDocument
public void attach(Document[] doc)
The content type of the message with attachments is always multipart/mixed.
doc
- The array of Document
objects to attach.Document
public void attach(java.lang.String[] path) throws IfsException
The content type of the message with attachments is always multipart/mixed.
path
- The array of paths pointing to the Document
objects to attach.IfsException
- thrown when one of the path is invalid.Document
public static void sendMessage(LibrarySession session, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body) throws IfsException
This is a convenience method for sending email.
The alternative way to send an email is to use the individual methods on
the IfsMessage
object.
session
- The LibrarySession
.to
- The email addressses to which the message is sent.cc
- The email addressses to which the message is copied.bcc
- The email addressses to which the message is
blind-copied.subject
- The subject of the email.body
- The email body as a String
.IfsException
- if operation failedLibrarySession
public static void sendMessage(LibrarySession session, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.io.InputStream body) throws IfsException
This is a convenience method for sending email.
The alternative way to send an email is to use the individual methods on
the IfsMessage
object.
session
- The LibrarySession
.to
- The email addressses to which the message is sent.cc
- The email addressses to which the message is copied.bcc
- The email addressses to which the message is
blind-copied.subject
- The subject of the email.body
- The email body as an InputStream
.IfsException
- if operation failedLibrarySession
public static void sendMessage(LibrarySession session, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.io.Reader body) throws IfsException
This is a convenience method for sending email.
The alternative way to send an email is to use the individual methods on
the IfsMessage
object.
session
- The LibrarySession
.to
- The email addressses to which the message is sent.cc
- The email addressses to which the message is copied.bcc
- The email addressses to which the message is
blind-copied.subject
- The subject of the email.body
- The email body as a Reader
.IfsException
- if operation failed.LibrarySession
public static void sendMessage(LibrarySession session, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, Document[] attachments) throws IfsException
This is a convenience method for sending email.
The alternative way to send an email is to use the individual methods on
the IfsMessage
object.
session
- The LibrarySession
.to
- The email addressses to which the message is sent.cc
- The email addressses to which the message is copied.bcc
- The email addressses to which the message is
blind-copied.subject
- The subject of the email.body
- The email body as a String
.attachments
- The email attachments in an array of
Document
.IfsException
- if operation failedIfsMessage
public static void sendMessage(LibrarySession session, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.io.InputStream body, Document[] attachments) throws IfsException
This is a convenience method for sending email.
The alternative way to send an email is to use the individual methods on
the IfsMessage
object.
session
- The LibrarySession
.to
- The email addressses to which the message is sent.cc
- The email addressses to which the message is copied.bcc
- The email addressses to which the message is
blind-copied.subject
- The subject of the email.body
- The email body as an InputStream
.attachments
- The email attachments in an array of
Document
.IfsException
- if operation failedIfsMessage
public static void sendMessage(LibrarySession session, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.io.Reader body, Document[] attachments) throws IfsException
This is a convenience method for sending email.
The alternative way to send an email is to use the individual methods on
the IfsMessage
object.
session
- The LibrarySession
.to
- The email addressses to which the message is sent.cc
- The email addressses to which the message is copied.bcc
- The email addressses to which the message is
blind-copied.subject
- The subject of the email.body
- The email body as a Reader
.attachments
- The email attachments in an array of
Document
.IfsException
- if operation failedIfsMessage
public oracle.ifs.protocols.email.beans.Message createMessage(boolean create) throws IfsException
This is basically a snapshot of the message object. This will return a copy of the Message object created with the current state. All subsequent changes to the IfsMessage object will not be reflected in the copy returned. When the IfsMessage is sent, a new Message object is created.
create
- Re-create the Message
object even if the
state has not been changed.Message
object.IfsException
- if operation failedMessage
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |