Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices.server
Class ForumMessageServiceImpl

java.lang.Object
  extended by com.jivesoftware.forum.webservices.server.ForumMessageServiceImpl
All Implemented Interfaces:
ForumMessageService

public class ForumMessageServiceImpl
extends java.lang.Object
implements ForumMessageService


Constructor Summary
ForumMessageServiceImpl()
           
 
Method Summary
 void addAttachmentToMessage(java.lang.String name, javax.activation.DataSource source, long messageID)
          Adds an attachment to the message with the specified ID.
 void deleteMessage(long messageID)
          Delete the message with the following id.
 void deleteMessageAndChildren(long messageID, boolean deleteChildren)
          Delete the message with the specified id.
 void deleteProperty(java.lang.String name, long messageID)
          Delete a property with the given name from the message with the given ID.
 javax.activation.DataSource[] getAttachmentsByMessageID(long messageID)
          Returns an array of attachments that are attached to the specified message.
 ForumMessage getChild(long messageID, int index)
          Returns the child of parent at index index in the parent's child array.
 int getChildCount(long messageID)
          Returns the number of children of parent.
 ForumMessage[] getChildren(long messageID)
          Returns an array of all the child messages of the parent.
 ForumMessage getForumMessage(long messageID)
          Returns a ForumMessage by its ID.
 int getIndexOfChild(long parentID, long messageID)
          Returns the index of child in parent.
 int getMessageCountByCategoryID(long categoryID)
          Returns the number of messages that are in the category.
 int getMessageCountByCategoryIDAndFilter(long categoryID, ResultFilter filter)
          Returns the number of messages that are in the category with the specified id after the specified filter has been applied.
 int getMessageCountByThreadID(long threadID)
          Returns the number of messages that are in the thread.
 int getMessageCountByThreadIDAndFilter(long threadID, ResultFilter filter)
          Returns the number of messages that are in the thread with the specified id after the specified filter has been applied.
 int getMessageCountsByForumID(long forumID)
          Returns the number of messages that are in the forum.
 int getMessageCountsByForumIDAndFilter(long forumID, ResultFilter filter)
          Returns the number of messages that are in the forum with the specified id after the specified filter has been applied.
 int getMessageDepth(long messageID)
          Returns the depth of a message in the message tree hierarchy.
 long[] getMessageIDsByCategoryID(long categoryID)
          Returns all of the message IDs for all of the message that are in the category.
 long[] getMessageIDsByCategoryIDAndFilter(long categoryID, ResultFilter filter)
          Returns all of the message IDs for all of the message that are in the category with the specified ID, filtered by the the specified result filter.
 long[] getMessageIDsByForumID(long forumID)
          Returns all of the message IDs for all of the message that are in the forum.
 long[] getMessageIDsByForumIDAndFilter(long forumID, ResultFilter filter)
          Returns all of the message IDs for all of the message that are in the forum with the specified ID, filtered by the the specified ResultFilter
 long[] getMessageIDsByThreadID(long threadID)
          Returns the IDs of the messages that are in the thread.
 long[] getMessageIDsByThreadIDAndFilter(long threadID, ResultFilter filter)
          Returns all of the message IDs for all of the message that are in the thread after the specified filter has been applied.
 ForumMessage[] getMessagesByCategoryID(long categoryID)
          Returns all of the messages that are in the category.
 ForumMessage[] getMessagesByCategoryIDAndFilter(long categoryID, ResultFilter filter)
          Returns all of the messages that are in the category with the specified ID, filtered by the the specified result filter.
 ForumMessage[] getMessagesByForumID(long forumID)
          Returns all of the messages in the forum.
 ForumMessage[] getMessagesByForumIDAndFilter(long forumID, ResultFilter filter)
          Returns all of the messages in the forum with the specified ID, filtered by the the specified ResultFilter
 ForumMessage[] getMessagesByThreadID(long threadID)
          Returns the messages that are in the thread.
 ForumMessage[] getMessagesByThreadIDAndFilter(long threadID, ResultFilter filter)
          Returns all of the messages that are in the thread after the specified filter has been applied.
 ForumMessage getParent(long messageID)
          Returns the parent of the child ForumMessage.
 Property[] getProperties(long messageID)
          Returns all tbe extended properties for the message with the specified ID.
 java.lang.String getProperty(java.lang.String name, long messageID)
          Returns the value of the extended property for the message with the specified ID.
 int getRecursiveChildCount(long messageID)
          Returns the total number of recursive children of a parent.
 ForumMessage[] getRecursiveChildren(long messageID)
          Returns an array for all child messages (and sub-children, etc) of the parent.
 ForumMessage[] getRecursiveMessages(long threadID)
          Returns an array for all messages in the thread in depth-first order.
 ForumMessage getRootMessage(long threadID)
          Returns the root of a thread.
 Property[] getUnfilteredProperties(long messageID)
          Returns the properties without applying filters to them first.
 boolean hasParent(long messageID)
          Returns true if the child message has a parent message.
 boolean isLeaf(long messageID)
          Returns true if node is a leaf.
 void setProperty(java.lang.String name, java.lang.String value, long messageID)
          Set an extended for the property with the given message id.
 void updateForumMessage(ForumMessage message)
          Used to update the subject and body of a ForumMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForumMessageServiceImpl

