com.atlassian.jira.issue.watchers
Interface WatcherManager

All Known Implementing Classes:
DefaultWatcherManager

@PublicApi
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<String> getCurrentWatcherUsernames(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use getCurrentWatcherUsernames(com.atlassian.jira.issue.Issue) instead. Since v5.0.
 List<String> getCurrentWatcherUsernames(Issue issue)
          Retrieve the list of usernames of users watching the given issue
 Collection<com.atlassian.crowd.embedded.api.User> getCurrentWatchList(Issue issue, Locale userLocale)
          Deprecated. Use getWatchers(com.atlassian.jira.issue.Issue, java.util.Locale) instead. Since v6.0.
 int getWatcherCount(Issue issue)
          Returns the number of users watching this issue.
 List<ApplicationUser> getWatchers(Issue issue, Locale userLocale)
          Retrieve list of users that are currently watching this issue (including the current user).
 Collection<String> getWatcherUserKeys(Issue issue)
          Retrieve list of users that are currently watching this issue (including the current user).
 boolean isWatching(ApplicationUser user, Issue issue)
          Determine whether the current user is already watching the issue or not
 boolean isWatching(com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use isWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v5.0.
 boolean isWatching(com.atlassian.crowd.embedded.api.User user, Issue issue)
          Deprecated. Use isWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v6.0.
 boolean isWatchingEnabled()
           
 void removeAllWatchesForUser(ApplicationUser user)
          Remove all watches for a given user
 void removeAllWatchesForUser(com.atlassian.crowd.embedded.api.User user)
          Deprecated. Use removeAllWatchesForUser(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0.
 void startWatching(ApplicationUser user, Collection<Issue> issues)
          Enable watching of a list of issues for the user supplied.
 void startWatching(ApplicationUser user, Issue issue)
          Enable watching of a particular issue for the user supplied.
 void startWatching(com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use startWatching(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue) instead. Since v5.0.
 void startWatching(com.atlassian.crowd.embedded.api.User user, Issue issue)
          Deprecated. Use startWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v6.0.
 void stopWatching(ApplicationUser user, Collection<Issue> issues)
          Disable watching of a list of issues for the user supplied.
 void stopWatching(ApplicationUser user, Issue issue)
          Disable watching of a particular issue for the user supplied.
 void stopWatching(String username, org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use stopWatching(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue) instead. Since v5.0.
 void stopWatching(com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use stopWatching(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue) instead. Since v5.0.
 void stopWatching(com.atlassian.crowd.embedded.api.User user, Issue issue)
          Deprecated. Use stopWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v6.0.
 

Method Detail

isWatchingEnabled

boolean isWatchingEnabled()

isWatching

boolean isWatching(com.atlassian.crowd.embedded.api.User user,
                   Issue issue)
Deprecated. Use isWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v6.0.

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.

isWatching

boolean isWatching(ApplicationUser user,
                   Issue 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.

isWatching

boolean isWatching(com.atlassian.crowd.embedded.api.User user,
                   org.ofbiz.core.entity.GenericValue issue)
Deprecated. Use isWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v5.0.

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<com.atlassian.crowd.embedded.api.User> getCurrentWatchList(Issue issue,
                                                                      Locale userLocale)
Deprecated. Use getWatchers(com.atlassian.jira.issue.Issue, java.util.Locale) instead. Since v6.0.

Retrieve collection of users that are currently watching this issue (including the current user)

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
Since:
v4.3

getWatchers

List<ApplicationUser> getWatchers(Issue issue,
                                  Locale userLocale)
Retrieve list of users that are currently watching this issue (including the current user).

Parameters:
userLocale - the locale of the user making this call, this is used for sorting the list values.
issue - issue being watched
Returns:
list of users that are currently watching this issue (including the current user)
Since:
v6.0

getWatcherCount

int getWatcherCount(Issue issue)
Returns the number of users watching this issue.

Parameters:
issue - issue being watched
Returns:
the number of users watching this issue.
Since:
v6.0

getWatcherUserKeys

Collection<String> getWatcherUserKeys(Issue issue)
Retrieve list of users that are currently watching this issue (including the current user).

Parameters:
issue - issue being watched
Returns:
list of users that are currently watching this issue (including the current user)
Since:
v6.0

getCurrentWatcherUsernames

List<String> getCurrentWatcherUsernames(Issue 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

getCurrentWatcherUsernames

List<String> getCurrentWatcherUsernames(org.ofbiz.core.entity.GenericValue issue)
                                        throws DataAccessException
Deprecated. Use getCurrentWatcherUsernames(com.atlassian.jira.issue.Issue) instead. Since v5.0.

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(com.atlassian.crowd.embedded.api.User user,
                   Issue issue)
Deprecated. Use startWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v6.0.

Enable watching of a particular issue for the user supplied.

This means the user will receive 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

startWatching

void startWatching(ApplicationUser user,
                   Issue issue)
Enable watching of a particular issue for the user supplied.

This means the user will receive 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

startWatching

void startWatching(ApplicationUser user,
                   Collection<Issue> issues)
Enable watching of a list of issues for the user supplied.

This means the user will receive updates for any modifications to the issues. 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 issues' watchers lists.

This bulk method is more performant than calling the single version multiple times, as it indexes the issues in bulk rather than one at a time.

Parameters:
user - user that starts watching the given issues
issues - the list of issues to watch

startWatching

void startWatching(com.atlassian.crowd.embedded.api.User user,
                   org.ofbiz.core.entity.GenericValue issue)
Deprecated. Use startWatching(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue) instead. Since v5.0.

Enable watching of a particular issue for the user supplied.

This means the user will receive 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(com.atlassian.crowd.embedded.api.User user,
                  Issue issue)
Deprecated. Use stopWatching(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.Issue) instead. Since v6.0.

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(ApplicationUser user,
                  Issue 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(ApplicationUser user,
                  Collection<Issue> issues)
Disable watching of a list of issues for the user supplied.

This bulk method is more performant than calling the single version multiple times, as it indexes the issues in bulk rather than one at a time.

Parameters:
user - user that stops watching the given issues
issues - list of issues being watched

stopWatching

void stopWatching(com.atlassian.crowd.embedded.api.User user,
                  org.ofbiz.core.entity.GenericValue issue)
Deprecated. Use stopWatching(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue) instead. Since v5.0.

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)
Deprecated. Use stopWatching(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue) instead. Since v5.0.

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(com.atlassian.crowd.embedded.api.User user)
Deprecated. Use removeAllWatchesForUser(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0.

Remove all watches for a given user

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

removeAllWatchesForUser

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

Parameters:
user - The user that has most probably been deleted
Since:
v6.0


Copyright © 2002-2014 Atlassian. All Rights Reserved.