Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices.server
Class WatchServiceImpl

java.lang.Object
  extended by com.jivesoftware.forum.webservices.server.WatchServiceImpl
All Implemented Interfaces:
WatchService

public class WatchServiceImpl
extends java.lang.Object
implements WatchService


Field Summary
 
Fields inherited from interface com.jivesoftware.forum.webservices.WatchService
OBJECT_FORUM, OBJECT_FORUM_CATEGORY, OBJECT_THREAD, OBJECT_USER
 
Constructor Summary
WatchServiceImpl()
           
 
Method Summary
 Watch createCategoryWatch(long userID, long categoryID)
          Create a watch on a category for the specified user.
 Watch createForumWatch(long userID, long forumID)
          Create a watch on a forum for the user with the specified ID.
 Watch createThreadWatch(long userID, long threadID)
          Create a watch on a thread for the specified user.
 Watch createUserWatch(long userID, long watchedUserID)
          Create a watch on a user for the specified user.
 void deleteWatch(Watch watch)
          Delete the specified watch.
 void deleteWatches(long userID)
          Deletes all watches that a user has.
 Watch getCategoryWatch(long userID, long categoryID)
          Returns a watch on a particular category, or null if there isn't a watch.
 int getCategoryWatchCount(long userID, long categoryID)
          Return the count of all forum watches in a particular categoryID for the given userID.
 long[] getCategoryWatches(long userID, long categoryID)
          Returns an array of IDs for all the forum objects a user is watching in a category.
 Forum[] getCategoryWatchObjects(long userID, long categoryID, int startIndex, int numResults)
          Returns Forums that the user is watching for a given category.
 int getDeleteDays()
          Returns the number of days that a watched object can remain inactive before watches on that object are deleted.
 ForumThread[] getForumThreadWatchesByCategory(long userID, long categoryID, int startIndex, int numResults)
          Returns ForumThreads that the user is watching for all the Forums under the given Category.
 Watch getForumWatch(long userID, long forumID)
          Returns a watch on a particular forum, or null if there isn't a watch.
 int getForumWatchCount(long userID, long forumID)
          Return the count of all thread watches in a particular forumID for the given user.
 long[] getForumWatches(long userID, long forumID)
          Returns an array of IDs for the threads a user is watching in a forum.
 ForumThread[] getForumWatchObjects(long userID, long forumID, int startIndex, int numResults)
          Returns ForumThreads that the user is watching for a given Forum.
 int getRecursiveForumThreadWatchCountByCategory(long userID, long categoryID)
          Return the count of all thread watches in a particular categoryID for the given user.
 ForumThread[] getRecursiveForumThreadWatchesByCategory(long userID, long categoryID, int startIndex, int numResults)
          Returns ForumThreads that the user is watching for all the Forums under the given Category.
 int getRecursiveForumWatchCountByCategory(long userID, long categoryID)
          Return the count of all forum watches in a particular categoryID for the given userID.
 Forum[] getRecursiveForumWatchesByCategory(long userID, long categoryID, int startIndex, int numResults)
          Returns Forums that the user is watching for a given category and all of its subcategories.
 Watch getThreadWatch(long userID, long threadID)
          Returns a watch on a particular thread, or null if there isn't a watch.
 int getTotalWatchCount(long userID, int objectType)
          Returns a count of all watches that a userID has of a particular type.
 Watch getUserWatch(long userID, long watchedUserID)
          Returns a watch on a particular user, or null if there isn't a watch.
 User[] getWatchers(int objectType, long objectID)
          Returns the Users who are watching the specified object.
 Watch[] getWatchList(long userID, int objectType)
          Returns an array of Watch objects for a particular object type that the given user is watching.
 boolean isCategoryWatched(long userID, long categoryID)
          Returns true if the user is watching the specified category.
 boolean isForumWatched(long userID, long forumID)
          Returns true if the user is watching the specified forum.
 boolean isThreadWatched(long userID, long threadID)
          Returns true if the user is watching the specified thread.
 boolean isUserWatched(long userID, long watchedUserID)
          Returns true if the user is watching the specified user.
 void setDeleteDays(int deleteDays)
          Sets the number of days that a watched object can remain inactive before watches on that object are deleted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatchServiceImpl

public WatchServiceImpl()
Method Detail

getDeleteDays

public int getDeleteDays()
Description copied from interface: WatchService
Returns the number of days that a watched object can remain inactive before watches on that object are deleted.

Specified by:
getDeleteDays in interface WatchService
Returns:
the number of days a watched object can be inactive before watches on it are deleted.

setDeleteDays

public void setDeleteDays(int deleteDays)
Description copied from interface: WatchService
Sets the number of days that a watched object can remain inactive before watches on that object are deleted.

