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

Part No. B16232-01


oracle.discussions.sdk
Class TdThread

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

All Implemented Interfaces:
javax.mail.internet.MimePart, javax.mail.Part, TdFavorite, oracle.discussions.sdk.impl.TdLocalizable

public class TdThread
extends TdMessage
implements TdFavorite

TdThread is a TdMessage with additional accessors for thread specific information. In addition to the pre-fecthed values of TdMessage, TdThread also has pre-fetched the following fields:

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:
TdMessage.java, TdBoard.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
void addToFavorites()
Adds this thread to the list of favorite threads for this user.
oracle.discussions.sdk.impl.data.TdLastPostInfo getLastPost()
Returns information on the last post to the thread The Last post thread is the one which is posted latest in time.
TdMessage getMessage(int iMsgId)
Returns a message of the thread given its msgId.
int getMessageCount()
Returns the number of messages in the thread A thread can have many messages as long as they stem from the thread's root.
TdIterator getMessages()
Returns the messages of the Thread.
TdIterator getMessages(boolean bSortByPostDate)
Returns the messages of the Thread.
int getNumberOfReplies()
Returns the number of replies for this message A single message can have many replies, each of which is stemming from the source message root.
TdMessagePermissions getPermissions()
Returns permissions on this Thread for the currently connected user.
boolean isFavorite()
Returns true if this thread is currently marked as a favorite thread for this user.
boolean isLocked()
Returns a boolean status indicating if the thread is locked
boolean isLocked(boolean bReload)
Returns true if the thread is locked
void lock()
Sets the status of a thread to locked.
TdThread move(TdBoard tdbTo)
Moves this thread and all its replies to the supplied Board.
void removeFromFavorites()
Remove this thread from the list of favorite threads for this user.
void unlock()
Sets the status of a thread to unlocked.

Methods inherited from class oracle.discussions.sdk.TdMessage
clip, delete, erase, getAnnotations, getAttachmentBodyParts, getAttachmentById, getAttachments, getBoard, getBoardSettings, getBodyPlainText, getBodyRichText, getContent, getFlags, getFrom, getLastAnnotation, getLevel, getOracleMessageId, getOracleMessageUid, getOracleThreadId, getParent, getParentMessageId, getRfc822MessageId, getRfc822References, getSentDate, getSize, getSubject, getThread, getXPriority, hasAttachments, isByModerator, isDeleted, isNew, isNewSinceLastVisit, isNewSinceSession, setFlag, setFlags, toString, toString, undelete

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

getMessageCount

public int getMessageCount()
                    throws TdException,
                           javax.mail.MessagingException
Returns the number of messages in the thread A thread can have many messages as long as they stem from the thread's root.
Returns:
int
Throws:
TdException - a generic oracle discussions exception thrown when performing lazyloading.
javax.mail.MessagingException - a oracle email related exception thrown when performing lazy loading.

getNumberOfReplies

public int getNumberOfReplies()
                       throws TdException,
                              javax.mail.MessagingException
Returns the number of replies for this message A single message can have many replies, each of which is stemming from the source message root.
Overrides:
getNumberOfReplies in class TdMessage
Returns:
int integer representing the number of replies for this message.
Throws:
TdException - a generic oracle discussions exception thrown when performing lazyloading.
javax.mail.MessagingException - a oracle email related exception thrown when performing lazy loading.

getLastPost

public oracle.discussions.sdk.impl.data.TdLastPostInfo getLastPost()
                                                            throws TdException,
                                                                   javax.mail.MessagingException
Returns information on the last post to the thread The Last post thread is the one which is posted latest in time.
Throws:
TdException - a generic oracle discussions exception thrown when performing lazyloading.
javax.mail.MessagingException - a oracle email related exception thrown when performing lazy loading.

getMessage

public TdMessage getMessage(int iMsgId)
                     throws TdException,
                            javax.mail.MessagingException
