Oracle Discussions Java API Reference
10g Release 1 (10.1.2)

B25496-01

oracle.discussions.sdk
Class TdMessage

oracle.discussions.sdk.TdMessage
Direct Known Subclasses:
TdSearchResultMessage, TdThread

public class TdMessage

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

Field Summary
protected  oracle.discussions.sdk.impl.data.event.TdEventFactory _evtfac
           
protected  oracle.discussions.sdk.impl.event.publisher.EventPublisher _evtpub
           
protected  javax.mail.Flags _flags
           
protected static java.util.Hashtable _htRb
           
protected  oracle.discussions.util.log.LoggerIf _logger
           
protected  oracle.discussions.sdk.impl.data.TdMessageInfo _msgInfo
           
protected  TdBoard _tdb
           
protected  oracle.discussions.sdk.impl.data.TdBodyInfo _tdBodyInfo
           
protected  TdBoardSettings _tdbs
           
protected  TdRole _tdr
           
protected  oracle.discussions.sdk.impl.TdSession _tdsession
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsDelete
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetBodyPlainText
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetBodyRichText
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetContent
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetNumberOfReplies
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetParent
           
protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsUndelete
           
protected static oracle.dms.instrument.Noun s_nMessage
           

 

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.
protected  java.util.ResourceBundle getResourceBundle(java.util.Locale loc)
          Returns the name of the ResourceBundle to be used by the toString(loc).
protected  java.lang.String getResourceBundleName()
          Returns the name of the ResourceBundle to be used by the toString(loc).
 java.lang.String getRfc822MessageId()
          Returns the value of the Message-ID header.
 java.lang.String getRfc822References()
          Returns the value of the References header.
protected  TdRole getRole()
          Returns the role of the currently connected user in this board lazily loading it if necessary.
 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
protected  void invalidateCache()
          Invalidates the cache.
 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.
protected  void refreshRole()
          Refreshes the users role.
 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.
protected  void setParent(TdMessage parentMsg)
          Sets the parent message to the current message.
 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.
protected  void updateUserFlags(javax.mail.Flags flags)
          Sets the message user's flags marking new message since last visit/session.

 

Field Detail

s_nMessage

protected static oracle.dms.instrument.Noun s_nMessage

s_dmsDelete

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsDelete

s_dmsUndelete

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsUndelete

s_dmsGetContent

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetContent

s_dmsGetBodyRichText

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetBodyRichText

s_dmsGetBodyPlainText

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetBodyPlainText

s_dmsGetNumberOfReplies

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetNumberOfReplies

s_dmsGetParent

protected static oracle.discussions.sdk.impl.data.dms.TdPhaseEvent s_dmsGetParent

_htRb

protected static java.util.Hashtable _htRb

_flags

protected javax.mail.Flags _flags

_tdb

protected TdBoard _tdb

_msgInfo

protected oracle.discussions.sdk.impl.data.TdMessageInfo _msgInfo

_tdsession

protected oracle.discussions.sdk.impl.TdSession _tdsession

_evtpub

protected oracle.discussions.sdk.impl.event.publisher.EventPublisher _evtpub

_evtfac

protected oracle.discussions.sdk.impl.data.event.TdEventFactory _evtfac

_logger

protected oracle.discussions.util.log.LoggerIf _logger

_tdBodyInfo

protected oracle.discussions.sdk.impl.data.TdBodyInfo _tdBodyInfo

_tdbs

protected TdBoardSettings _tdbs

_tdr

protected TdRole _tdr

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:
MessagingException -  

getRfc822References

public java.lang.String getRfc822References()
                                     throws javax.mail.MessagingException
Returns the value of the References header.
Returns:
String the references header
Throws:
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:
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:
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:
MessagingException -  

getSize

public int getSize()
            throws javax.mail.MessagingException
Returns the size of the message in bytes.
Returns:
integer representing the size of message in bytes.
Throws:
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 -  
MessagingException -  

getFlags

public javax.mail.Flags getFlags()
                          throws javax.mail.MessagingException
Returns flags of the current message.
Returns:
Flags message flags
Throws:
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

getContent

public java.lang.Object getContent()
                            throws javax.mail.MessagingException,
                                   java.io.IOException
Gets the body content of the current message.
Returns:
Object the content of the message.
Throws:
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:
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 -  
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 -  
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 -  
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 -  
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 -  
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:
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:
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:
MessagingException -  

erase

public void erase()
           throws javax.mail.MessagingException,
                  TdException
Erases the current message.
Throws:
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:
TdException -  
MessagingException -  

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 -  
MessagingException -  

updateUserFlags

protected void updateUserFlags(javax.mail.Flags flags)
                        throws TdException,
                               javax.mail.MessagingException
Sets the message user's flags marking new message since last visit/session.
Parameters:
flags - the flags that are being set.
Throws:
TdException -  
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:
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:
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:
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:
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 -  
MessagingException -  

setParent

protected void setParent(TdMessage parentMsg)
Sets the parent message to the current message.
Parameters:
parentMsg - the parent message for the current message.

invalidateCache

protected void invalidateCache()
                        throws TdException,
                               javax.mail.MessagingException
Invalidates the cache.

Cache invalidation involves removing the old entries from the cache.

Throws:
TdException -  
MessagingException -  

getRole

protected TdRole getRole()
                  throws TdException
Returns the role of the currently connected user in this board lazily loading it if necessary.
Returns:
TdRole the role that the current user plays on this board.
Throws:
TdException -  

refreshRole

protected void refreshRole()
                    throws TdException
Refreshes the users role.
Throws:
TdException -  

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
Parameters:
loc - locale on which the conversion is made
Returns:
String string representation of the message

getResourceBundleName

protected java.lang.String getResourceBundleName()
Returns the name of the ResourceBundle to be used by the toString(loc). e.g. "oracle.discussions.exmsgs.XXXMessages"
Returns:
String resource bundle name

getResourceBundle

protected final java.util.ResourceBundle getResourceBundle(java.util.Locale loc)
                                                    throws java.util.MissingResourceException
Returns the name of the ResourceBundle to be used by the toString(loc). e.g. "oracle.discussions.exmsgs.XXXMessages"
Parameters:
loc - the locale on which the resource bundle is to be retrieved
Returns:
String resource bundle name
Throws:
java.util.MissingResourceException - thrown when the resource bundle cannot be located

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:
MessagingException -  

getLastAnnotation

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

Oracle Discussions Java API Reference
10g Release 1 (10.1.2)

B25496-01

Copyright © 2002, 2005, Oracle. All rights reserved.