public class DefaultWatcherManager extends Object implements WatcherManager
| Modifier and Type | Field and Description |
|---|---|
static String |
ASSOCIATION_TYPE |
| Constructor and Description |
|---|
DefaultWatcherManager(UserAssociationStore userAssociationStore,
ApplicationProperties applicationProperties,
IssueIndexManager indexManager,
IssueFactory issueFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
IssueManager issueManager,
UserManager userManager) |
| 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).
|
protected com.google.common.cache.LoadingCache<Long,com.google.common.collect.ImmutableSet<String>> |
getWatchersCache() |
Collection<String> |
getWatcherUserKeys(Issue issue)
Retrieve list of users that are currently watching this issue (including the current user).
|
boolean |
isWatching(ApplicationUser user,
org.ofbiz.core.entity.GenericValue issue) |
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.
|
public static final String ASSOCIATION_TYPE
public DefaultWatcherManager(UserAssociationStore userAssociationStore, ApplicationProperties applicationProperties, IssueIndexManager indexManager, IssueFactory issueFactory, com.atlassian.event.api.EventPublisher eventPublisher, IssueManager issueManager, UserManager userManager)
@Nonnull public Issue startWatching(@Nonnull ApplicationUser user, @Nonnull Issue issue)
WatcherManagerstartWatching in interface WatcherManageruser - user that starts watching the given issueissue - issue being watched@Nonnull public Collection<Issue> startWatching(@Nonnull ApplicationUser user, @Nonnull Collection<Issue> issues, @Nonnull Context taskContext)
WatcherManagerstartWatching in interface WatcherManageruser - user that starts watching the given issuesissues - the list of issues to watchtaskContext - a context through which progress can be reported back@Nonnull public Issue stopWatching(@Nonnull ApplicationUser user, @Nonnull Issue issue)
WatcherManagerstopWatching in interface WatcherManageruser - user that stops watching the given issueissue - issue being watched@Nonnull public Collection<Issue> stopWatching(@Nonnull ApplicationUser user, @Nonnull Collection<Issue> issues, @Nonnull Context taskContext)
WatcherManagerstopWatching in interface WatcherManageruser - user that stops watching the given issuesissues - list of issues being watchedtaskContext - a context through which progress can be reported backpublic List<String> getCurrentWatcherUsernames(@Nonnull Issue issue) throws DataAccessException
WatcherManagergetCurrentWatcherUsernames in interface WatcherManagerissue - issue being watchedDataAccessException - if cannot retrieve watcherspublic boolean isWatchingEnabled()
isWatchingEnabled in interface WatcherManagerpublic boolean isWatching(@Nullable ApplicationUser user, @Nonnull Issue issue)
WatcherManagerisWatching in interface WatcherManageruser - userissue - issue being watchedpublic boolean isWatching(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue)
public List<ApplicationUser> getWatchers(@Nonnull Issue issue, @Nonnull Locale userLocale)
WatcherManagergetWatchers in interface WatcherManagerissue - issue being watcheduserLocale - the locale of the user making this call, this is used for sorting the list values.public int getWatcherCount(@Nonnull Issue issue)
WatcherManagergetWatcherCount in interface WatcherManagerissue - issue being watchedpublic Collection<String> getWatcherUserKeys(@Nonnull Issue issue)
WatcherManagergetWatcherUserKeys in interface WatcherManagerissue - issue being watchedpublic void removeAllWatchesForUser(@Nonnull ApplicationUser user)
WatcherManagerremoveAllWatchesForUser in interface WatcherManageruser - The user that has most probably been deletedCopyright © 2002-2015 Atlassian. All Rights Reserved.