public class DBMimeMessage
extends javax.mail.internet.MimeMessage
implements javax.mail.internet.MimePart, javax.mail.Part
Modifier and Type | Field and Description |
---|---|
static short |
ClassId |
Constructor and Description |
---|
DBMimeMessage(javax.mail.Folder oFldr,
DBMimeMessage oMsg)
Create DBMimeMessage from another DBMimeMessage
GUID of this message is set to be the same as that of oMsg
|
DBMimeMessage(javax.mail.Folder oFldr,
java.io.InputStream oInStrm)
Create DBMimeMessage from an InputStream, set folder and assign a new GUID
|
DBMimeMessage(javax.mail.Folder oFldr,
javax.mail.internet.MimeMessage oMsg)
Create DBMimeMessage from a MimeMessage, set folder and assign a new GUID
|
DBMimeMessage(javax.mail.Folder oFldr,
java.lang.String sMsgGuid)
Create empty message at the given folder
|
DBMimeMessage(javax.mail.internet.MimeMessage oMsg)
Create DBMimeMessage from a MimeMessage and assign a new GUID
|
DBMimeMessage(javax.mail.Session oMailSession)
Create an empty message
|
DBMimeMessage(javax.mail.Session oMailSession,
java.io.InputStream oInStrm)
Create DBMimeMessage from an InputStream and assign a new GUID
|
Modifier and Type | Method and Description |
---|---|
com.sun.mail.smtp.SMTPMessage |
composeFinalMessage(javax.mail.Session oMailSession,
java.lang.String sSubject,
java.lang.String sBody,
java.lang.String sId,
java.lang.String sContentType)
Create an SMTPMessage object from given components using UTF-8 for text encoding
Depending on what is inside, message structure is as follows :
Format/AttachmentsNoYes plaintext/plainmultipart/mixed [text/plain, {attachment}] html without imagesmultipart/alternative [text/plain, text/html]multipart/mixed [multipart/alternative [text/plain, text/html], {attachment}] html with imagesmultipart/alternative [text/plain, multipart/related[text/html, {image}]]multipart/mixed [multipart/alternative [text/plain, multipart/related[text/html, {image}]], {attachment}] |
com.sun.mail.smtp.SMTPMessage |
composeFinalMessage(javax.mail.Session oMailSession,
java.lang.String sSubject,
java.lang.String sBody,
java.lang.String sId,
java.lang.String sContentType,
java.lang.String sEncoding)
Create an SMTPMessage object from given components
Depending on what is inside, message structure is as follows :
Format/AttachmentsNoYes plaintext/plainmultipart/mixed [text/plain, {attachment}] html without imagesmultipart/alternative [text/plain, text/html]multipart/mixed [multipart/alternative [text/plain, text/html], {attachment}] html with imagesmultipart/alternative [text/plain, multipart/related[text/html, {image}]]multipart/mixed [multipart/alternative [text/plain, multipart/related[text/html, {image}]], {attachment}] |
com.sun.mail.smtp.SMTPMessage |
composeFinalMessage(javax.mail.Session oMailSession,
java.lang.String sSubject,
java.lang.String sBody,
java.lang.String sId,
java.lang.String sContentType,
java.lang.String sEncoding,
boolean bAttachInlineImages)
Create an SMTPMessage object from given components
Depending on what is inside, message structure is as follows :
Format/AttachmentsNoYes plaintext/plainmultipart/mixed [text/plain, {attachment}] html without imagesmultipart/alternative [text/plain, text/html]multipart/mixed [multipart/alternative [text/plain, text/html], {attachment}] html with imagesmultipart/alternative [text/plain, multipart/related[text/html, {image}]]multipart/mixed [multipart/alternative [text/plain, multipart/related[text/html, {image}]], {attachment}] |
static void |
delete(JDCConnection oConn,
java.lang.String sFolderId,
java.lang.String sMimeMsgId)
Delete message from database
This method calls stored procedure k_sp_del_mime_msg
|
javax.mail.Address[] |
getAllRecipients()
Get message recipients
This method read recipients from a message stored at k_inet_addrs table
or if message is not already stored at k_inet_addrs then it delegates
behaviour to parent class MimMessage.getAllRecipients()
|
javax.mail.internet.MimePart |
getBody() |
javax.mail.Flags |
getFlags()
Get message flags
Message flags are readed from k_mime_msgs table at the database
|
javax.mail.Folder |
getFolder()
Get message folder
|
DBInetAddr |
getFromRecipient() |
static java.lang.String |
getGuidFromId(JDCConnection oConn,
java.lang.String sMsgId) |
javax.mail.internet.MimePart |
getMessageBody() |
java.lang.String |
getMessageContentType() |
java.lang.String |
getMessageGuid()
Get message GUID
If message had no previous GUID then a new one is assigned
|
javax.mail.Multipart |
getParts()
Get message parts as an array of DBMimePart objects
|
javax.mail.Address[] |
getRecipients(javax.mail.Message.RecipientType cTpRecipient)
Get recipients of a particular type
This method first calls getAllRecipients() and then filters retrieved recipients by their type.
|
java.util.Date |
getSentDate() |
java.lang.String |
getSubject() |
java.lang.String |
getText() |
void |
getText(java.lang.StringBuffer oBuffer)
Get message body text into a StringBuffer
|
void |
getTextPlain(java.lang.StringBuffer oBuffer) |
void |
saveChanges() |
void |
setFlag(javax.mail.Flags.Flag oFlg,
boolean bFlg) |
void |
setFolder(javax.mail.Folder oFldr)
Set message folder
|
void |
setMessageGuid(java.lang.String sId)
Set message GUID
|
static java.lang.String |
source(javax.mail.internet.MimeMessage oMsg,
java.lang.String sEncoding) |
java.lang.String |
tagBodyHtml() |
java.lang.String |
tagBodyPlain() |
void |
writeTo(java.io.OutputStream oOutStrm) |
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getReplyTo, getSender, getSize, isMimeType, isSet, removeHeader, reply, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, writeTo
addRecipient, getMessageNumber, isExpunged, match, setRecipient
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addHeaderLine, getAllHeaderLines, getContentID, getContentLanguage, getContentMD5, getEncoding, getHeader, getMatchingHeaderLines, getNonMatchingHeaderLines, setContentLanguage, setContentMD5, setText, setText, setText
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader
public static final short ClassId
public DBMimeMessage(javax.mail.Session oMailSession)
oMailSession
- public DBMimeMessage(javax.mail.internet.MimeMessage oMsg) throws javax.mail.MessagingException
oMsg
- MimeMessagejavax.mail.MessagingException
public DBMimeMessage(javax.mail.Session oMailSession, java.io.InputStream oInStrm) throws javax.mail.MessagingException
oMailSession
- SessionoInStrm
- InputStreamjavax.mail.MessagingException
public DBMimeMessage(javax.mail.Folder oFldr, java.io.InputStream oInStrm) throws javax.mail.MessagingException, java.lang.ClassCastException
Folder
- oFldroInStrm
- InputStreamjavax.mail.MessagingException
java.lang.ClassCastException
public DBMimeMessage(javax.mail.Folder oFldr, javax.mail.internet.MimeMessage oMsg) throws javax.mail.MessagingException
oFldr
- FolderMimeMessage
- oMsgjavax.mail.MessagingException
public DBMimeMessage(javax.mail.Folder oFldr, DBMimeMessage oMsg) throws javax.mail.MessagingException
Create DBMimeMessage from another DBMimeMessage
GUID of this message is set to be the same as that of oMsgoFldr
- FolderMimeMessage
- oMsgjavax.mail.MessagingException
public DBMimeMessage(javax.mail.Folder oFldr, java.lang.String sMsgGuid) throws javax.mail.MessagingException
oFldr
- FoldersMsgGuid
- String Message GUIDjavax.mail.MessagingException
public javax.mail.Folder getFolder()
getFolder
in class javax.mail.Message
public void setFolder(javax.mail.Folder oFldr)
oFldr
- Folderpublic java.lang.String getMessageGuid()
Get message GUID
If message had no previous GUID then a new one is assignedpublic void setMessageGuid(java.lang.String sId)
sId
- Stringpublic javax.mail.Flags getFlags() throws javax.mail.MessagingException
Get message flags
Message flags are readed from k_mime_msgs table at the databasegetFlags
in class javax.mail.internet.MimeMessage
javax.mail.MessagingException
public javax.mail.Address[] getAllRecipients() throws javax.mail.MessagingException, java.lang.NullPointerException, java.lang.IllegalArgumentException
Get message recipients
This method read recipients from a message stored at k_inet_addrs table or if message is not already stored at k_inet_addrs then it delegates behaviour to parent class MimMessage.getAllRecipients()getAllRecipients
in class javax.mail.internet.MimeMessage
java.sql.SQLException
javax.mail.MessagingException
java.lang.NullPointerException
java.lang.IllegalArgumentException
public javax.mail.Address[] getRecipients(javax.mail.Message.RecipientType cTpRecipient) throws javax.mail.MessagingException
Get recipients of a particular type
This method first calls getAllRecipients() and then filters retrieved recipients by their type.getRecipients
in class javax.mail.internet.MimeMessage
cTpRecipient
- javax.mail.Message.RecipientTypejavax.mail.MessagingException
public DBInetAddr getFromRecipient() throws javax.mail.MessagingException
javax.mail.MessagingException
public java.lang.String getMessageContentType() throws javax.mail.MessagingException
javax.mail.MessagingException
public java.util.Date getSentDate() throws javax.mail.MessagingException
getSentDate
in class javax.mail.internet.MimeMessage
javax.mail.MessagingException
public java.lang.String getSubject() throws javax.mail.MessagingException
getSubject
in class javax.mail.internet.MimeMessage
javax.mail.MessagingException
public javax.mail.internet.MimePart getMessageBody() throws javax.mail.internet.ParseException, javax.mail.MessagingException, java.io.IOException
javax.mail.internet.ParseException
javax.mail.MessagingException
java.io.IOException
public void setFlag(javax.mail.Flags.Flag oFlg, boolean bFlg) throws javax.mail.MessagingException
setFlag
in class javax.mail.Message
javax.mail.MessagingException
public void saveChanges() throws javax.mail.MessagingException
saveChanges
in class javax.mail.internet.MimeMessage
javax.mail.MessagingException
public javax.mail.Multipart getParts() throws javax.mail.MessagingException, java.io.IOException, java.lang.NullPointerException
javax.mail.MessagingException
java.io.IOException
java.lang.NullPointerException
- If this message Folder is nullpublic javax.mail.internet.MimePart getBody() throws javax.mail.internet.ParseException, javax.mail.MessagingException, java.io.IOException
javax.mail.internet.ParseException
javax.mail.MessagingException
java.io.IOException
public void getText(java.lang.StringBuffer oBuffer) throws javax.mail.MessagingException, java.io.IOException, java.lang.ClassCastException
oBuffer
- StringBufferjavax.mail.MessagingException
java.io.IOException
java.lang.ClassCastException
public java.lang.String getText() throws javax.mail.MessagingException, java.io.IOException
javax.mail.MessagingException
java.io.IOException
public void getTextPlain(java.lang.StringBuffer oBuffer) throws javax.mail.MessagingException, java.io.IOException
javax.mail.MessagingException
java.io.IOException
public void writeTo(java.io.OutputStream oOutStrm) throws java.io.IOException, javax.mail.FolderClosedException, javax.mail.MessagingException
writeTo
in interface javax.mail.Part
writeTo
in class javax.mail.internet.MimeMessage
java.io.IOException
javax.mail.FolderClosedException
javax.mail.MessagingException
public java.lang.String tagBodyHtml() throws java.io.IOException, javax.mail.MessagingException
java.io.IOException
javax.mail.MessagingException
public java.lang.String tagBodyPlain() throws java.io.IOException, javax.mail.MessagingException
java.io.IOException
javax.mail.MessagingException
public com.sun.mail.smtp.SMTPMessage composeFinalMessage(javax.mail.Session oMailSession, java.lang.String sSubject, java.lang.String sBody, java.lang.String sId, java.lang.String sContentType, java.lang.String sEncoding, boolean bAttachInlineImages) throws java.io.IOException, javax.mail.MessagingException, java.lang.IllegalArgumentException, java.lang.ArrayIndexOutOfBoundsException, java.lang.SecurityException
Create an SMTPMessage object from given components
Depending on what is inside, message structure is as follows :Format/Attachments | No | Yes |
plain | text/plain | multipart/mixed [text/plain, {attachment}] |
html without images | multipart/alternative [text/plain, text/html] | multipart/mixed [multipart/alternative [text/plain, text/html], {attachment}] |
html with images | multipart/alternative [text/plain, multipart/related[text/html, {image}]] | multipart/mixed [multipart/alternative [text/plain, multipart/related[text/html, {image}]], {attachment}] |
oMailSession
- SessionsSubject
- String Message subject or nullsBody
- String Message text body or nullsId
- String Contend-ID for message or nullsContentType
- String should be either "plain" or "html"sEncoding
- Character encoding for textjava.io.IOException
javax.mail.MessagingException
java.lang.SecurityException
java.lang.ArrayIndexOutOfBoundsException
java.lang.IllegalArgumentException
- if sContentType is not "plain" or "html"public com.sun.mail.smtp.SMTPMessage composeFinalMessage(javax.mail.Session oMailSession, java.lang.String sSubject, java.lang.String sBody, java.lang.String sId, java.lang.String sContentType, java.lang.String sEncoding) throws java.io.IOException, javax.mail.MessagingException, java.lang.IllegalArgumentException, java.lang.SecurityException
Create an SMTPMessage object from given components
Depending on what is inside, message structure is as follows :Format/Attachments | No | Yes |
plain | text/plain | multipart/mixed [text/plain, {attachment}] |
html without images | multipart/alternative [text/plain, text/html] | multipart/mixed [multipart/alternative [text/plain, text/html], {attachment}] |
html with images | multipart/alternative [text/plain, multipart/related[text/html, {image}]] | multipart/mixed [multipart/alternative [text/plain, multipart/related[text/html, {image}]], {attachment}] |
oMailSession
- SessionsSubject
- String Message subject or nullsBody
- String Message text body or nullsId
- String Contend-ID for message or nullsContentType
- String should be either "plain" or "html"sEncoding
- Character encoding for textjava.io.IOException
javax.mail.MessagingException
java.lang.SecurityException
java.lang.IllegalArgumentException
- if sContentType is not "plain" or "html"public com.sun.mail.smtp.SMTPMessage composeFinalMessage(javax.mail.Session oMailSession, java.lang.String sSubject, java.lang.String sBody, java.lang.String sId, java.lang.String sContentType) throws java.io.IOException, javax.mail.MessagingException, java.lang.IllegalArgumentException, java.lang.SecurityException
Create an SMTPMessage object from given components using UTF-8 for text encoding
Depending on what is inside, message structure is as follows :Format/Attachments | No | Yes |
plain | text/plain | multipart/mixed [text/plain, {attachment}] |
html without images | multipart/alternative [text/plain, text/html] | multipart/mixed [multipart/alternative [text/plain, text/html], {attachment}] |
html with images | multipart/alternative [text/plain, multipart/related[text/html, {image}]] | multipart/mixed [multipart/alternative [text/plain, multipart/related[text/html, {image}]], {attachment}] |
oMailSession
- SessionsSubject
- String Message subject or nullsBody
- String Message text body or nullsId
- String Contend-ID for message or nullsContentType
- String should be either "plain" or "html"java.io.IOException
javax.mail.MessagingException
java.lang.SecurityException
java.lang.IllegalArgumentException
- if sContentType is not "plain" or "html"public static void delete(JDCConnection oConn, java.lang.String sFolderId, java.lang.String sMimeMsgId) throws java.sql.SQLException, java.io.IOException
Delete message from database
This method calls stored procedure k_sp_del_mime_msgoConn
- JDBC database connectionsFolderId
- Folder GUID (k_mime_msgs.gu_category)sMimeMsgId
- Message GUID (k_mime_msgs.gu_mimemsg)java.sql.SQLException
java.io.IOException
public static java.lang.String source(javax.mail.internet.MimeMessage oMsg, java.lang.String sEncoding) throws javax.mail.MessagingException, java.io.UnsupportedEncodingException, java.io.IOException
javax.mail.MessagingException
java.io.UnsupportedEncodingException
java.io.IOException
public static java.lang.String getGuidFromId(JDCConnection oConn, java.lang.String sMsgId) throws java.sql.SQLException
java.sql.SQLException