Specified by:
setDeleteDays in interface WatchService
Parameters:
deleteDays - The number days a watch can be inactive before being automatically deleted.

createUserWatch

public Watch createUserWatch(long userID,
                             long watchedUserID)
                      throws UserNotFoundException
Description copied from interface: WatchService
Create a watch on a user for the specified user.

Specified by:
createUserWatch in interface WatchService
Parameters:
userID - The ID of the user to set the watch for.
watchedUserID - The ID of the user to watch.
Returns:
The newly created watch.
Throws:
UserNotFoundException

createThreadWatch

public Watch createThreadWatch(long userID,
                               long threadID)
                        throws UserNotFoundException,
                               ForumThreadNotFoundException
Description copied from interface: WatchService
Create a watch on a thread for the specified user.

Specified by:
createThreadWatch in interface WatchService
Parameters:
userID - The ID of the user to set the watch for.
threadID - The ID of thread to watch.
Returns:
The newly created watch.
Throws:
UserNotFoundException
ForumThreadNotFoundException

createForumWatch

public Watch createForumWatch(long userID,
                              long forumID)
                       throws UserNotFoundException,
                              ForumNotFoundException
Description copied from interface: WatchService
Create a watch on a forum for the user with the specified ID.

Specified by:
createForumWatch in interface WatchService
Parameters:
userID - The ID of the user to set a watch for.
forumID - The ID of the forum to watch.
Returns:
The newly created watch.
Throws:
UserNotFoundException
ForumNotFoundException

createCategoryWatch

public Watch createCategoryWatch(long userID,
                                 long categoryID)
                          throws UserNotFoundException,
                                 ForumCategoryNotFoundException
Description copied from interface: WatchService
Create a watch on a category for the specified user.

Specified by:
createCategoryWatch in interface WatchService
Parameters:
userID - The ID of the user to set the watch for.
categoryID - The ID of the category to watch.
Returns:
The newly created watch.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getForumWatchCount

public int getForumWatchCount(long userID,
                              long forumID)
                       throws UserNotFoundException,
                              ForumNotFoundException
Description copied from interface: WatchService
Return the count of all thread watches in a particular forumID for the given user.

Specified by:
getForumWatchCount in interface WatchService
Parameters:
userID - The ID of the user to return the watch count for.
forumID - The ID of the forum to get the watch count for.
Returns:
The count of thread watches for a user in a given forum.
Throws:
UserNotFoundException
ForumNotFoundException

getCategoryWatchCount

public int getCategoryWatchCount(long userID,
                                 long categoryID)
                          throws UserNotFoundException,
                                 ForumCategoryNotFoundException
Description copied from interface: WatchService
Return the count of all forum watches in a particular categoryID for the given userID.

Specified by:
getCategoryWatchCount in interface WatchService
Parameters:
userID - The userID to return the watch count for.
categoryID - The categoryID to return the watch count for.
Returns:
The count of forum watches for a userID in a given categoryID.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getTotalWatchCount

public int getTotalWatchCount(long userID,
                              int objectType)
                       throws UserNotFoundException
Description copied from interface: WatchService
Returns a count of all watches that a userID has of a particular type. Valid object types are:

Specified by:
getTotalWatchCount in interface WatchService
Parameters:
userID - The ID of the user to get the watch count for.
objectType - The object type to get a watch count for.
Returns:
The total number of watches that a userID has of type objectType.
Throws:
UserNotFoundException

getWatchList

public Watch[] getWatchList(long userID,
                            int objectType)
                     throws UserNotFoundException
Description copied from interface: WatchService
Returns an array of Watch objects for a particular object type that the given user is watching. Valid objectType's are:

Specified by:
getWatchList in interface WatchService
Parameters:
userID - the userID to retrieve watches for
objectType - the object type.
Returns:
An array of the user's watches corresponding to an object type.
Throws:
UserNotFoundException

getForumWatches

public long[] getForumWatches(long userID,
                              long forumID)
                       throws UserNotFoundException,
                              ForumNotFoundException
Description copied from interface: WatchService
Returns an array of IDs for the threads a user is watching in a forum.

Specified by:
getForumWatches in interface WatchService
Parameters:
userID - The ID of the user.
forumID - The ID of the forum.
Returns:
an array of thread IDs.
Throws:
UserNotFoundException
ForumNotFoundException

getCategoryWatches

public long[] getCategoryWatches(long userID,
                                 long categoryID)
                          throws UserNotFoundException,
                                 ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns an array of IDs for all the forum objects a user is watching in a category.

Specified by:
getCategoryWatches in interface WatchService
Parameters:
userID - The ID of the user.
categoryID - The ID of the category.
Returns:
An array of forum IDs.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getUserWatch