Returns a message of the thread given its msgId. The returned messages all have the set of pre-fetched headerd described in TdMessage.
Returns:
TdMessage The messages will be returned in thread order.
Throws:
TdException - oracle discussions generic exception may be thrown when retrieving message information from the cache.
javax.mail.MessagingException - oracle email related exception may be thrown when retrieving message information from the cache.

getMessages

public TdIterator getMessages()
                       throws TdException,
                              javax.mail.MessagingException
Returns the messages of the Thread. The returned messages all have the set of pre-fetched header described in TdMessage. The messages will be returned in thread order. All the messages inside a thread are returned in an iterator which can be traversed to extract individual message object.
Throws:
TdException - a generic oracle discussions exception may be thrown when extracting the messages.
javax.mail.MessagingException - , an oracle email related exception which may be thrown when extracting the messages.

getMessages

public TdIterator getMessages(boolean bSortByPostDate)
                       throws TdException,
                              javax.mail.MessagingException
Returns the messages of the Thread. The returned messages all have the set of pre-fetched headerd described in TdMessage. The messages will be returned in thread order if bSortByPostDate is false, by post date otherwise. All the messages inside a thread are returned in an iterator which can be traversed to extract individual message object.
Throws:
TdException - a generic oracle discussions exception may be thrown when extracting the messages.
javax.mail.MessagingException - , an oracle email related exception which may be thrown when extracting the messages.

isFavorite

public boolean isFavorite()
                   throws TdException
Returns true if this thread is currently marked as a favorite thread for this user.
Specified by:
isFavorite in interface TdFavorite
Returns:
boolean
Throws:
TdException

addToFavorites

public void addToFavorites()
                    throws TdException
Adds this thread to the list of favorite threads for this user.
Specified by:
addToFavorites in interface TdFavorite
Throws:
tdException - A generic oracle discussions exception which may be thrown when the thread is being added to favorites.
TdException

removeFromFavorites

public void removeFromFavorites()
                         throws TdException
Remove this thread from the list of favorite threads for this user.
Specified by:
removeFromFavorites in interface TdFavorite
Throws:
tdException - A generic oracle discussions exception which may be thrown when the thread is being removed from the favorites.
TdException

move

public TdThread move(TdBoard tdbTo)
              throws TdException,
                     javax.mail.MessagingException
Moves this thread and all its replies to the supplied Board. After tis API is called this TdThread instance should not be used anymore. Instead the returned TdThread instance should be used. To move a thread from one board to another, the user should have board moderator role in the source board and board writer role in the destination board.
Parameters:
tdbTo - the destination board.
Returns:
the new TdThread object for the moved thread
Throws:
TdException - may be thrown when the thread is being moved
javax.mail.MessagingException - may eb thrown when the thread is being moved.

lock

public void lock()
          throws TdException,
                 javax.mail.MessagingException
Sets the status of a thread to locked. A thread which is locked cannot be edited. Only board writer who is the owner of the thread and higher role will have permissions to lock a thread.
Throws:
TdException - may eb thrown when the thread is beig locked.
javax.mail.MessagingException - may be thrown when the thread is being locked.

unlock

public void unlock()
            throws TdException,
                   javax.mail.MessagingException
Sets the status of a thread to unlocked. A thread which is unlocked can be edited. Only board writer who is the owner of the thread and higher role will have permissions to unlock a thread.
Throws:
TdException - may eb thrown when the thread is beig unlocked.
javax.mail.MessagingException - may be thrown when the thread is being unlocked.

isLocked

public boolean isLocked()
                 throws javax.mail.MessagingException
Returns a boolean status indicating if the thread is locked
Returns:
boolean
Throws:
javax.mail.MessagingException

isLocked

public boolean isLocked(boolean bReload)
                 throws javax.mail.MessagingException
Returns true if the thread is locked
Returns:
boolean
Throws:
javax.mail.MessagingException

getPermissions

public TdMessagePermissions getPermissions()
                                    throws TdException
Returns permissions on this Thread for the currently connected user.
Overrides:
getPermissions in class TdMessage
Returns:
TdMessagePermissions
Throws:
TdException

Copyright © 2005, Oracle. All rights reserved.