Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices.server
Class ContentServiceImpl

java.lang.Object
  extended by com.jivesoftware.forum.webservices.server.ContentServiceImpl
All Implemented Interfaces:
ContentService

public class ContentServiceImpl
extends java.lang.Object
implements ContentService


Constructor Summary
ContentServiceImpl()
           
 
Method Summary
 int countMessageSearchResults(Query query)
          Returns the number of possible results for the specified query.
 int countMessageSearchResultsByCategoryID(long categoryID, Query query)
          Returns the number of possible results for the specified query by category.
 int countMessageSearchResultsByForumID(long forumID, Query query)
          Returns the number of results for the specified query for a forum.
 int countQuickMessageSearchResults(java.lang.String query)
          Returns the number of possible results for the specified query.
 int countQuickMessageSearchResultsByCategoryID(long categoryID, java.lang.String query)
          Returns the number of possible results for the specified query.
 ForumMessage createMessage(java.lang.String subject, java.lang.String body, long threadID, long userID)
          Creates a new message on the given thread.
 ForumMessage createReplyMessage(java.lang.String subject, java.lang.String body, long messageID, long userID)
          Creates a new message that is a direct response to a given message.
 ForumThread createThread(java.lang.String subject, java.lang.String body, long forumID, long userID)
          Creates a new thread.
 Forum getForum(long forumID)
          Returns a Forum by its id.
 ForumCategory getForumCategory(long categoryID)
          Returns a ForumCategory by its id.
 ForumMessage getForumMessage(long messageID)
          Returns a ForumMessage by its id.
 ForumThread getForumThread(long threadID)
          Returns a ForumThread by its id.
 int getMessageCountByUserID(long userID)
          Returns the number of messages for created by the given userID.
 ForumMessage[] getMessagesByUserID(long userID)
          Returns all the messages created by the given userID.
 long[] messageSearch(Query query, int startIndex, int numResults)
          Provides the ability to create complex search queries with the ability to change sorting, filtering, etc.
 long[] messageSearchByCategories(long categoryID, Query query, int startIndex, int numResults)
          Provides the ability to create complex search queries with the ability to change sorting, filtering, etc. all by category.
 ForumMessage[] messageSearchByCategoriesForObjects(long categoryID, Query query, int startIndex, int numResults)
          Provides the ability to create complex search queries with the ability to change sorting, filtering, etc. all by category.
 long[] messageSearchByForum(long forumID, Query query, int startIndex, int numResults)
          Provides the ability to perform a search query for messages within a forum.
 ForumMessage[] messageSearchByForumForObjects(long forumID, Query query, int startIndex, int numResults)
          Provides the ability to perform a search query for messages within a forum.
 ForumMessage[] messageSearchForObjects(Query query, int startIndex, int numResults)
          Provides the ability to create complex search queries with the ability to change sorting, filtering, etc.
 long[] quickMessageSearch(java.lang.String query, int startIndex, int numResults)
          Provides the ability to do quick search queries based on the provided string.
 long[] quickMessageSearchByCategoryID(long categoryID, java.lang.String query, int startIndex, int numResults)
          Provides the ability to do quick search queries based on the provided string.
 ForumMessage[] quickMessageSearchByCategoryIDForObjects(long categoryID, java.lang.String query, int startIndex, int numResults)
          Provides the ability to do quick search queries based on the provided string.
 ForumMessage[] quickMessageSearchForObjects(java.lang.String query, int startIndex, int numResults)
          Provides the ability to do quick search queries based on the provided string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentServiceImpl

public ContentServiceImpl()
Method Detail

getForum

public Forum getForum(long forumID)
               throws ForumNotFoundException
Description copied from interface: ContentService
Returns a Forum by its id.

Specified by:
getForum in interface ContentService
Parameters:
forumID - the id of the forum.
Returns:
the Forum object matching the id.
Throws:
ForumNotFoundException

getForumCategory

public ForumCategory getForumCategory(long categoryID)
                               throws ForumCategoryNotFoundException