public ForumMessageServiceImpl()
Method Detail

getForumMessage

public ForumMessage getForumMessage(long messageID)
                             throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns a ForumMessage by its ID.

Specified by:
getForumMessage in interface ForumMessageService
Parameters:
messageID - id of the message.
Returns:
the ForumMessage that matches the specified ID.
Throws:
ForumMessageNotFoundException

deleteMessage

public void deleteMessage(long messageID)
                   throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Delete the message with the following id.

Specified by:
deleteMessage in interface ForumMessageService
Parameters:
messageID - the id of the message to delete.
Throws:
ForumMessageNotFoundException

deleteMessageAndChildren

public void deleteMessageAndChildren(long messageID,
                                     boolean deleteChildren)
                              throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Delete the message with the specified id. If the deleteChildren parameters is set to true all children of this message will be deleted.

Specified by:
deleteMessageAndChildren in interface ForumMessageService
Parameters:
messageID - The ID of the message to delete.
deleteChildren - Whether or not to delete the children of this message.
Throws:
ForumMessageNotFoundException

getProperties

public Property[] getProperties(long messageID)
Description copied from interface: ForumMessageService
Returns all tbe extended properties for the message with the specified ID.

Specified by:
getProperties in interface ForumMessageService
Parameters:
messageID - The ID of the message to retrieve properties for.
Returns:
An array of properties for the message with the given ID.

getMessageIDsByForumIDAndFilter

public long[] getMessageIDsByForumIDAndFilter(long forumID,
                                              ResultFilter filter)
                                       throws ForumNotFoundException
Description copied from interface: ForumMessageService
Returns all of the message IDs for all of the message that are in the forum with the specified ID, filtered by the the specified ResultFilter

Specified by:
getMessageIDsByForumIDAndFilter in interface ForumMessageService
Parameters:
forumID - The ID of the forum to find messages for.
filter - The filter to be apply to the results.
Returns:
An array of message IDs for message that belong to the specified forum.
Throws:
ForumNotFoundException

getMessagesByForumIDAndFilter

public ForumMessage[] getMessagesByForumIDAndFilter(long forumID,
                                                    ResultFilter filter)
                                             throws ForumNotFoundException
Description copied from interface: ForumMessageService
Returns all of the messages in the forum with the specified ID, filtered by the the specified ResultFilter

Specified by:
getMessagesByForumIDAndFilter in interface ForumMessageService
Parameters:
forumID - The ID of the forum to find messages for.
filter - The filter to be apply to the results.
Returns:
An array of messages belong to the specified forum.
Throws:
ForumNotFoundException

getMessageIDsByForumID

public long[] getMessageIDsByForumID(long forumID)
                              throws ForumNotFoundException
Description copied from interface: ForumMessageService
Returns all of the message IDs for all of the message that are in the forum.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Specified by:
getMessageIDsByForumID in interface ForumMessageService
Parameters:
forumID - The ID of the forum to find messages for.
Returns:
An array of message IDs for message that belong to the specified forum.
Throws:
ForumNotFoundException

