com.atlassian.jira.bc.issue.watcher
Interface WatcherService


public interface WatcherService

Watcher-related business logic interface.

Since:
v4.2

Method Summary
 ServiceOutcome<List<User>> addWatcher(Issue issue, User remoteUser, User watcher)
          Deprecated. since v4.3. Use addWatcher(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead.
 ServiceOutcome<List<com.atlassian.crowd.embedded.api.User>> addWatcher(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser, com.atlassian.crowd.embedded.api.User watcher)
          Adds a watcher to an issue's list of watchers, returning the updated list of watchers.
 ServiceOutcome<Pair<Integer,List<User>>> getWatchers(Issue issue, User remoteUser)
          Deprecated. since v4.3. Use getWatchers(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User) instead.
 ServiceOutcome<Pair<Integer,List<com.atlassian.crowd.embedded.api.User>>> getWatchers(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns a the total number of watchers for a given issue in the first element of the returned Pair, and the list of visible watchers in the second element of the Pair.
 boolean hasViewWatcherListPermission(Issue issue, User remoteUser)
          Returns a boolean indicating whether the given user is authorised to view an issue's watcher list.
 boolean hasViewWatcherListPermission(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns a boolean indicating whether the given user is authorised to view an issue's watcher list.
 boolean isWatchingEnabled()
          Returns a boolean indicating whether watching is enabled in JIRA.
 ServiceOutcome<List<User>> removeWatcher(Issue issue, User remoteUser, User watcher)
          Deprecated. since v4.3. Use removeWatcher(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead.
 ServiceOutcome<List<com.atlassian.crowd.embedded.api.User>> removeWatcher(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser, com.atlassian.crowd.embedded.api.User watcher)
          Removes a watcher from an issue's list of watchers, returning the updated list of watchers.
 

Method Detail

isWatchingEnabled

boolean isWatchingEnabled()
Returns a boolean indicating whether watching is enabled in JIRA.

Returns:
a boolean indicating whether watching is enabled

hasViewWatcherListPermission

boolean hasViewWatcherListPermission(Issue issue,
                                     User remoteUser)
Returns a boolean indicating whether the given user is authorised to view an issue's watcher list.

Parameters:
issue - an Issue
remoteUser - a User
Returns:
a boolean indicating whether the user is authorised to view the watcher list

hasViewWatcherListPermission

boolean hasViewWatcherListPermission(Issue issue,
                                     com.atlassian.crowd.embedded.api.User remoteUser)
Returns a boolean indicating whether the given user is authorised to view an issue's watcher list.

Parameters:
issue - an Issue
remoteUser - a User
Returns:
a boolean indicating whether the user is authorised to view the watcher list

getWatchers

@Deprecated
ServiceOutcome<Pair<Integer,List<User>>> getWatchers(Issue issue,
                                                                User remoteUser)
                                                     throws WatchingDisabledException
Deprecated. since v4.3. Use getWatchers(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User) instead.

Returns a the total number of watchers for a given issue in the first element of the returned Pair, and the list of visible watchers in the second element of the Pair. Note that if the remote user does not have permission to view the list of watchers, it is possible for the number of elements in the returned user list to be less than the returned number of watchers.

Parameters:
issue - the Issue to find watchers for
remoteUser - the calling User
Returns:
a ServiceOutcome containing the total number of watchers, and a list of visible watchers
Throws:
WatchingDisabledException - if watching is currently disabled

getWatchers

ServiceOutcome<Pair<Integer,List<com.atlassian.crowd.embedded.api.User>>> getWatchers(Issue issue,
                                                                                      com.atlassian.crowd.embedded.api.User remoteUser)
                                                                                      throws WatchingDisabledException
Returns a the total number of watchers for a given issue in the first element of the returned Pair, and the list of visible watchers in the second element of the Pair. Note that if the remote user does not have permission to view the list of watchers, it is possible for the number of elements in the returned user list to be less than the returned number of watchers.

Parameters:
issue - the Issue to find watchers for
remoteUser - the calling User
Returns:
a ServiceOutcome containing the total number of watchers, and a list of visible watchers
Throws:
WatchingDisabledException - if watching is currently disabled

addWatcher

@Deprecated
ServiceOutcome<List<User>> addWatcher(Issue issue,
                                                 User remoteUser,
                                                 User watcher)
                                      throws WatchingDisabledException
Deprecated. since v4.3. Use addWatcher(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead.

Adds a watcher to an issue's list of watchers, returning the updated list of watchers.

Parameters:
issue - the issue to update
remoteUser - the remote user on behalf of which
watcher - the watcher to add
Returns:
a ServiceOutcome containing a list of User
Throws:
WatchingDisabledException - if watching is currently disabled

addWatcher

ServiceOutcome<List<com.atlassian.crowd.embedded.api.User>> addWatcher(Issue issue,
                                                                       com.atlassian.crowd.embedded.api.User remoteUser,
                                                                       com.atlassian.crowd.embedded.api.User watcher)
                                                                       throws WatchingDisabledException
Adds a watcher to an issue's list of watchers, returning the updated list of watchers.

Parameters:
issue - the issue to update
remoteUser - the remote user on behalf of which
watcher - the watcher to add
Returns:
a ServiceOutcome containing a list of User
Throws:
WatchingDisabledException - if watching is currently disabled

removeWatcher

@Deprecated
ServiceOutcome<List<User>> removeWatcher(Issue issue,
                                                    User remoteUser,
                                                    User watcher)
                                         throws WatchingDisabledException
Deprecated. since v4.3. Use removeWatcher(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead.

Removes a watcher from an issue's list of watchers, returning the updated list of watchers.

Parameters:
issue - the Issue to update
remoteUser - a User indicating the user on behalf of whom this operation is being performed
watcher - a User representing the User to remove from the watcher list
Returns:
a ServiceOutcome containing a list of User
Throws:
WatchingDisabledException - if watching is currently disabled

removeWatcher

ServiceOutcome<List<com.atlassian.crowd.embedded.api.User>> removeWatcher(Issue issue,
                                                                          com.atlassian.crowd.embedded.api.User remoteUser,
                                                                          com.atlassian.crowd.embedded.api.User watcher)
                                                                          throws WatchingDisabledException
Removes a watcher from an issue's list of watchers, returning the updated list of watchers.

Parameters:
issue - the Issue to update
remoteUser - a User indicating the user on behalf of whom this operation is being performed
watcher - a User representing the User to remove from the watcher list
Returns:
a ServiceOutcome containing a list of User
Throws:
WatchingDisabledException - if watching is currently disabled


Copyright © 2002-2011 Atlassian. All Rights Reserved.