Description copied from interface: ContentService
Returns a ForumCategory by its id.

Specified by:
getForumCategory in interface ContentService
Parameters:
categoryID - id of the category.
Returns:
the ForumCategory object the id.
Throws:
ForumCategoryNotFoundException

getForumThread

public ForumThread getForumThread(long threadID)
                           throws ForumThreadNotFoundException
Description copied from interface: ContentService
Returns a ForumThread by its id.

Specified by:
getForumThread in interface ContentService
Parameters:
threadID - id of the thread.
Returns:
the ForumThread object by the id.
Throws:
ForumThreadNotFoundException

getForumMessage

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

Specified by:
getForumMessage in interface ContentService
Parameters:
messageID - id of the message.
Returns:
the ForumMessage object by the id.
Throws:
ForumMessageNotFoundException

createThread

public ForumThread createThread(java.lang.String subject,
                                java.lang.String body,
                                long forumID,
                                long userID)
                         throws UserNotFoundException,
                                ForumNotFoundException,
                                MessageRejectedException
Description copied from interface: ContentService
Creates a new thread.

Specified by:
createThread in interface ContentService
Parameters:
subject - Subject used in creation of the thread.
body - Body used in creation of the thread.
forumID - The forum to create a new thread in.
userID - The user to create this message as. Use a number less than zero for anonymous.
Returns:
The newly created thread.
Throws:
UserNotFoundException
ForumNotFoundException
MessageRejectedException

createMessage

public ForumMessage createMessage(java.lang.String subject,
                                  java.lang.String body,
                                  long threadID,
                                  long userID)
                           throws ForumThreadNotFoundException,
                                  UserNotFoundException,
                                  MessageRejectedException
Description copied from interface: ContentService
Creates a new message on the given thread.

If userID is a value less than one then the message will be created for an anonymous user.

Specified by:
createMessage in interface ContentService
Parameters:
subject - Subject used in creation of the thread.
body - Body used in creation of the thread.
threadID - Thread to create the message too.
userID - The user to create this message as. Use a number less than zero for anonymous.
Returns:
The newly created message.
Throws:
ForumThreadNotFoundException
UserNotFoundException
MessageRejectedException

createReplyMessage

public ForumMessage createReplyMessage(java.lang.String subject,
                                       java.lang.String body,
                                       long messageID,
                                       long userID)
                                throws ForumMessageNotFoundException,
                                       MessageRejectedException,
                                       UserNotFoundException
Description copied from interface: ContentService
Creates a new message that is a direct response to a given message.

If userID is a value less than one then the message will be created for an anonymous user.

Specified by:
createReplyMessage in interface ContentService
Parameters:
subject - Subject used in creation of the thread.
body - Body used in creation of the thread.
messageID - The id of the message to respond too.
userID - The user to create this message as. Use a number less than zero for anonymous.
Returns:
The newly created message.
Throws:
ForumMessageNotFoundException
MessageRejectedException
UserNotFoundException

messageSearch

public long[] messageSearch(Query query,
                            int startIndex,
                            int numResults)
                     throws UserNotFoundException
Description copied from interface: ContentService
Provides the ability to create complex search queries with the ability to change sorting, filtering, etc.

Specified by:
messageSearch in interface ContentService
Parameters:
query - The query objects.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of message IDs.
Throws:
UserNotFoundException

messageSearchForObjects

public ForumMessage[] messageSearchForObjects(Query query,
                                              int startIndex,
                                              int numResults)
                                       throws ForumNotFoundException,
                                              ForumMessageNotFoundException,
                                              UserNotFoundException
Description copied from interface: ContentService
Provides the ability to create complex search queries with the ability to change sorting, filtering, etc.

Specified by:
messageSearchForObjects in interface ContentService
Parameters:
query - The query objects.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of ForumMessages.
Throws:
ForumNotFoundException
ForumMessageNotFoundException
UserNotFoundException

messageSearchByCategories