getMessagesByForumID

public ForumMessage[] getMessagesByForumID(long forumID)
                                    throws ForumNotFoundException
Description copied from interface: ForumMessageService
Returns all of the messages in the forum.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Specified by:
getMessagesByForumID in interface ForumMessageService
Parameters:
forumID - The ID of the forum to find messages for.
Returns:
An array of messages that belong to the specified forum.
Throws:
ForumNotFoundException

getMessageIDsByCategoryIDAndFilter

public long[] getMessageIDsByCategoryIDAndFilter(long categoryID,
                                                 ResultFilter filter)
                                          throws ForumCategoryNotFoundException
Description copied from interface: ForumMessageService
Returns all of the message IDs for all of the message that are in the category with the specified ID, filtered by the the specified result filter.

Specified by:
getMessageIDsByCategoryIDAndFilter in interface ForumMessageService
Parameters:
categoryID - The id of the category to find messages for.
filter - Filter to be apply to the results.
Returns:
An array of message IDs for message that belong to the specified category.
Throws:
ForumCategoryNotFoundException

getMessagesByCategoryIDAndFilter

public ForumMessage[] getMessagesByCategoryIDAndFilter(long categoryID,
                                                       ResultFilter filter)
                                                throws ForumCategoryNotFoundException
Description copied from interface: ForumMessageService
Returns all of the messages that are in the category with the specified ID, filtered by the the specified result filter.

Specified by:
getMessagesByCategoryIDAndFilter in interface ForumMessageService
Parameters:
categoryID - The id of the category to find messages for.
filter - Filter to be apply to the results.
Returns:
An array of messages that belong to the specified category.
Throws:
ForumCategoryNotFoundException

getMessageIDsByCategoryID

public long[] getMessageIDsByCategoryID(long categoryID)
                                 throws ForumCategoryNotFoundException
Description copied from interface: ForumMessageService
Returns all of the message IDs for all of the message that are in the category.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Specified by:
getMessageIDsByCategoryID in interface ForumMessageService
Parameters:
categoryID - The ID of the category to find messages for.
Returns:
An array of message IDs for message that belong to the specified category.
Throws:
ForumCategoryNotFoundException

getMessagesByCategoryID

public ForumMessage[] getMessagesByCategoryID(long categoryID)
                                       throws ForumCategoryNotFoundException
Description copied from interface: ForumMessageService
Returns all of the messages that are in the category.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Specified by:
getMessagesByCategoryID in interface ForumMessageService
Parameters:
categoryID - The ID of the category to find messages for.
Returns:
An array of messages that belong to the specified category.
Throws:
ForumCategoryNotFoundException

getMessageCountsByForumIDAndFilter

public int getMessageCountsByForumIDAndFilter(long forumID,
                                              ResultFilter filter)
                                       throws ForumNotFoundException
Description copied from interface: ForumMessageService
Returns the number of messages that are in the forum with the specified id after the specified filter has been applied.

Specified by:
getMessageCountsByForumIDAndFilter in interface ForumMessageService
Parameters:
forumID - The ID of the forum to find the message count for.
filter - Filter that can be applied to filter out results.
Returns:
The number of messages in the specified forum.
Throws:
ForumNotFoundException

getMessageCountsByForumID

public int getMessageCountsByForumID(long forumID)
                              throws ForumNotFoundException
Description copied from interface: ForumMessageService
Returns the number of messages that are in the forum.

Specified by:
getMessageCountsByForumID in interface ForumMessageService
Parameters:
forumID - The ID of the forum to find the message count for.
Returns:
The number of messages in the specified forum.
Throws:
ForumNotFoundException

getMessageCountByCategoryIDAndFilter

public int getMessageCountByCategoryIDAndFilter(long categoryID,
                                                ResultFilter filter)
                                         throws ForumCategoryNotFoundException
Description copied from interface: ForumMessageService
Returns the number of messages that are in the category with the specified id after the specified filter has been applied.

Specified by:
getMessageCountByCategoryIDAndFilter in interface ForumMessageService
Parameters:
categoryID - The ID of the category to find the message count for.
filter - The filter that can be applied to filter out results.
Returns:
The number of messages in the specified category.
Throws:
ForumCategoryNotFoundException

