Class DefaultWatcherManager
- All Implemented Interfaces:
WatcherManager
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultWatcherManager(UserAssociationStore userAssociationStore, ApplicationProperties applicationProperties, IssueIndexingService issueIndexingService, IssueFactory issueFactory, com.atlassian.event.api.EventPublisher eventPublisher, IssueManager issueManager, UserManager userManager, QueryDslAccessor queryDslAccessor, SpanningOperationHolder spanningOperationHolder) -
Method Summary
Modifier and TypeMethodDescriptiongetCurrentWatcherUsernames(Issue issue) Retrieve the list of usernames of users watching the given issueintgetWatcherCount(Issue issue) Returns the number of users watching this issue.getWatchers(Issue issue, Locale userLocale) Retrieve list of users that are currently watching this issue (including the current user).getWatchersUnsorted(Issue issue) Retrieve list of users that are currently watching this issue (including the current user).getWatcherUserKeys(Issue issue) Retrieve list of users that are currently watching this issue (including the current user).booleanisWatching(ApplicationUser user, Issue issue) Determine whether the current user is already watching the issue or notbooleanisWatching(ApplicationUser user, org.ofbiz.core.entity.GenericValue issue) booleanvoidRemove all watches for a given userstartWatching(ApplicationUser user, Issue issue) Enable watching of a particular issue for the user supplied.startWatching(ApplicationUser user, Collection<Issue> issues, Context taskContext) Enable watching of a list of issues for the user supplied.stopWatching(ApplicationUser user, Issue issue) Disable watching of a particular issue for the user supplied.stopWatching(ApplicationUser user, Collection<Issue> issues, Context taskContext) Disable watching of a list of issues for the user supplied.
-
Field Details
-
ASSOCIATION_TYPE
- See Also:
-
-
Constructor Details
-
DefaultWatcherManager
public DefaultWatcherManager(UserAssociationStore userAssociationStore, ApplicationProperties applicationProperties, IssueIndexingService issueIndexingService, IssueFactory issueFactory, com.atlassian.event.api.EventPublisher eventPublisher, IssueManager issueManager, UserManager userManager, QueryDslAccessor queryDslAccessor, SpanningOperationHolder spanningOperationHolder)
-
-
Method Details
-
startWatching
Description copied from interface:WatcherManagerEnable 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.
- Specified by:
startWatchingin interfaceWatcherManager- Parameters:
user- user that starts watching the given issueissue- issue being watched- Returns:
- updated issue
-
startWatching
@Nonnull public Collection<Issue> startWatching(@Nonnull ApplicationUser user, @Nonnull Collection<Issue> issues, @Nonnull Context taskContext) Description copied from interface:WatcherManagerEnable 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.
- Specified by:
startWatchingin interfaceWatcherManager- Parameters:
user- user that starts watching the given issuesissues- the list of issues to watchtaskContext- a context through which progress can be reported back- Returns:
- the same list of issues (the same order) updated or not
-
stopWatching
Description copied from interface:WatcherManagerDisable watching of a particular issue for the user supplied.- Specified by:
stopWatchingin interfaceWatcherManager- Parameters:
user- user that stops watching the given issueissue- issue being watched
-
stopWatching
@Nonnull public Collection<Issue> stopWatching(@Nonnull ApplicationUser user, @Nonnull Collection<Issue> issues, @Nonnull Context taskContext) Description copied from interface:WatcherManagerDisable 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.
- Specified by:
stopWatchingin interfaceWatcherManager- Parameters:
user- user that stops watching the given issuesissues- list of issues being watchedtaskContext- a context through which progress can be reported back
-
getCurrentWatcherUsernames
Description copied from interface:WatcherManagerRetrieve the list of usernames of users watching the given issue- Specified by:
getCurrentWatcherUsernamesin interfaceWatcherManager- Parameters:
issue- issue being watched- Returns:
- the list of usernames of users watching the given issue
- Throws:
DataAccessException- if cannot retrieve watchers
-
isWatchingEnabled
public boolean isWatchingEnabled()- Specified by:
isWatchingEnabledin interfaceWatcherManager
-
isWatching
Description copied from interface:WatcherManagerDetermine whether the current user is already watching the issue or not- Specified by:
isWatchingin interfaceWatcherManager- Parameters:
user- userissue- issue being watched- Returns:
- True if a user is watching the issue specified.
-
isWatching
-
getWatchers
Description copied from interface:WatcherManagerRetrieve list of users that are currently watching this issue (including the current user).- Specified by:
getWatchersin interfaceWatcherManager- Parameters:
issue- issue being watcheduserLocale- the locale of the user making this call, this is used for sorting the list values.- Returns:
- list of users that are currently watching this issue (including the current user)
-
getWatchersUnsorted
Description copied from interface:WatcherManagerRetrieve list of users that are currently watching this issue (including the current user). No sorting is applied to this list.- Specified by:
getWatchersUnsortedin interfaceWatcherManager- Parameters:
issue- issue being watched- Returns:
- list of users that are currently watching this issue (including the current user)
-
getWatcherCount
Description copied from interface:WatcherManagerReturns the number of users watching this issue.- Specified by:
getWatcherCountin interfaceWatcherManager- Parameters:
issue- issue being watched- Returns:
- the number of users watching this issue.
-
getWatcherUserKeys
Description copied from interface:WatcherManagerRetrieve list of users that are currently watching this issue (including the current user).- Specified by:
getWatcherUserKeysin interfaceWatcherManager- Parameters:
issue- issue being watched- Returns:
- list of users that are currently watching this issue (including the current user)
-
removeAllWatchesForUser
Description copied from interface:WatcherManagerRemove all watches for a given user- Specified by:
removeAllWatchesForUserin interfaceWatcherManager- Parameters:
user- The user that has most probably been deleted
-
getWatchersCache
-