public long[] messageSearchByCategories(long categoryID,
                                        Query query,
                                        int startIndex,
                                        int numResults)
                                 throws ForumCategoryNotFoundException,
                                        UserNotFoundException
Description copied from interface: ContentService
Provides the ability to create complex search queries with the ability to change sorting, filtering, etc. all by category.

Specified by:
messageSearchByCategories in interface ContentService
Parameters:
categoryID - The id of the category
query - The query objects.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of message IDs.
Throws:
ForumCategoryNotFoundException - Thrown if the category does not exist
UserNotFoundException

messageSearchByCategoriesForObjects

public ForumMessage[] messageSearchByCategoriesForObjects(long categoryID,
                                                          Query query,
                                                          int startIndex,
                                                          int numResults)
                                                   throws ForumNotFoundException,
                                                          ForumCategoryNotFoundException,
                                                          ForumMessageNotFoundException,
                                                          UserNotFoundException
Description copied from interface: ContentService
Provides the ability to create complex search queries with the ability to change sorting, filtering, etc. all by category. Messages are indexed with a date resolution of one day. Any hour, minute, or second information in beforeDate and afterDate is ignored. Also, beforeDate and afterDate are inclusive. For example, if you only want the messages created on a particular day, you would set both beforeDate and afterDate to that day.

Specified by:
messageSearchByCategoriesForObjects in interface ContentService
Parameters:
categoryID - The id of the category
query - The query objects.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of ForumMessages.
Throws:
ForumCategoryNotFoundException - Thrown if the category does not exist
ForumNotFoundException
ForumMessageNotFoundException
UserNotFoundException

countMessageSearchResults

public int countMessageSearchResults(Query query)
                              throws UserNotFoundException
Description copied from interface: ContentService
Returns the number of possible results for the specified query.

Specified by:
countMessageSearchResults in interface ContentService
Parameters:
query - The query to find the number of results for.
Returns:
The number of search results.
Throws:
UserNotFoundException

countMessageSearchResultsByCategoryID

public int countMessageSearchResultsByCategoryID(long categoryID,
                                                 Query query)
                                          throws ForumCategoryNotFoundException,
                                                 UserNotFoundException
Description copied from interface: ContentService
Returns the number of possible results for the specified query by category.

Specified by:
countMessageSearchResultsByCategoryID in interface ContentService
Parameters:
categoryID - The id of the category.
query - The query to find the number of results for.
Returns:
The number of search results.
Throws:
ForumCategoryNotFoundException
UserNotFoundException

messageSearchByForum

public long[] messageSearchByForum(long forumID,
                                   Query query,
                                   int startIndex,
                                   int numResults)
                            throws ForumNotFoundException,
                                   UserNotFoundException
Description copied from interface: ContentService
Provides the ability to perform a search query for messages within a forum.

Specified by:
messageSearchByForum in interface ContentService
Parameters:
forumID - The id of the forum.
query - The query object.
startIndex - Starting point of results to return.
numResults - Ending point of results to return.
Returns:
An array of message IDs.
Throws:
ForumNotFoundException - Thrown if the forum does not exist
UserNotFoundException

messageSearchByForumForObjects

public ForumMessage[] messageSearchByForumForObjects(long forumID,
                                                     Query query,
                                                     int startIndex,
                                                     int numResults)
                                              throws ForumNotFoundException,
                                                     ForumMessageNotFoundException,
                                                     UserNotFoundException
Description copied from interface: ContentService
Provides the ability to perform a search query for messages within a forum.

Specified by:
messageSearchByForumForObjects in interface ContentService
Parameters:
forumID - The id of the forum.
query - The query object.
startIndex - Starting point of results to return.
numResults - Ending point of results to return.
Returns:
An array of ForumMessages.
Throws:
ForumNotFoundException - Thrown if the forum does not exist
ForumMessageNotFoundException
UserNotFoundException

countMessageSearchResultsByForumID

public int countMessageSearchResultsByForumID(long forumID,
                                              Query query)
                                       throws ForumNotFoundException,
                                              UserNotFoundException