getMessageCountByCategoryID

public int getMessageCountByCategoryID(long categoryID)
                                throws ForumCategoryNotFoundException
Description copied from interface: ForumMessageService
Returns the number of messages that are in the category.

Specified by:
getMessageCountByCategoryID in interface ForumMessageService
Parameters:
categoryID - The ID of the category to find the message count for.
Returns:
The number of messages in the specified category.
Throws:
ForumCategoryNotFoundException

getMessageIDsByThreadIDAndFilter

public long[] getMessageIDsByThreadIDAndFilter(long threadID,
                                               ResultFilter filter)
                                        throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns all of the message IDs for all of the message that are in the thread after the specified filter has been applied.

Specified by:
getMessageIDsByThreadIDAndFilter in interface ForumMessageService
Parameters:
threadID - The ID of the thread to find messages for.
filter - The filter to apply to the results.
Returns:
An array of message IDs for message that belong to the specified thread.
Throws:
ForumThreadNotFoundException

getMessagesByThreadIDAndFilter

public ForumMessage[] getMessagesByThreadIDAndFilter(long threadID,
                                                     ResultFilter filter)
                                              throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns all of the messages that are in the thread after the specified filter has been applied.

Specified by:
getMessagesByThreadIDAndFilter in interface ForumMessageService
Parameters:
threadID - The ID of the thread to find messages for.
filter - The filter to apply to the results.
Returns:
An array of messages that belong to the specified thread.
Throws:
ForumThreadNotFoundException

getMessageIDsByThreadID

public long[] getMessageIDsByThreadID(long threadID)
                               throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns the IDs of the messages that are in the thread.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Specified by:
getMessageIDsByThreadID in interface ForumMessageService
Parameters:
threadID - The ID of the thread to find message IDs for.
Returns:
The IDs of the messages in the specified thread.
Throws:
ForumThreadNotFoundException

getMessagesByThreadID

public ForumMessage[] getMessagesByThreadID(long threadID)
                                     throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns the messages that are in the thread.

If the number of results exceeds WSConstants.MAX_MESSAGE_RESULTS than then message IDs up to WSConstants.MAX_MESSAGE_RESULTS will be returned.

Specified by:
getMessagesByThreadID in interface ForumMessageService
Parameters:
threadID - The ID of the thread to find message IDs for.
Returns:
The messages in the specified thread.
Throws:
ForumThreadNotFoundException

getMessageCountByThreadIDAndFilter

public int getMessageCountByThreadIDAndFilter(long threadID,
                                              ResultFilter filter)
                                       throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns the number of messages that are in the thread with the specified id after the specified filter has been applied.

Specified by:
getMessageCountByThreadIDAndFilter in interface ForumMessageService
Parameters:
threadID - The ID of the thread to find the message count for.
filter - The filter that can be applied to filter out results.
Returns:
The number of messages in the specified thread.
Throws:
ForumThreadNotFoundException

getMessageCountByThreadID

public int getMessageCountByThreadID(long threadID)
                              throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns the number of messages that are in the thread.

Specified by:
getMessageCountByThreadID in interface ForumMessageService
Parameters:
threadID - The ID of the thread to find the message count for.
Returns:
The number of messages in the specified thread.
Throws:
ForumThreadNotFoundException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value,
                        long messageID)
                 throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Set an extended for the property with the given message id.

Specified by:
setProperty in interface ForumMessageService
Parameters:
name - The name of the property.
value - The value of the property.
messageID - The ID of the message to set an extended property for.
Throws:
ForumMessageNotFoundException

getProperty

public java.lang.String getProperty(java.lang.String name,
                                    long messageID)
                             throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the value of the extended property for the message with the specified ID.

Specified by:
getProperty in interface ForumMessageService
Parameters:
name - The name of the property.
messageID - The ID of the message to retrieve the property for.
Returns:
The value of the property, null if not found.
Throws:
ForumMessageNotFoundException

deleteProperty

public void deleteProperty(java.lang.String name,
                           long messageID)
                    throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Delete a property with the given name from the message with the given ID.

