Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface WatchManager

All Superinterfaces:
JiveManager

public interface WatchManager
extends JiveManager

Manages watches on jive objects. A watch is a way for a user to track updates to an object. Users add watches on individual objects and can specify whether or not they want to be notified by email each time the object is updated.

Because the number of watches could build up and overload the system over time, watches are automatically deleted after the objects they are attached to are inactive for a certain number of days or if the object expires. Individual watches can be toggled to be undeletable so that it is possible to circumvent this behavior.


Method Summary
 Watch createWatch(User user, JiveObject jiveObject)
          Create a watch on a jive object for the specified user.
 void deleteSettings(User user)
          Delete the watch settings for a user
 void deleteWatch(Watch watch)
          Delete the specified watch.
 void deleteWatches(int objectType, long objectID)
          Deletes all watches on the given objectType and objectID.
 void deleteWatches(User user)
          Deletes all watches that a user has.
<A extends JiveObject>
Iterable<A>
getAllWatches(User user)
          Returns an iterable for all objects that a user is watching.
<A extends JiveObject>
Iterable<A>
getAllWatches(User user, int objectType)
          Returns an iterable for all objects of a particular type that a user is watching.
 int getDeleteDays()
          Returns the number of days that a watched object can remain inactive before watches on that object are deleted.
 WatchSettingsBean getSettings(User user)
          Retrieve a watch settings for the given user
 int getTotalWatchCount(User user)
          Returns a count of all watches that a user has for all types.
 int getTotalWatchCount(User user, int objectType)
          Returns a count of all watches that a user has of a particular type.
 Watch getWatch(User user, JiveObject jiveObject)
          Returns a watch on a particular JiveObject, or null if there isn't a watch.
 int getWatchCount(User user, JiveContainer container)
          Return the count of all watches in a particular container for the given user.
 JiveIterator<JiveObject> getWatches(User user, JiveContainer container)
          Returns an Iterable for all the objects a user is watching in a container.
 List<Watch> getWatchList(User user, int objectType)
          Returns an array of Watch objects for a particular object type that the given user is watching.
 JiveIterator<User> getWatchUsers(int objectType, long objectID, int watchType)
          Returns all the users watching a specific objectType, objectID, and watchType.
 boolean isWatched(User user, JiveObject jiveObject)
          Returns true if the user is watching the specified jive object.
 void saveSettings(User user, WatchSettingsBean settings)
          Save the watch settings for a user
 void setDeleteDays(int deleteDays)
          Sets the number of days that a watched object can remain inactive before watches on that object are deleted.
 void update(Watch watch)
          Persists the watches settings
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

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)
                   throws UnauthorizedException
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.
Throws:
UnauthorizedException - if not a system admin.

createWatch

Watch createWatch(User user,
                  JiveObject jiveObject)
                  throws UnauthorizedException
Create a watch on a jive object for the specified user.

People watching jive objects will receive notifications when comments are created against them.

Parameters:
user - the user to set the watch for.
jiveObject - the jive object to create a watch on.
Returns:
the created watch.
Throws:
UnauthorizedException - if not an admin or the user.

getWatchCount

int getWatchCount(User user,
                  JiveContainer container)
                  throws UnauthorizedException
Return the count of all watches in a particular container for the given user.

Parameters:
user - the user to return the watch count for.
container - the container to return the watch count for.
Returns:
the count of watches for a user in a given container.
Throws:
UnauthorizedException - if not a system admin or the user.

getTotalWatchCount

int getTotalWatchCount(User user,
                       int objectType)
                       throws UnauthorizedException
Returns a count of all watches that a user has of a particular type. Valid object types are:

Parameters:
user - 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 user has of type objectType.
Throws:
UnauthorizedException - if not a system admin or the user.

getTotalWatchCount

int getTotalWatchCount(User user)
                       throws UnauthorizedException
Returns a count of all watches that a user has for all types. Valid object types are:

Parameters:
user - the user to get the watch count for.
Returns:
the total number of watches that a user has.
Throws:
UnauthorizedException - if not a system admin or the user.

getWatchList

