Oracle Collaboration Suite Discussions Java API Reference
10g (10.1.1)

Part No. B16232-01


oracle.discussions.sdk
Class TdMessage

java.lang.Object
  extended byjavax.mail.Message
      extended byjavax.mail.internet.MimeMessage
          extended byoracle.mail.sdk.esmail.OracleMessage
              extended byoracle.discussions.sdk.TdMessage

All Implemented Interfaces:
javax.mail.internet.MimePart, javax.mail.Part, oracle.discussions.sdk.impl.TdLocalizable
Direct Known Subclasses:
TdSearchResultMessage, TdThread

public class TdMessage
extends oracle.mail.sdk.esmail.OracleMessage
implements oracle.discussions.sdk.impl.TdLocalizable

TdMessage is a light-weight object representing a Message in a Board.

On the contrary of its super classes OracleMessage it can be loaded with few pre-fetched headers without havgin the whole message and message body parsed.
The value of those pre-fetched fields is supplied through the loadFetchedFields method.
If these fields have been loaded then the corresponding accessors will returned the pre-fetched value, otherwise the super class implementation will be called and therefore the whole message will be loaded.
If any modification is made to the message through a setter, then the whole message will be parse the super class getters will be used from that moment on.

Oracle discussions elements names have been changed in the webui compared to that of sdk portion. The existing names to the new names mapping is as shown.

Since:
OCS 10.1.1
See Also:
TdThread.java

Nested Class Summary

Nested classes inherited from class javax.mail.internet.MimeMessage
javax.mail.internet.MimeMessage.RecipientType

Field Summary

Fields inherited from class oracle.mail.sdk.esmail.OracleMessage
EMAIL_TYPE, FAX_MSG_TYPE, FAX_TYPE, NEWS_MSG_TYPE, NEWS_TYPE, TD_MSG_TYPE, TD_TYPE, VOICE_MSG_TYPE, VOICE_TYPE

Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE

Method Summary
TdThread clip()
Moves a message and all its replies and create a new thread.
void delete()
Deletes the current message and all its replies.
void erase()
Erases the current message.
java.util.List getAnnotations()
Returns all annotations of a message,in descending order of the time.
java.util.Iterator getAttachmentBodyParts()
Returns an Iterator of attachment body Parts.
javax.mail.Part getAttachmentById(java.lang.String id)
Returns a Part based on the attachment id
java.util.List getAttachments()
Returns a List of TdAttachment objects that are contained in this message.
TdBoard getBoard()
Returns the board this message belong to.
TdBoardSettings getBoardSettings()
Returns the settings of the current board lazily loading it if necessary.
java.lang.String getBodyPlainText()
Returns the String plain text format of the body.
java.lang.Object getBodyRichText()
Returns a part or a multipart for the message containing the rich text representation of this message.
java.lang.Object getContent()
Gets the body content of the current message.
javax.mail.Flags getFlags()
Returns flags of the current message.
javax.mail.Address[] getFrom()
Returns the From address of the message sender.
TdAnnotation getLastAnnotation()
Returns the lastest annotation on the message.
int getLevel()
Returns the level of this message thread tree
int getNumberOfReplies()
Returns the number of replies for this message.
int getOracleMessageId()
Returns the oracle specific message id corresponding to this message
long getOracleMessageUid()
Returns the oracle specific message uid corresponding to this message
int getOracleThreadId()
Returns the oracle specific thread id corresponding to this message
TdMessage getParent()
Returns the parent message of this message in the thread tree.
int getParentMessageId()
Returns the message id of the parent message of the current message.
TdMessagePermissions getPermissions()
Returns the permissions on this message for the currently connected user.
java.lang.String getRfc822MessageId()
Returns the value of the Message-ID header.
java.lang.String getRfc822References()
Returns the value of the References header.
java.util.Date getSentDate()
Returns the date on which the message is sent.
int getSize()
Returns the size of the message in bytes.
java.lang.String getSubject()
Returns the subject of the message.
TdThread getThread()
Returns the thread this message belong to.
java.lang.String getXPriority()
Returns the priority of the current message in the message tree.
boolean hasAttachments()
Returns true if the messsage has attachments
boolean isByModerator()
Returns a boolean value indicating if the message is posted by moderator.
boolean isDeleted()
Returns if the current message is deleted.
boolean isNew()
This is the result of "OR" on isNewSinceSessions and isNewSinceLastVisit.
boolean isNewSinceLastVisit()
Returns a boolean value indicating if the message is new since user's last visit
boolean isNewSinceSession()
Returns a boolean value indicating if the message is new since user session startup.
void setFlag(javax.mail.Flags.Flag flag, boolean set)
Sets a flag of the message to the value passed.
void setFlags(javax.mail.Flags flag, boolean set)
Sets the message flags to the flags object passed as a parameter.
java.lang.String toString()
Converts the message into its corresponding string representation.
java.lang.String toString(java.util.Locale loc)
Converts the message into a locale specific string
void undelete()
Undeletes the current message.