Specified by:
deleteProperty in interface ForumMessageService
Parameters:
name - The name of the property to delete.
messageID - The ID of the message to delete the property from.
Throws:
ForumMessageNotFoundException

getUnfilteredProperties

public Property[] getUnfilteredProperties(long messageID)
                                   throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the properties without applying filters to them first.

Specified by:
getUnfilteredProperties in interface ForumMessageService
Parameters:
messageID - The ID of the message to return unfiltered properties for.
Returns:
Unfiltered properties for the message.
Throws:
ForumMessageNotFoundException

getAttachmentsByMessageID

public javax.activation.DataSource[] getAttachmentsByMessageID(long messageID)
                                                        throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns an array of attachments that are attached to the specified message.

Specified by:
getAttachmentsByMessageID in interface ForumMessageService
Parameters:
messageID - The ID of the message to acquire attachments for.
Returns:
An array of attachments that are attached to the specified message.
Throws:
ForumMessageNotFoundException

addAttachmentToMessage

public void addAttachmentToMessage(java.lang.String name,
                                   javax.activation.DataSource source,
                                   long messageID)
                            throws AttachmentException,
                                   ForumMessageNotFoundException,
                                   java.io.IOException
Description copied from interface: ForumMessageService
Adds an attachment to the message with the specified ID.

Specified by:
addAttachmentToMessage in interface ForumMessageService
Parameters:
name - The name of the attachment.
source - The content for the attachment.
messageID - The ID of the message.
Throws:
AttachmentException
ForumMessageNotFoundException
java.io.IOException

getRootMessage

public ForumMessage getRootMessage(long threadID)
                            throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns the root of a thread. Returns null only if thread has no nodes.

Specified by:
getRootMessage in interface ForumMessageService
Parameters:
threadID - The ID of the thread.
Returns:
The root of the thread.
Throws:
ForumThreadNotFoundException

hasParent

public boolean hasParent(long messageID)
                  throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns true if the child message has a parent message.

Specified by:
hasParent in interface ForumMessageService
Parameters:
messageID - the message.
Returns:
true if the message has a parent.
Throws:
ForumMessageNotFoundException

getParent

public ForumMessage getParent(long messageID)
                       throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the parent of the child ForumMessage.

Specified by:
getParent in interface ForumMessageService
Parameters:
messageID - The ID of the message to find the parent for.
Returns:
the parent message of child.
Throws:
ForumMessageNotFoundException - if child does not have a parent, or if the parent message could not be loaded for any other reason.

getChild

public ForumMessage getChild(long messageID,
                             int index)
                      throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the child of parent at index index in the parent's child array. The index must be a valid one, that is: index >= 0, and index < getChildCount(parent). If the index is not valid, or if the child could not be loaded for any other reason, a ForumMessageNotFoundException will be thrown.

Specified by:
getChild in interface ForumMessageService
Parameters:
messageID - The ID of the parent message.
index - the index of the child.
Returns:
the child of parent at index.
Throws:
ForumMessageNotFoundException - if the index was invalid or the child could not be loaded for any other reason.

getChildren

public ForumMessage[] getChildren(long messageID)
                           throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns an array of all the child messages of the parent. This method only considers direct descendants of the parent message and not sub-children. To get an array for the full hierarchy of children for a parent message, use the ForumMessageService.getRecursiveChildren(long) method.

Specified by:
getChildren in interface ForumMessageService
Parameters:
messageID - The parent message.
Returns:
An array for the children of parent.
Throws:
ForumMessageNotFoundException

getRecursiveChildren

public ForumMessage[] getRecursiveChildren(long messageID)
                                    throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns an array for all child messages (and sub-children, etc) of the parent. Messages will be returned depth-first. For example, consider the following message tree:
   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
   |-- |-- |-- |-- 10
   |-- |-- 6
   |-- |-- 8
   |-- 5
 
Calling getRecursiveChildren(3) on the tree above would return the sequence 4, 7, 10, 6, 8. This method is a powerful way to show all children of a message, especially in combination with the ForumMessageService.getMessageDepth(long) method.