List<Watch> getWatchList(User user,
                         int objectType)
Returns an array of Watch objects for a particular object type that the given user is watching. Valid object types are:

getAllWatches

<A extends JiveObject> Iterable<A> getAllWatches(User user,
                                                 int objectType)
                                             throws UnauthorizedException
Returns an iterable for all objects of a particular type that a user is watching. Valid object types are:

Parameters:
user - the user.
objectType - the object type.
Returns:
an iterable for all objects of type objectType that a user is watching.
Throws:
UnauthorizedException - if not a system admin or the user.

getAllWatches

<A extends JiveObject> Iterable<A> getAllWatches(User user)
                                             throws UnauthorizedException
Returns an iterable for all objects that a user is watching. Possible object types that may be returned are:

Parameters:
user - the user.
Returns:
an iterable for all objects that a user is watching.
Throws:
UnauthorizedException - if not a system admin or the user.

getWatches

JiveIterator<JiveObject> getWatches(User user,
                                    JiveContainer container)
                                    throws UnauthorizedException
Returns an Iterable for all the objects a user is watching in a container.

Parameters:
user - the user.
container - the container.
Returns:
an iterable for all the jive objects a user is watching in a container.
Throws:
UnauthorizedException - if not a system admin or the user.

getWatch

Watch getWatch(User user,
               JiveObject jiveObject)
               throws UnauthorizedException
Returns a watch on a particular JiveObject, or null if there isn't a watch.

Parameters:
user - the user with the watch.
jiveObject - the jive object being watched.
Returns:
the Watch or null if the jive object isn't being watched by the user.
Throws:
UnauthorizedException - if not a system admin or the user.

getWatchUsers

JiveIterator<User> getWatchUsers(int objectType,
                                 long objectID,
                                 int watchType)
Returns all the users watching a specific objectType, objectID, and watchType.

Parameters:
objectType - the type of object being watched.
objectID - the ID of the object being watched.
watchType - the type of watch.
Returns:
the users who are watching.

isWatched

boolean isWatched(User user,
                  JiveObject jiveObject)
Returns true if the user is watching the specified jive object.

Parameters:
user - the user watching the object.
jiveObject - The jive object to check.
Returns:
true if the jive object is being watched by the user, false otherwise.

deleteWatch

void deleteWatch(Watch watch)
                 throws UnauthorizedException
Delete the specified watch.

Parameters:
watch - the watch to delete.
Throws:
UnauthorizedException - if not a system admin or the user owning the watch.

deleteWatches

void deleteWatches(User user)
                   throws UnauthorizedException
Deletes all watches that a user has.

Parameters:
user - the user.
Throws:
UnauthorizedException - if not a system admin or the user owning the watch.

deleteWatches

void deleteWatches(int objectType,
                   long objectID)
                   throws UnauthorizedException
Deletes all watches on the given objectType and objectID.

Parameters:
objectType - the type of object being watched
objectID - the ID of the object being watched
Throws:
UnauthorizedException - if not a system admin or user admin.

getSettings

WatchSettingsBean getSettings(User user)
                              throws UnauthorizedException
Retrieve a watch settings for the given user

Parameters:
user - the user to return a watch settings object for
Returns:
a WatchSettings object for the given user
Throws:
UnauthorizedException - if not a system admin or the user.

saveSettings

void saveSettings(User user,
                  WatchSettingsBean settings)
                  throws UnauthorizedException
Save the watch settings for a user

Parameters:
user - the user to save the watch settings for
settings - the watch settings to save
Throws:
UnauthorizedException - if not a system admin or the user.

deleteSettings

void deleteSettings(User user)
                    throws UnauthorizedException
Delete the watch settings for a user

Parameters:
user - the user to delete the watch settings for
Throws:
UnauthorizedException - if not a system admin or the user.

update

void update(Watch watch)
            throws UnauthorizedException
Persists the watches settings

Parameters:
watch - The watch to persist.
Throws:
UnauthorizedException - if not a system admin or the user owning the watch

Jive Product Page

Copyright © 1999-2007 Jive Software.