com.atlassian.jira.issue.watchers
Class DefaultWatcherManager

java.lang.Object
  extended by com.atlassian.jira.issue.watchers.DefaultWatcherManager
All Implemented Interfaces:
WatcherManager

public class DefaultWatcherManager
extends Object
implements WatcherManager


Field Summary
static String WATCH_ISSUE
           
 
Constructor Summary
DefaultWatcherManager(com.atlassian.core.ofbiz.association.AssociationManager associationManager)
           
 
Method Summary
 List getCurrentWatcherUsernames(org.ofbiz.core.entity.GenericValue issue)
          Retrieve the list of usernames of users watching the given issue
 Collection getCurrentWatchList(Locale userLocale, org.ofbiz.core.entity.GenericValue issue)
          Retrieve collection of users that are currently watching this issue (including the current user)
 boolean isWatching(User user, org.ofbiz.core.entity.GenericValue issue)
          Determine whether the current user is already watching the issue or not
 void removeAllWatchesForUser(User user)
          Remove all watches for a given user
 void startWatching(User user, org.ofbiz.core.entity.GenericValue issue)
          Enable watching of a particular issue for the user supplied.
 void stopWatching(String username, org.ofbiz.core.entity.GenericValue issue)
          Disable watching of a particular issue for the user supplied.
 void stopWatching(User user, org.ofbiz.core.entity.GenericValue issue)
          Disable watching of a particular issue for the user supplied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WATCH_ISSUE

public static final String WATCH_ISSUE
See Also:
Constant Field Values
Constructor Detail

DefaultWatcherManager

public DefaultWatcherManager(com.atlassian.core.ofbiz.association.AssociationManager associationManager)
Method Detail

isWatching

public boolean isWatching(User user,
                          org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: WatcherManager
Determine whether the current user is already watching the issue or not

Specified by:
isWatching in interface WatcherManager
Parameters:
user - user
issue - issue being watched
Returns:
True if a user is watching the issue specified.

getCurrentWatchList

public Collection getCurrentWatchList(Locale userLocale,
                                      org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: WatcherManager
Retrieve collection of users that are currently watching this issue (including the current user)

Specified by:
getCurrentWatchList in interface WatcherManager
Parameters:
userLocale - the locale of the user making this call, this is used for sorting the list values.
issue - issue being watched
Returns:
A collection of Users

getCurrentWatcherUsernames

public List getCurrentWatcherUsernames(org.ofbiz.core.entity.GenericValue issue)
                                throws DataAccessException
Description copied from interface: WatcherManager
Retrieve the list of usernames of users watching the given issue

Specified by:
getCurrentWatcherUsernames in interface WatcherManager
Parameters:
issue - issue being watched
Returns:
the list of usernames of users watching the given issue
Throws:
DataAccessException - if cannot retrieve watchers

startWatching

public void startWatching(User user,
                          org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: WatcherManager
Enable watching of a particular issue for the user supplied. This means the user will retrieve updates for any modifications to the issue. Note, that this will not check if a user has the BROWSE_ISSUE permission. Notifications will however only be sent to users who have the appropriate permissions. Adding a permission check here would complicate updating permission schemes a lot, as it would have to update issue's watchers lists.

Specified by:
startWatching in interface WatcherManager
Parameters:
user - user that starts watching the given issue
issue - issue being watched

stopWatching

public void stopWatching(String username,
                         org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: WatcherManager
Disable watching of a particular issue for the user supplied.

Note: Use this method in case when user no longer exists in JIRA, e.g. JIRA uses external user management and user was removed externally.

Specified by:
stopWatching in interface WatcherManager
Parameters:
username - username of the user that stops watching the given issue
issue - issue being watched

stopWatching

public void stopWatching(User user,
                         org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: WatcherManager
Disable watching of a particular issue for the user supplied.

Specified by:
stopWatching in interface WatcherManager
Parameters:
user - user that stops watching the given issue
issue - issue being watched

removeAllWatchesForUser

public void removeAllWatchesForUser(User user)
Description copied from interface: WatcherManager
Remove all watches for a given user

Specified by:
removeAllWatchesForUser in interface WatcherManager
Parameters:
user - The user that has most probably been deleted


Copyright © 2002-2009 Atlassian. All Rights Reserved.