Specified by:
getRecursiveChildren in interface ForumMessageService
Parameters:
messageID - The ID of the parent message.
Returns:
An array for all the recursive children of the parent.
Throws:
ForumMessageNotFoundException

isLeaf

public boolean isLeaf(long messageID)
               throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns true if node is a leaf. A node is a leaf when it has no children messages.

Specified by:
isLeaf in interface ForumMessageService
Parameters:
messageID - A node in the thread, obtained from this data source.
Returns:
True if node is a leaf.
Throws:
ForumMessageNotFoundException

getRecursiveChildCount

public int getRecursiveChildCount(long messageID)
                           throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the total number of recursive children of a parent. Returns 0 if there are no children. This method is not intended to aid in navigation of a Thread but is included as an added utility.

Specified by:
getRecursiveChildCount in interface ForumMessageService
Parameters:
messageID - The ID of the message.
Returns:
The recursive count of the children of parent.
Throws:
ForumMessageNotFoundException

getIndexOfChild

public int getIndexOfChild(long parentID,
                           long messageID)
                    throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the index of child in parent. This method does not deal with the indexes of sub-children of parents. For example, take the following tree:
   4
   |-- 2
   |-- |-- 1
   |-- |-- 6
   |-- |-- 8
   |-- 5
 
In this example, getIndexOfChild(4, 2) would return 0, getIndexOfChild(4, 5) would return 1, and getIndexOfChild(2, 8) would return 2. getIndexOfChild(4, 8) -- NOT VALID

Specified by:
getIndexOfChild in interface ForumMessageService
Parameters:
parentID - The ID of the parent message.
messageID - The ID of the child message to get the index for.
Returns:
The index of child in the list of siblings under parent.
Throws:
ForumMessageNotFoundException

getMessageDepth

public int getMessageDepth(long messageID)
                    throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the depth of a message in the message tree hierarchy. The root message is always at depth 0. For example, consider the following message tree:
   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
 
The depth of message 4 is 2, the depth of message 7 is 3, etc. This method is useful in combination with the ForumMessageService.getRecursiveChildren(long) array to build a UI of hierarchical messages.

Specified by:
getMessageDepth in interface ForumMessageService
Parameters:
messageID - The ID of the message to determine the depth of.
Returns:
The depth of the message in the message tree hiearchy.
Throws:
ForumMessageNotFoundException

getChildCount

public int getChildCount(long messageID)
                  throws ForumMessageNotFoundException
Description copied from interface: ForumMessageService
Returns the number of children of parent. Returns 0 if the node is a leaf or if it has no children.

Specified by:
getChildCount in interface ForumMessageService
Parameters:
messageID - The ID the message.
Returns:
The number of children of the node parent.
Throws:
ForumMessageNotFoundException

getRecursiveMessages

public ForumMessage[] getRecursiveMessages(long threadID)
                                    throws ForumThreadNotFoundException
Description copied from interface: ForumMessageService
Returns an array for all messages in the thread in depth-first order. For example, consider the following message tree:
   1
   |-- 3
   |-- |-- 4
   |-- |-- |-- 7
   |-- |-- |-- |-- 10
   |-- |-- 6
   |-- |-- 8
   |-- 5
 
Calling getRecursiveMessages() on the tree above would return the sequence 1, 3, 4, 7, 10, 6, 8, 5. This method is a powerful way to show the full tree of messages, especially in combination with the ForumMessageService.getMessageDepth(long) method.

Specified by:
getRecursiveMessages in interface ForumMessageService
Parameters:
threadID - The ID of the thread.
Returns:
An array for all messages in the thread in depth-first order.
Throws:
ForumThreadNotFoundException

updateForumMessage

public void updateForumMessage(ForumMessage message)
                        throws ForumMessageNotFoundException,
                               MessageRejectedException
Description copied from interface: ForumMessageService
Used to update the subject and body of a ForumMessage

Specified by:
updateForumMessage in interface ForumMessageService
Parameters:
message - The message to update
Throws:
ForumMessageNotFoundException - Thrown if the forum message does not exist
MessageRejectedException - Thrown if the forum message has been rejected by a message interceptor

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.