@PublicApi @ParametersAreNonnullByDefault public interface WatcherManager
Modifier and Type | Method and Description |
---|---|
List<String> |
getCurrentWatcherUsernames(Issue issue)
Retrieve the list of usernames of users watching the given issue
|
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<ApplicationUser> |
getWatchersUnsorted(Issue issue)
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 |
isWatchingEnabled() |
void |
removeAllWatchesForUser(ApplicationUser user)
Remove all watches for a given user
|
Collection<Issue> |
startWatching(ApplicationUser user,
Collection<Issue> issues,
Context taskContext)
Enable watching of a list of issues for the user supplied.
|
Issue |
startWatching(ApplicationUser user,
Issue issue)
Enable watching of a particular issue for the user supplied.
|
Collection<Issue> |
stopWatching(ApplicationUser user,
Collection<Issue> issues,
Context taskContext)
Disable watching of a list of issues for the user supplied.
|
Issue |
stopWatching(ApplicationUser user,
Issue issue)
Disable watching of a particular issue for the user supplied.
|
boolean isWatchingEnabled()
boolean isWatching(@Nullable ApplicationUser user, Issue issue)
user
- userissue
- issue being watched@Nonnull List<ApplicationUser> getWatchers(Issue issue, Locale userLocale)
userLocale
- the locale of the user making this call, this is used for sorting the list values.issue
- issue being watched@Nonnull Collection<ApplicationUser> getWatchersUnsorted(Issue issue)
issue
- issue being watchedint getWatcherCount(Issue issue)
issue
- issue being watchedCollection<String> getWatcherUserKeys(Issue issue)
issue
- issue being watchedList<String> getCurrentWatcherUsernames(Issue issue) throws DataAccessException
issue
- issue being watchedDataAccessException
- if cannot retrieve watchers@Nonnull Issue startWatching(ApplicationUser user, Issue issue)
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.
user
- user that starts watching the given issueissue
- issue being watched@Nonnull Collection<Issue> startWatching(ApplicationUser user, Collection<Issue> issues, Context taskContext)
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.
user
- user that starts watching the given issuesissues
- the list of issues to watchtaskContext
- a context through which progress can be reported back@Nonnull Issue stopWatching(ApplicationUser user, Issue issue)
user
- user that stops watching the given issueissue
- issue being watched@Nonnull Collection<Issue> stopWatching(ApplicationUser user, Collection<Issue> issues, Context taskContext)
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.
user
- user that stops watching the given issuesissues
- list of issues being watchedtaskContext
- a context through which progress can be reported backvoid removeAllWatchesForUser(ApplicationUser user)
user
- The user that has most probably been deletedCopyright © 2002-2019 Atlassian. All Rights Reserved.