public Watch getUserWatch(long userID,
                          long watchedUserID)
                   throws UserNotFoundException
Description copied from interface: WatchService
Returns a watch on a particular user, or null if there isn't a watch.

Specified by:
getUserWatch in interface WatchService
Parameters:
userID - the userID with the watch.
watchedUserID - the userID being watched.
Returns:
the Watch or null if the watchedUserID isn't being watched by the userID.
Throws:
UserNotFoundException

getThreadWatch

public Watch getThreadWatch(long userID,
                            long threadID)
                     throws UserNotFoundException,
                            ForumThreadNotFoundException
Description copied from interface: WatchService
Returns a watch on a particular thread, or null if there isn't a watch.

Specified by:
getThreadWatch in interface WatchService
Parameters:
userID - The ID of the user with the watch.
threadID - The ID of the thread being watched.
Returns:
The Watch or null if the thread isn't being watched by the user.
Throws:
UserNotFoundException
ForumThreadNotFoundException

getForumWatch

public Watch getForumWatch(long userID,
                           long forumID)
                    throws UserNotFoundException,
                           ForumNotFoundException
Description copied from interface: WatchService
Returns a watch on a particular forum, or null if there isn't a watch.

Specified by:
getForumWatch in interface WatchService
Parameters:
userID - The ID of the user.
forumID - The ID of the forum.
Returns:
The Watch or null if the forum isn't being watched by the user.
Throws:
UserNotFoundException
ForumNotFoundException

getCategoryWatch

public Watch getCategoryWatch(long userID,
                              long categoryID)
                       throws UserNotFoundException,
                              ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns a watch on a particular category, or null if there isn't a watch.

Specified by:
getCategoryWatch in interface WatchService
Parameters:
userID - The ID of the user to acquire a watch for.
categoryID - The ID of the category to acquire the watch for.
Returns:
The Watch or null if the category isn't being watched by the user.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

isCategoryWatched

public boolean isCategoryWatched(long userID,
                                 long categoryID)
                          throws UserNotFoundException,
                                 ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns true if the user is watching the specified category.

Specified by:
isCategoryWatched in interface WatchService
Parameters:
userID - The ID of the user.
categoryID - The ID of the category.
Returns:
True if the object is being watched by the user, false otherwise.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

isForumWatched

public boolean isForumWatched(long userID,
                              long forumID)
                       throws UserNotFoundException,
                              ForumNotFoundException
Description copied from interface: WatchService
Returns true if the user is watching the specified forum.

Specified by:
isForumWatched in interface WatchService
Parameters:
userID - The ID of the user.
forumID - The ID of the forum.
Returns:
True if the object is being watched by the user, false otherwise.
Throws:
UserNotFoundException
ForumNotFoundException

isThreadWatched

public boolean isThreadWatched(long userID,
                               long threadID)
                        throws UserNotFoundException,
                               ForumThreadNotFoundException
Description copied from interface: WatchService
Returns true if the user is watching the specified thread.

Specified by:
isThreadWatched in interface WatchService
Parameters:
userID - The ID of the user.
threadID - The ID of the thread.
Returns:
True if the object is being watched by the user, false otherwise.
Throws:
UserNotFoundException
ForumThreadNotFoundException

isUserWatched

public boolean isUserWatched(long userID,
                             long watchedUserID)
                      throws UserNotFoundException
Description copied from interface: WatchService
Returns true if the user is watching the specified user.

Specified by:
isUserWatched in interface WatchService
Parameters:
userID - The ID of the user.
watchedUserID - The ID of the watched user.
Returns:
True if the object is being watched by the user, false otherwise.
Throws:
UserNotFoundException

deleteWatch

public void deleteWatch(Watch watch)
                 throws UserNotFoundException,
                        ForumNotFoundException,
                        ForumCategoryNotFoundException,
                        ForumThreadNotFoundException
Description copied from interface: WatchService
Delete the specified watch.

Specified by:
deleteWatch in interface WatchService
Parameters:
watch - The watch to delete.
Throws:
UserNotFoundException
ForumNotFoundException
ForumCategoryNotFoundException
ForumThreadNotFoundException

deleteWatches

public void deleteWatches(long userID)
                   throws UserNotFoundException
Description copied from interface: WatchService
Deletes all watches that a user has.

Specified by:
deleteWatches in interface WatchService
Parameters:
userID - The ID of the user.
Throws:
UserNotFoundException

getWatchers

public User[] getWatchers(int objectType,
                          long objectID)
Description copied from interface: WatchService
Returns the Users who are watching the specified object.

Specified by:
getWatchers in interface WatchService
Parameters:
objectType - the object type.
objectID - the object ID
Returns:
the users watching the specified object.