Description copied from interface: ContentService
Returns the number of results for the specified query for a forum.

Specified by:
countMessageSearchResultsByForumID in interface ContentService
Parameters:
forumID - The id of the forum.
query - The query object.
Returns:
The number of search results.
Throws:
ForumNotFoundException - Thrown if the forum does not exist
UserNotFoundException

quickMessageSearch

public long[] quickMessageSearch(java.lang.String query,
                                 int startIndex,
                                 int numResults)
Description copied from interface: ContentService
Provides the ability to do quick search queries based on the provided string.

Specified by:
quickMessageSearch in interface ContentService
Parameters:
query - The query string.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of message IDs.

quickMessageSearchForObjects

public ForumMessage[] quickMessageSearchForObjects(java.lang.String query,
                                                   int startIndex,
                                                   int numResults)
                                            throws ForumMessageNotFoundException
Description copied from interface: ContentService
Provides the ability to do quick search queries based on the provided string.

Specified by:
quickMessageSearchForObjects in interface ContentService
Parameters:
query - The query string.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of ForumMessages.
Throws:
ForumMessageNotFoundException

quickMessageSearchByCategoryID

public long[] quickMessageSearchByCategoryID(long categoryID,
                                             java.lang.String query,
                                             int startIndex,
                                             int numResults)
                                      throws ForumCategoryNotFoundException
Description copied from interface: ContentService
Provides the ability to do quick search queries based on the provided string.

Specified by:
quickMessageSearchByCategoryID in interface ContentService
Parameters:
categoryID - The id of the category.
query - The query string.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of message IDs.
Throws:
ForumCategoryNotFoundException

quickMessageSearchByCategoryIDForObjects

public ForumMessage[] quickMessageSearchByCategoryIDForObjects(long categoryID,
                                                               java.lang.String query,
                                                               int startIndex,
                                                               int numResults)
                                                        throws ForumCategoryNotFoundException,
                                                               ForumMessageNotFoundException
Description copied from interface: ContentService
Provides the ability to do quick search queries based on the provided string.

Specified by:
quickMessageSearchByCategoryIDForObjects in interface ContentService
Parameters:
categoryID - The id of the category.
query - The query string.
startIndex - Starting point of results to grab.
numResults - Ending point of results to grab.
Returns:
An array of ForumMessages.
Throws:
ForumCategoryNotFoundException
ForumMessageNotFoundException

countQuickMessageSearchResults

public int countQuickMessageSearchResults(java.lang.String query)
Description copied from interface: ContentService
Returns the number of possible results for the specified query.

Specified by:
countQuickMessageSearchResults in interface ContentService
Parameters:
query - The query to find the number of results for.
Returns:
The number of search results.

countQuickMessageSearchResultsByCategoryID

public int countQuickMessageSearchResultsByCategoryID(long categoryID,
                                                      java.lang.String query)
                                               throws ForumCategoryNotFoundException
Description copied from interface: ContentService
Returns the number of possible results for the specified query.

Specified by:
countQuickMessageSearchResultsByCategoryID in interface ContentService
Parameters:
categoryID - The id of the category.
query - The query to find the number of results for.
Returns:
The number of search results.
Throws:
ForumCategoryNotFoundException

getMessageCountByUserID

public int getMessageCountByUserID(long userID)
                            throws UserNotFoundException
Description copied from interface: ContentService
Returns the number of messages for created by the given userID.

Specified by:
getMessageCountByUserID in interface ContentService
Parameters:
userID - The id of the user.
Returns:
the number of messages created by the given userID.
Throws:
UserNotFoundException

getMessagesByUserID

public ForumMessage[] getMessagesByUserID(long userID)
                                   throws UserNotFoundException
Description copied from interface: ContentService
Returns all the messages created by the given userID.

Specified by:
getMessagesByUserID in interface ContentService
Parameters:
userID - The id of the user.
Returns:
An array of ForumMessages created by the userID.
Throws:
UserNotFoundException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.