Clearspace API (1.10.16) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface WatchService


public interface WatchService

A service for manipulating a user's watches on objects.


Field Summary
static int OBJECT_COMMUNITY
          An integer representing Community objects.
static int OBJECT_THREAD
          An integer representing Forum Thread objects.
static int OBJECT_USER
          An integer representing User objects.
 
Method Summary
 Watch createCommunityWatch(long userID, long communityID)
          Create a watch on a community for the specified user.
 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 getCommunityWatch(long userID, long communityID)
          Returns a watch on a particular community, or null if there isn't a watch.
 int getCommunityWatchCount(long userID, long communityID)
          Return the count of all community watches in a particular communityID for the given userID.
 long[] getCommunityWatches(long userID, long communityID)
          Returns an array of IDs for all the community objects a user is watching in a community.
 int getDeleteDays()
          Returns the number of days that a watched object can remain inactive before watches on that object are deleted.
 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.
 Watch[] getWatchList(long userID, int objectType)
          Returns an array of Watch objects for a particular object type that the given user is watching.
 User[] getWatchUsers(int objectType, long objectID, int watchType)
          Returns all the users who are watching this objectType and objectID.
 boolean isCommunityWatched(long userID, long communityID)
          Returns true if the user is watching the specified community.
 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.
 

Field Detail

OBJECT_THREAD

static final int OBJECT_THREAD
An integer representing Forum Thread objects.

See Also:
Constant Field Values

OBJECT_COMMUNITY

static final int OBJECT_COMMUNITY
An integer representing Community objects.

See Also:
Constant Field Values

OBJECT_USER

static final int OBJECT_USER
An integer representing User objects.

See Also:
Constant Field Values
Method Detail

getDeleteDays

int getDeleteDays()
Returns the number of days that a watched object can remain inactive before watches on that object are deleted.

Returns:
the number of days a watched object can be inactive before watches on it are deleted.

setDeleteDays

void setDeleteDays(int deleteDays)
Sets the number of days that a watched object can remain inactive before watches on that object are deleted.

Parameters:
deleteDays - The number days a watch can be inactive before being automatically deleted.

createUserWatch

Watch createUserWatch(long userID,
                      long watchedUserID)
                      throws UserNotFoundException
Create a watch on a user for the specified user.

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

Watch createThreadWatch(long userID,
                        long threadID)
                        throws UserNotFoundException,
                               ForumThreadNotFoundException
Create a watch on a thread for the specified user.

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

createCommunityWatch

Watch createCommunityWatch(long userID,
                           long communityID)
                           throws UserNotFoundException,
                                  CommunityNotFoundException
Create a watch on a community for the specified user.

Parameters:
userID - The ID of the user to set the watch for.
communityID - The ID of the community to watch.
Returns:
The newly created watch.
Throws:
UserNotFoundException
CommunityNotFoundException

getCommunityWatchCount

int getCommunityWatchCount(long userID,
                           long communityID)
                           throws UserNotFoundException,
                                  CommunityNotFoundException
Return the count of all community watches in a particular communityID for the given userID.

Parameters:
userID - The userID to return the watch count for.
communityID - The communityID to return the watch count for.
Returns:
The count of community watches for a userID in a given communityID.
Throws:
UnauthorizedException - if not a system admin or the userID.
UserNotFoundException
CommunityNotFoundException

getTotalWatchCount

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

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:
UnauthorizedException - if not a system admin or the userID.
UserNotFoundException

getWatchList

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

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

getCommunityWatches

long[] getCommunityWatches(long userID,
                           long communityID)
                           throws UserNotFoundException,
                                  CommunityNotFoundException
Returns an array of IDs for all the community objects a user is watching in a community.

Parameters:
userID - The ID of the user.
communityID - The ID of the community.
Returns:
An array of community IDs.
Throws:
UserNotFoundException
CommunityNotFoundException

getUserWatch

Watch getUserWatch(long userID,
                   long watchedUserID)
                   throws UserNotFoundException
Returns a watch on a particular user, or null if there isn't a watch.

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

Watch getThreadWatch(long userID,
                     long threadID)
                     throws UserNotFoundException,
                            ForumThreadNotFoundException
Returns a watch on a particular thread, or null if there isn't a watch.

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

getCommunityWatch

Watch getCommunityWatch(long userID,
                        long communityID)
                        throws UserNotFoundException,
                               CommunityNotFoundException
Returns a watch on a particular community, or null if there isn't a watch.

Parameters:
userID - The ID of the user to acquire a watch for.
communityID - The ID of the community to acquire the watch for.
Returns:
The Watch or null if the community isn't being watched by the user.
Throws:
UnauthorizedException - if not a system admin or the user.
UserNotFoundException
CommunityNotFoundException

isCommunityWatched

boolean isCommunityWatched(long userID,
                           long communityID)
                           throws UserNotFoundException,
                                  CommunityNotFoundException
Returns true if the user is watching the specified community.

Parameters:
userID - The ID of the user.
communityID - The ID of the community.
Returns:
True if the object is being watched by the user, false otherwise.
Throws:
UnauthorizedException - if not a system admin or the user.
UserNotFoundException
CommunityNotFoundException

isThreadWatched

boolean isThreadWatched(long userID,
                        long threadID)
                        throws com.jivesoftware.community.NotFoundException
Returns true if the user is watching the specified thread.

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:
UnauthorizedException - if not a system admin or the user.
com.jivesoftware.community.NotFoundException

isUserWatched

boolean isUserWatched(long userID,
                      long watchedUserID)
                      throws UserNotFoundException
Returns true if the user is watching the specified user.

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:
UnauthorizedException - if not a system admin or the user.
UserNotFoundException

deleteWatch

void deleteWatch(Watch watch)
                 throws com.jivesoftware.community.NotFoundException
Delete the specified watch.

Parameters:
watch - The watch to delete.
Throws:
UnauthorizedException - if not a system admin or the user owning the watch.
com.jivesoftware.community.NotFoundException

deleteWatches

void deleteWatches(long userID)
                   throws UserNotFoundException
Deletes all watches that a user has.

Parameters:
userID - The ID of the user.
Throws:
UnauthorizedException - if not a system admin or the user owning the watch.
UserNotFoundException

getWatchUsers

User[] getWatchUsers(int objectType,
                     long objectID,
                     int watchType)
Returns all the users who are watching this objectType and objectID.

Parameters:
objectType - the type of object being watched.
objectID - the ID of the object being watched.
watchType - the type of watch (EMAIL, BATCH).
Returns:
the users who are watching this objectType and objectID.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.