Methods inherited from class oracle.mail.sdk.esmail.OracleMessage
_parseValue, addFrom, addHeader, addRecipients, clear, deleteMessageComment, deleteMessageComments, getAllHeaders, getAllMessageComments, getAuthInfo, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFilteredText, getFolder, getHeader, getHighlight, getLineCount, getMarkupText, getMatchingHeaders, getMessageComment, getNonMatchingHeaders, getReceivedDate, getRecipients, getReplyTo, getThemes, getTokens, getType, getUid, isSet, isSet, removeHeader, saveChanges, setCharset, setHeader, setMessageComment, setMessageComments, setQuickOpen, writeTo

Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addHeaderLine, addRecipients, getAllHeaderLines, getAllRecipients, getHeader, getInputStream, getMatchingHeaderLines, getMessageID, getNonMatchingHeaderLines, getRawInputStream, getSender, isMimeType, reply, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, writeTo

Methods inherited from class javax.mail.Message
addRecipient, getMessageNumber, isExpunged, match, setRecipient

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

getRfc822MessageId

public java.lang.String getRfc822MessageId()
                                    throws javax.mail.MessagingException
Returns the value of the Message-ID header.
Returns:
String the message header
Throws:
javax.mail.MessagingException

getRfc822References

public java.lang.String getRfc822References()
                                     throws javax.mail.MessagingException
Returns the value of the References header.
Returns:
String the references header
Throws:
javax.mail.MessagingException

getFrom

public javax.mail.Address[] getFrom()
                             throws javax.mail.MessagingException
Returns the From address of the message sender.
Returns:
Adress[] an array of the InternetAddresses.
Throws:
javax.mail.MessagingException

getSubject

public java.lang.String getSubject()
                            throws javax.mail.MessagingException
Returns the subject of the message.
Returns:
String the subject of the message
Throws:
javax.mail.MessagingException

getSentDate

public java.util.Date getSentDate()
                           throws javax.mail.MessagingException
Returns the date on which the message is sent.
Returns:
Date the date on which message is sent.
Throws:
javax.mail.MessagingException

getSize

public int getSize()
            throws javax.mail.MessagingException
Returns the size of the message in bytes.
Specified by:
getSize in interface javax.mail.Part
Returns:
integer representing the size of message in bytes.
Throws:
javax.mail.MessagingException

hasAttachments

public boolean hasAttachments()
                       throws TdException,
                              javax.mail.MessagingException
Returns true if the messsage has attachments
Returns:
boolean value indicating if the message has attachments
Throws:
TdException
javax.mail.MessagingException

getFlags

public javax.mail.Flags getFlags()
                          throws javax.mail.MessagingException
Returns flags of the current message.
Returns:
Flags message flags
Throws:
javax.mail.MessagingException

getParent

public TdMessage getParent()
                    throws javax.mail.MessagingException,
                           TdException
Returns the parent message of this message in the thread tree. If it is the first message (thread), null will be returned.
Returns:
the parent of this message
Throws:
javax.mail.MessagingException
TdException

getContent

public java.lang.Object getContent()
                            throws javax.mail.MessagingException,
                                   java.io.IOException
Gets the body content of the current message.
Specified by:
getContent in interface javax.mail.Part
Returns:
Object the content of the message.
Throws:
javax.mail.MessagingException
java.io.IOException

getXPriority

public java.lang.String getXPriority()
                              throws javax.mail.MessagingException
Returns the priority of the current message in the message tree.
Returns:
String string representing teh priority of the message.
Throws:
javax.mail.MessagingException

getLevel

public int getLevel()
Returns the level of this message thread tree
Returns:
int integer representing the level of this message in the message tree.

getOracleThreadId

public int getOracleThreadId()
Returns the oracle specific thread id corresponding to this message
Returns:
int integer representing the oracle specific thread id

getOracleMessageId

public int getOracleMessageId()
Returns the oracle specific message id corresponding to this message
Returns:
int integer representing the oracle specific message id

getOracleMessageUid

public long getOracleMessageUid()
Returns the oracle specific message uid corresponding to this message
Returns:
long long representing the oracle specific message uid

getParentMessageId

public int getParentMessageId()
Returns the message id of the parent message of the current message.
Returns:
int integer representing the parent message id.

getBodyRichText

public java.lang.Object getBodyRichText()
                                 throws TdException,
                                        javax.mail.MessagingException
Returns a part or a multipart for the message containing the rich text representation of this message.
Returns:
Object the rich text representation of the message body
Throws:
TdException
javax.mail.MessagingException

getBodyPlainText

public java.lang.String getBodyPlainText()
                                  throws TdException,
                                         javax.mail.MessagingException
Returns the String plain text format of the body.
Returns:
String string indicating the plain text of the message body
Throws:
TdException
javax.mail.MessagingException

getAttachmentById

public javax.mail.Part getAttachmentById(java.lang.String id)
                                  throws TdException,
                                         javax.mail.MessagingException
Returns a Part based on the attachment id
Parameters:
id - the attachment id
Throws:
TdException
javax.mail.MessagingException

getAttachmentBodyParts

public java.util.Iterator getAttachmentBodyParts()
                                          throws TdException,
                                                 javax.mail.MessagingException
