com.atlassian.jira.issue.watchers
Interface WatcherManager

All Known Implementing Classes:
DefaultWatcherManager

public interface WatcherManager

Allows watching of issues. I.e.: Users watching an issue will receive notifications for every update of the issue.


Method Summary
 List getCurrentWatcherUsernames(org.ofbiz.core.entity.GenericValue issue)
          Retrieve the list of usernames of users watching the given issue
 Collection getCurrentWatchList(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.
 

Method Detail

isWatching

boolean isWatching(User user,
                   org.ofbiz.core.entity.GenericValue issue)
Determine whether the current user is already watching the issue or not

Parameters:
user - user
issue - issue being watched
Returns:
True if a user is watching the issue specified.

getCurrentWatchList

Collection getCurrentWatchList(org.ofbiz.core.entity.GenericValue issue)
Retrieve collection of users that are currently watching this issue (including the current user)

Parameters:
issue - issue being watched
Returns:
A collection of Users

getCurrentWatcherUsernames

List getCurrentWatcherUsernames(org.ofbiz.core.entity.GenericValue issue)
                                throws DataAccessException
Retrieve the list of usernames of users watching the given issue

Parameters:
issue - issue being watched
Returns:
the list of usernames of users watching the given issue
Throws:
DataAccessException - if cannot retrieve watchers

startWatching

void startWatching(User user,
                   org.ofbiz.core.entity.GenericValue issue)
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.

Parameters:
user - user that starts watching the given issue
issue - issue being watched

stopWatching

void stopWatching(User user,
                  org.ofbiz.core.entity.GenericValue issue)
Disable watching of a particular issue for the user supplied.

Parameters:
user - user that stops watching the given issue
issue - issue being watched

stopWatching

void stopWatching(String username,
                  org.ofbiz.core.entity.GenericValue issue)
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.

Parameters:
username - username of the user that stops watching the given issue
issue - issue being watched

removeAllWatchesForUser

void removeAllWatchesForUser(User user)
Remove all watches for a given user

Parameters:
user - The user that has most probably been deleted
Since:
v3.13


Copyright © 2002-2009 Atlassian. All Rights Reserved.