getForumWatchObjects

public ForumThread[] getForumWatchObjects(long userID,
                                          long forumID,
                                          int startIndex,
                                          int numResults)
                                   throws UserNotFoundException,
                                          ForumNotFoundException
Description copied from interface: WatchService
Returns ForumThreads that the user is watching for a given Forum. This also allows the users to define the offset and number of records returned. Enter 0 for startIndex and Integer.MAX_VALUE to return all results

Specified by:
getForumWatchObjects in interface WatchService
Parameters:
userID - The ID of the user.
forumID - The ID of the forum.
startIndex - The offset.
numResults - The max number of results returned.
Returns:
Array of ForumThread objects meeting the criteria.
Throws:
UserNotFoundException
ForumNotFoundException

getCategoryWatchObjects

public Forum[] getCategoryWatchObjects(long userID,
                                       long categoryID,
                                       int startIndex,
                                       int numResults)
                                throws UserNotFoundException,
                                       ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns Forums that the user is watching for a given category. This also allows the users to define the offset and number of records returned. Enter 0 for startIndex and Integer.MAX_VALUE to return all results.

For recursive Forum watches for a given category, use getRecursiveForumWatchesByCategory.

Specified by:
getCategoryWatchObjects in interface WatchService
Parameters:
userID - The ID of the user.
categoryID - The ID of the category.
startIndex - The offset.
numResults - The max number of results returned.
Returns:
Array of Forums meeting the criteria.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getForumThreadWatchesByCategory

public ForumThread[] getForumThreadWatchesByCategory(long userID,
                                                     long categoryID,
                                                     int startIndex,
                                                     int numResults)
                                              throws UserNotFoundException,
                                                     ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns ForumThreads that the user is watching for all the Forums under the given Category. Does not recurse through subcategories.

Specify 0 for startIndex and Integer.MAX_VALUE to return all results.

Specified by:
getForumThreadWatchesByCategory in interface WatchService
Parameters:
userID - The ID of the user.
categoryID - The ID of the category.
startIndex - The offset.
numResults - The max number of results returned.
Returns:
Array of ForumThread objects meeting the criteria.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getRecursiveForumThreadWatchesByCategory

public ForumThread[] getRecursiveForumThreadWatchesByCategory(long userID,
                                                              long categoryID,
                                                              int startIndex,
                                                              int numResults)
                                                       throws UserNotFoundException,
                                                              ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns ForumThreads that the user is watching for all the Forums under the given Category. Does not recurse through subcategories.

Specify 0 for startIndex and Integer.MAX_VALUE to return all results.

Specified by:
getRecursiveForumThreadWatchesByCategory in interface WatchService
Parameters:
userID - The ID of the user.
categoryID - The ID of the category.
startIndex - The offset.
numResults - The max number of results returned.
Returns:
Array of ForumThread objects meeting the criteria.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getRecursiveForumWatchesByCategory

public Forum[] getRecursiveForumWatchesByCategory(long userID,
                                                  long categoryID,
                                                  int startIndex,
                                                  int numResults)
                                           throws UserNotFoundException,
                                                  ForumCategoryNotFoundException
Description copied from interface: WatchService
Returns Forums that the user is watching for a given category and all of its subcategories.

Specified by:
getRecursiveForumWatchesByCategory in interface WatchService
Parameters:
userID - The ID of the user.
categoryID - The ID of the category.
startIndex - The offset.
numResults - The max number of results returned.
Returns:
Array of Forums meeting the criteria.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getRecursiveForumThreadWatchCountByCategory

public int getRecursiveForumThreadWatchCountByCategory(long userID,
                                                       long categoryID)
                                                throws UserNotFoundException,
                                                       ForumCategoryNotFoundException
Description copied from interface: WatchService
Return the count of all thread watches in a particular categoryID for the given user.

Specified by:
getRecursiveForumThreadWatchCountByCategory in interface WatchService
Parameters:
userID - The ID of the user to return the watch count for.
categoryID - The ID of the category.
Returns:
The count of thread watches for a user in a given category.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

getRecursiveForumWatchCountByCategory

public int getRecursiveForumWatchCountByCategory(long userID,
                                                 long categoryID)
                                          throws UserNotFoundException,
                                                 ForumCategoryNotFoundException
Description copied from interface: WatchService
Return the count of all forum watches in a particular categoryID for the given userID.

Specified by:
getRecursiveForumWatchCountByCategory in interface WatchService
Parameters:
userID - The ID of the user to return the watch count for.
categoryID - The ID of the category.
Returns:
The count of forum watches for a user in a given category.
Throws:
UserNotFoundException
ForumCategoryNotFoundException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.