Returns an Iterator of attachment body Parts. Each part is an attachment in the message
Returns:
Iterator iterator of attachments
Throws:
TdException
javax.mail.MessagingException

getAttachments

public java.util.List getAttachments()
                              throws TdException,
                                     javax.mail.MessagingException
Returns a List of TdAttachment objects that are contained in this message.
Returns:
list the list of attachments.
Throws:
TdException
javax.mail.MessagingException

setFlag

public void setFlag(javax.mail.Flags.Flag flag,
                    boolean set)
             throws javax.mail.MessagingException
Sets a flag of the message to the value passed.
Parameters:
flag - the flag value which is to be set
set - boolean value indicating if the flag is to be set
Throws:
javax.mail.MessagingException

setFlags

public void setFlags(javax.mail.Flags flag,
                     boolean set)
              throws javax.mail.MessagingException
Sets the message flags to the flags object passed as a parameter.
Parameters:
flag - the flags to which the message flags are to be set.
set - boolean variable indicating if the flags are to be set.
Throws:
javax.mail.MessagingException

delete

public void delete()
            throws TdException
Deletes the current message and all its replies.

Message deletion depends on the deletion policy defined when the board is created.

Throws:
TdException

undelete

public void undelete()
              throws TdException
Undeletes the current message.

Deletion depends of the deletion policy defined when creating the board.

Throws:
TdException

isDeleted

public boolean isDeleted()
                  throws javax.mail.MessagingException
Returns if the current message is deleted.

Deletion depends of the deletion policy defined when creating the board.

Returns:
boolean the boolean value representing whether the message is deleted.
Throws:
javax.mail.MessagingException

erase

public void erase()
           throws javax.mail.MessagingException,
                  TdException
Erases the current message.
Throws:
javax.mail.MessagingException
TdException

getBoard

public TdBoard getBoard()
Returns the board this message belong to.
Returns:
TdBoard the board to which this message belongs to

getThread

public TdThread getThread()
                   throws TdException,
                          javax.mail.MessagingException
Returns the thread this message belong to.
Returns:
TdThread the thread to which this message belongs to.
Throws:
javax.mail.MessagingException
TdException

getPermissions

public TdMessagePermissions getPermissions()
                                    throws TdException
Returns the permissions on this message for the currently connected user.
Returns:
TdMessagePermissions permissions set on this message.
Throws:
TdException

getNumberOfReplies

public int getNumberOfReplies()
                       throws TdException,
                              javax.mail.MessagingException
Returns the number of replies for this message.
Returns:
int integer representing the number of replies for this message.
Throws:
TdException
javax.mail.MessagingException

isNewSinceSession

public boolean isNewSinceSession()
                          throws javax.mail.MessagingException
Returns a boolean value indicating if the message is new since user session startup.
Returns:
boolean value indicating if the message is new since user login time
Throws:
javax.mail.MessagingException

isNewSinceLastVisit

public boolean isNewSinceLastVisit()
                            throws javax.mail.MessagingException
Returns a boolean value indicating if the message is new since user's last visit
Returns:
boolean value indicating if the message is new since user login time
Throws:
javax.mail.MessagingException

isNew

public boolean isNew()
              throws javax.mail.MessagingException
This is the result of "OR" on isNewSinceSessions and isNewSinceLastVisit. The guest user will always get back 'false' from this function.
Returns:
boolean value indicating if the message is new.
Throws:
javax.mail.MessagingException

isByModerator

public boolean isByModerator()
                      throws javax.mail.MessagingException
Returns a boolean value indicating if the message is posted by moderator.
Returns:
boolean value indicating if the message is posted by the moderator.
Throws:
javax.mail.MessagingException

clip

public TdThread clip()
              throws TdException,
                     javax.mail.MessagingException
Moves a message and all its replies and create a new thread.

Clipping a message involves moving the message and all its replies into a new thread.

Returns:
TdThread the new thread created from clipping the message.
Throws:
TdException
javax.mail.MessagingException

getBoardSettings

public TdBoardSettings getBoardSettings()
                                 throws TdException
Returns the settings of the current board lazily loading it if necessary.
Returns:
TdBoardSettings settings defined for the current board.
Throws:
TdException

toString

public java.lang.String toString()
Converts the message into its corresponding string representation.
Returns:
String string representation of the message

toString

public java.lang.String toString(java.util.Locale loc)
Converts the message into a locale specific string
Specified by:
toString in interface oracle.discussions.sdk.impl.TdLocalizable
Parameters:
loc - locale on which the conversion is made
Returns:
String string representation of the message

getAnnotations

public java.util.List getAnnotations()
                              throws javax.mail.MessagingException
Returns all annotations of a message,in descending order of the time.
Returns:
List the list of annotations
Throws:
javax.mail.MessagingException

getLastAnnotation

public TdAnnotation getLastAnnotation()
                               throws javax.mail.MessagingException
Returns the lastest annotation on the message.
Returns:
TdAnnotation the annotation returned
Throws:
javax.mail.MessagingException

Copyright © 2005, Oracle. All rights reserved.