Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices
Interface ForumMessageService

All Known Implementing Classes:
ForumMessageServiceImpl

public interface ForumMessageService

Provides the ability to manipulate forum messages. This service will allow you to delete, move and acquire forum messages.


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
 

Method Detail

getForumMessage

ForumMessage getForumMessage(long messageID)
                             throws ForumMessageNotFoundException
Returns a ForumMessage by its ID.

Parameters:
messageID - id of the message.
Returns:
the ForumMessage that matches the specified ID.
Throws:
ForumMessageNotFoundException

deleteMessage

void deleteMessage(long messageID)
                   throws ForumMessageNotFoundException
Delete the message with the following id.

Parameters:
messageID - the id of the message to delete.
Throws:
ForumMessageNotFoundException

deleteMessageAndChildren

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

Parameters:
messageID - The ID of the message to delete.
deleteChildren - Whether or not to delete the children of this message.
Throws:
ForumMessageNotFoundException

getProperties

Property[] getProperties(long messageID)
Returns all tbe extended properties for the message with the specified ID.

Parameters:
messageID - The ID of the message to retrieve properties for.
Returns:
An array of properties for the message with the given ID.

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value,
                 long messageID)
                 throws ForumMessageNotFoundException
Set an extended for the property with the given message id.

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

java.lang.String getProperty(java.lang.String name,
                             long messageID)
                             throws ForumMessageNotFoundException
Returns the value of the extended property for the message with the specified ID.

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

void deleteProperty(java.lang.String name,
                    long messageID)
                    throws ForumMessageNotFoundException
Delete a property with the given name from the message with the given ID.

Parameters:
name - The name of the property to delete.
messageID - The ID of the message to delete the property from.
Throws:
ForumMessageNotFoundException

getUnfilteredProperties

Property[] getUnfilteredProperties(long messageID)
                                   throws ForumMessageNotFoundException
Returns the properties without applying filters to them first.

Parameters:
messageID - The ID of the message to return unfiltered properties for.
Returns:
Unfiltered properties for the message.
Throws:
ForumMessageNotFoundException

getAttachmentsByMessageID

javax.activation.DataSource[] getAttachmentsByMessageID(long messageID)
                                                        throws ForumMessageNotFoundException
Returns an array of attachments that are attached to the specified message.

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

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

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

getMessageIDsByForumIDAndFilter

long[] getMessageIDsByForumIDAndFilter(long forumID,
                                       ResultFilter filter)
                                       throws ForumNotFoundException
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

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

getMessageIDsByForumID

long[] getMessageIDsByForumID(long forumID)
                              throws ForumNotFoundException
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.

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

getMessageIDsByCategoryIDAndFilter

long[] getMessageIDsByCategoryIDAndFilter(long categoryID,
                                          ResultFilter filter)
                                          throws ForumCategoryNotFoundException
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.

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

getMessageIDsByCategoryID

long[] getMessageIDsByCategoryID(long categoryID)
                                 throws ForumCategoryNotFoundException
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.

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

getMessageCountsByForumIDAndFilter

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

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

int getMessageCountsByForumID(long forumID)
                              throws ForumNotFoundException
Returns the number of messages that are in the forum.

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

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

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

int getMessageCountByCategoryID(long categoryID)
                                throws ForumCategoryNotFoundException
Returns the number of messages that are in the category.

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

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

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

getMessageIDsByThreadID

long[] getMessageIDsByThreadID(long threadID)
                               throws ForumThreadNotFoundException
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.

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

getMessageCountByThreadIDAndFilter

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

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

int getMessageCountByThreadID(long threadID)
                              throws ForumThreadNotFoundException
Returns the number of messages that are in the thread.

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

getMessagesByForumIDAndFilter

ForumMessage[] getMessagesByForumIDAndFilter(long forumID,
                                             ResultFilter filter)
                                             throws ForumNotFoundException
Returns all of the messages in the forum with the specified ID, filtered by the the specified ResultFilter

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

getMessagesByForumID

ForumMessage[] getMessagesByForumID(long forumID)
                                    throws ForumNotFoundException
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.

Parameters:
forumID - The ID of the forum to find messages for.
Returns:
An array of messages that belong to the specified forum.
Throws:
ForumNotFoundException

getMessagesByCategoryIDAndFilter

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

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

getMessagesByCategoryID

ForumMessage[] getMessagesByCategoryID(long categoryID)
                                       throws ForumCategoryNotFoundException
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.

Parameters:
categoryID - The ID of the category to find messages for.
Returns:
An array of messages that belong to the specified category.
Throws:
ForumCategoryNotFoundException

getMessagesByThreadIDAndFilter

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

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

getMessagesByThreadID

ForumMessage[] getMessagesByThreadID(long threadID)
                                     throws ForumThreadNotFoundException
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.

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

getRootMessage

ForumMessage getRootMessage(long threadID)
                            throws ForumThreadNotFoundException
Returns the root of a thread. Returns null only if thread has no nodes.

Parameters:
threadID - The ID of the thread.
Returns:
The root of the thread.
Throws:
ForumThreadNotFoundException

hasParent

boolean hasParent(long messageID)
                  throws ForumMessageNotFoundException
Returns true if the child message has a parent message.

Parameters:
messageID - the message.
Returns:
true if the message has a parent.
Throws:
ForumMessageNotFoundException

getParent

ForumMessage getParent(long messageID)
                       throws ForumMessageNotFoundException
Returns the parent of the child ForumMessage.

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

ForumMessage getChild(long messageID,
                      int index)
                      throws ForumMessageNotFoundException
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.

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

ForumMessage[] getChildren(long messageID)
                           throws ForumMessageNotFoundException
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 getRecursiveChildren(long) method.

Parameters:
messageID - The parent message.
Returns:
An array for the children of parent.
Throws:
ForumMessageNotFoundException

getRecursiveChildren

ForumMessage[] getRecursiveChildren(long messageID)
                                    throws ForumMessageNotFoundException
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 getMessageDepth(long) method.

Parameters:
messageID - The ID of the parent message.
Returns:
An array for all the recursive children of the parent.
Throws:
ForumMessageNotFoundException

isLeaf

boolean isLeaf(long messageID)
               throws ForumMessageNotFoundException
Returns true if node is a leaf. A node is a leaf when it has no children messages.

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

getRecursiveChildCount

int getRecursiveChildCount(long messageID)
                           throws ForumMessageNotFoundException
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.

Parameters:
messageID - The ID of the message.
Returns:
The recursive count of the children of parent.
Throws:
ForumMessageNotFoundException

getIndexOfChild

int getIndexOfChild(long parentID,
                    long messageID)
                    throws ForumMessageNotFoundException
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

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

int getMessageDepth(long messageID)
                    throws ForumMessageNotFoundException
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 getRecursiveChildren(long) array to build a UI of hierarchical messages.

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

int getChildCount(long messageID)
                  throws ForumMessageNotFoundException
Returns the number of children of parent. Returns 0 if the node is a leaf or if it has no children.

Parameters:
messageID - The ID the message.
Returns:
The number of children of the node parent.
Throws:
ForumMessageNotFoundException

getRecursiveMessages

ForumMessage[] getRecursiveMessages(long threadID)
                                    throws ForumThreadNotFoundException
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 getMessageDepth(long) method.

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

updateForumMessage

void updateForumMessage(ForumMessage message)
                        throws ForumMessageNotFoundException,
                               MessageRejectedException
Used to update the subject and body of a ForumMessage

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.