|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.webservices.server.ForumMessageServiceImpl
public class ForumMessageServiceImpl
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 |
---|
public ForumMessageServiceImpl()
Method Detail |
---|
public ForumMessage getForumMessage(long messageID) throws ForumMessageNotFoundException
ForumMessageService
ForumMessage
by its ID.
getForumMessage
in interface ForumMessageService
messageID
- id of the message.
ForumMessageNotFoundException
public void deleteMessage(long messageID) throws ForumMessageNotFoundException
ForumMessageService
deleteMessage
in interface ForumMessageService
messageID
- the id of the message to delete.
ForumMessageNotFoundException
public void deleteMessageAndChildren(long messageID, boolean deleteChildren) throws ForumMessageNotFoundException
ForumMessageService
deleteMessageAndChildren
in interface ForumMessageService
messageID
- The ID of the message to delete.deleteChildren
- Whether or not to delete the children of this message.
ForumMessageNotFoundException
public Property[] getProperties(long messageID)
ForumMessageService
getProperties
in interface ForumMessageService
messageID
- The ID of the message to retrieve properties for.
public long[] getMessageIDsByForumIDAndFilter(long forumID, ResultFilter filter) throws ForumNotFoundException
ForumMessageService
ResultFilter
getMessageIDsByForumIDAndFilter
in interface ForumMessageService
forumID
- The ID of the forum to find messages for.filter
- The filter to be apply to the results.
ForumNotFoundException
public ForumMessage[] getMessagesByForumIDAndFilter(long forumID, ResultFilter filter) throws ForumNotFoundException
ForumMessageService
ResultFilter
getMessagesByForumIDAndFilter
in interface ForumMessageService
forumID
- The ID of the forum to find messages for.filter
- The filter to be apply to the results.
ForumNotFoundException
public long[] getMessageIDsByForumID(long forumID) throws ForumNotFoundException
ForumMessageService
WSConstants.MAX_MESSAGE_RESULTS
than then message IDs up to
WSConstants.MAX_MESSAGE_RESULTS
will be returned.
getMessageIDsByForumID
in interface ForumMessageService
forumID
- The ID of the forum to find messages for.
ForumNotFoundException
public ForumMessage[] getMessagesByForumID(long forumID) throws ForumNotFoundException
ForumMessageService
WSConstants.MAX_MESSAGE_RESULTS
than then message IDs up to
WSConstants.MAX_MESSAGE_RESULTS
will be returned.
getMessagesByForumID
in interface ForumMessageService
forumID
- The ID of the forum to find messages for.
ForumNotFoundException
public long[] getMessageIDsByCategoryIDAndFilter(long categoryID, ResultFilter filter) throws ForumCategoryNotFoundException
ForumMessageService
getMessageIDsByCategoryIDAndFilter
in interface ForumMessageService
categoryID
- The id of the category to find messages for.filter
- Filter to be apply to the results.
ForumCategoryNotFoundException
public ForumMessage[] getMessagesByCategoryIDAndFilter(long categoryID, ResultFilter filter) throws ForumCategoryNotFoundException
ForumMessageService
getMessagesByCategoryIDAndFilter
in interface ForumMessageService
categoryID
- The id of the category to find messages for.filter
- Filter to be apply to the results.
ForumCategoryNotFoundException
public long[] getMessageIDsByCategoryID(long categoryID) throws ForumCategoryNotFoundException
ForumMessageService
WSConstants.MAX_MESSAGE_RESULTS
than then message IDs up to
WSConstants.MAX_MESSAGE_RESULTS
will be returned.
getMessageIDsByCategoryID
in interface ForumMessageService
categoryID
- The ID of the category to find messages for.
ForumCategoryNotFoundException
public ForumMessage[] getMessagesByCategoryID(long categoryID) throws ForumCategoryNotFoundException
ForumMessageService
WSConstants.MAX_MESSAGE_RESULTS
than then message IDs up to
WSConstants.MAX_MESSAGE_RESULTS
will be returned.
getMessagesByCategoryID
in interface ForumMessageService
categoryID
- The ID of the category to find messages for.
ForumCategoryNotFoundException
public int getMessageCountsByForumIDAndFilter(long forumID, ResultFilter filter) throws ForumNotFoundException
ForumMessageService
getMessageCountsByForumIDAndFilter
in interface ForumMessageService
forumID
- The ID of the forum to find the message count for.filter
- Filter that can be applied to filter out results.
ForumNotFoundException
public int getMessageCountsByForumID(long forumID) throws ForumNotFoundException
ForumMessageService
getMessageCountsByForumID
in interface ForumMessageService
forumID
- The ID of the forum to find the message count for.
ForumNotFoundException
public int getMessageCountByCategoryIDAndFilter(long categoryID, ResultFilter filter) throws ForumCategoryNotFoundException
ForumMessageService
getMessageCountByCategoryIDAndFilter
in interface ForumMessageService
categoryID
- The ID of the category to find the message count for.filter
- The filter that can be applied to filter out results.
ForumCategoryNotFoundException
public int getMessageCountByCategoryID(long categoryID) throws ForumCategoryNotFoundException
ForumMessageService
getMessageCountByCategoryID
in interface ForumMessageService
categoryID
- The ID of the category to find the message count for.
ForumCategoryNotFoundException
public long[] getMessageIDsByThreadIDAndFilter(long threadID, ResultFilter filter) throws ForumThreadNotFoundException
ForumMessageService
getMessageIDsByThreadIDAndFilter
in interface ForumMessageService
threadID
- The ID of the thread to find messages for.filter
- The filter to apply to the results.
ForumThreadNotFoundException
public ForumMessage[] getMessagesByThreadIDAndFilter(long threadID, ResultFilter filter) throws ForumThreadNotFoundException
ForumMessageService
getMessagesByThreadIDAndFilter
in interface ForumMessageService
threadID
- The ID of the thread to find messages for.filter
- The filter to apply to the results.
ForumThreadNotFoundException
public long[] getMessageIDsByThreadID(long threadID) throws ForumThreadNotFoundException
ForumMessageService
WSConstants.MAX_MESSAGE_RESULTS
than then message IDs up to
WSConstants.MAX_MESSAGE_RESULTS
will be returned.
getMessageIDsByThreadID
in interface ForumMessageService
threadID
- The ID of the thread to find message IDs for.
ForumThreadNotFoundException
public ForumMessage[] getMessagesByThreadID(long threadID) throws ForumThreadNotFoundException
ForumMessageService
WSConstants.MAX_MESSAGE_RESULTS
than then message IDs up to
WSConstants.MAX_MESSAGE_RESULTS
will be returned.
getMessagesByThreadID
in interface ForumMessageService
threadID
- The ID of the thread to find message IDs for.
ForumThreadNotFoundException
public int getMessageCountByThreadIDAndFilter(long threadID, ResultFilter filter) throws ForumThreadNotFoundException
ForumMessageService
getMessageCountByThreadIDAndFilter
in interface ForumMessageService
threadID
- The ID of the thread to find the message count for.filter
- The filter that can be applied to filter out results.
ForumThreadNotFoundException
public int getMessageCountByThreadID(long threadID) throws ForumThreadNotFoundException
ForumMessageService
getMessageCountByThreadID
in interface ForumMessageService
threadID
- The ID of the thread to find the message count for.
ForumThreadNotFoundException
public void setProperty(java.lang.String name, java.lang.String value, long messageID) throws ForumMessageNotFoundException
ForumMessageService
setProperty
in interface ForumMessageService
name
- The name of the property.value
- The value of the property.messageID
- The ID of the message to set an extended property for.
ForumMessageNotFoundException
public java.lang.String getProperty(java.lang.String name, long messageID) throws ForumMessageNotFoundException
ForumMessageService
getProperty
in interface ForumMessageService
name
- The name of the property.messageID
- The ID of the message to retrieve the property for.
ForumMessageNotFoundException
public void deleteProperty(java.lang.String name, long messageID) throws ForumMessageNotFoundException
ForumMessageService
deleteProperty
in interface ForumMessageService
name
- The name of the property to delete.messageID
- The ID of the message to delete the property from.
ForumMessageNotFoundException
public Property[] getUnfilteredProperties(long messageID) throws ForumMessageNotFoundException
ForumMessageService
getUnfilteredProperties
in interface ForumMessageService
messageID
- The ID of the message to return unfiltered properties for.
ForumMessageNotFoundException
public javax.activation.DataSource[] getAttachmentsByMessageID(long messageID) throws ForumMessageNotFoundException
ForumMessageService
getAttachmentsByMessageID
in interface ForumMessageService
messageID
- The ID of the message to acquire attachments for.
ForumMessageNotFoundException
public void addAttachmentToMessage(java.lang.String name, javax.activation.DataSource source, long messageID) throws AttachmentException, ForumMessageNotFoundException, java.io.IOException
ForumMessageService
addAttachmentToMessage
in interface ForumMessageService
name
- The name of the attachment.source
- The content for the attachment.messageID
- The ID of the message.
AttachmentException
ForumMessageNotFoundException
java.io.IOException
public ForumMessage getRootMessage(long threadID) throws ForumThreadNotFoundException
ForumMessageService
getRootMessage
in interface ForumMessageService
threadID
- The ID of the thread.
ForumThreadNotFoundException
public boolean hasParent(long messageID) throws ForumMessageNotFoundException
ForumMessageService
child
message has a parent message.
hasParent
in interface ForumMessageService
messageID
- the message.
ForumMessageNotFoundException
public ForumMessage getParent(long messageID) throws ForumMessageNotFoundException
ForumMessageService
child
ForumMessage.
getParent
in interface ForumMessageService
messageID
- The ID of the message to find the parent for.
ForumMessageNotFoundException
- if child does not have a parent,
or if the parent message could not be loaded for any other reason.public ForumMessage getChild(long messageID, int index) throws ForumMessageNotFoundException
ForumMessageService
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.
getChild
in interface ForumMessageService
messageID
- The ID of the parent message.index
- the index of the child.
ForumMessageNotFoundException
- if the index was invalid or the
child could not be loaded for any other reason.public ForumMessage[] getChildren(long messageID) throws ForumMessageNotFoundException
ForumMessageService
ForumMessageService.getRecursiveChildren(long)
method.
getChildren
in interface ForumMessageService
messageID
- The parent message.
ForumMessageNotFoundException
public ForumMessage[] getRecursiveChildren(long messageID) throws ForumMessageNotFoundException
ForumMessageService
1 |-- 3 |-- |-- 4 |-- |-- |-- 7 |-- |-- |-- |-- 10 |-- |-- 6 |-- |-- 8 |-- 5Calling 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.
getRecursiveChildren
in interface ForumMessageService
messageID
- The ID of the parent message.
ForumMessageNotFoundException
public boolean isLeaf(long messageID) throws ForumMessageNotFoundException
ForumMessageService
isLeaf
in interface ForumMessageService
messageID
- A node in the thread, obtained from this data source.
ForumMessageNotFoundException
public int getRecursiveChildCount(long messageID) throws ForumMessageNotFoundException
ForumMessageService
getRecursiveChildCount
in interface ForumMessageService
messageID
- The ID of the message.
parent
.
ForumMessageNotFoundException
public int getIndexOfChild(long parentID, long messageID) throws ForumMessageNotFoundException
ForumMessageService
4 |-- 2 |-- |-- 1 |-- |-- 6 |-- |-- 8 |-- 5In 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
getIndexOfChild
in interface ForumMessageService
parentID
- The ID of the parent message.messageID
- The ID of the child message to get the index for.
ForumMessageNotFoundException
public int getMessageDepth(long messageID) throws ForumMessageNotFoundException
ForumMessageService
1 |-- 3 |-- |-- 4 |-- |-- |-- 7The 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.
getMessageDepth
in interface ForumMessageService
messageID
- The ID of the message to determine the depth of.
ForumMessageNotFoundException
public int getChildCount(long messageID) throws ForumMessageNotFoundException
ForumMessageService
getChildCount
in interface ForumMessageService
messageID
- The ID the message.
ForumMessageNotFoundException
public ForumMessage[] getRecursiveMessages(long threadID) throws ForumThreadNotFoundException
ForumMessageService
1 |-- 3 |-- |-- 4 |-- |-- |-- 7 |-- |-- |-- |-- 10 |-- |-- 6 |-- |-- 8 |-- 5Calling 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.
getRecursiveMessages
in interface ForumMessageService
threadID
- The ID of the thread.
ForumThreadNotFoundException
public void updateForumMessage(ForumMessage message) throws ForumMessageNotFoundException, MessageRejectedException
ForumMessageService
ForumMessage
updateForumMessage
in interface ForumMessageService
message
- The message to update
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 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |