Class WatchServiceImpl
java.lang.Object
com.atlassian.confluence.api.impl.service.watch.WatchServiceImpl
- All Implemented Interfaces:
WatchService
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
public class WatchServiceImpl
extends Object
implements WatchService
- Since:
- 6.5.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.atlassian.confluence.api.service.watch.WatchService
WatchService.Validator -
Constructor Summary
ConstructorsConstructorDescriptionWatchServiceImpl(ConfluenceUserResolver confluenceUserResolver, PermissionManager permissionManager, NotificationManager notificationManager, SpaceManager spaceManager, SpaceService spaceService, ContentEntityManager contentEntityManager, ContentService contentService, AccessModeService accessModeService, PersonFactory personFactory, PaginationService paginationService) -
Method Summary
Modifier and TypeMethodDescriptionfindUsersWatchingContentPaginated(ContentId contentId, PageRequest pageRequest) Returns a paginated list of Users watching the given Content identified by contentId.findUsersWatchingSpacePaginated(String spaceKey, PageRequest pageRequest) Returns a paginated list of Users watching the given Space identified by spaceKey.final booleanisWatchingContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId) final booleanisWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey) booleanisWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, ContentType contentType) final voidunwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId) Remove a watch to the givencontentfinal voidunwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey) Remove a watch to the givenspacefinal voidunwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes) Remove a watch to the givenspaceGet the validator of theWatchService.final ContentWatchwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId) Create a watch to the givencontentfinal @NonNull SpaceWatchwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey) Create a watch to the givenspacefinal @NonNull SpaceWatchwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes) Create a watch to the givenspace
-
Constructor Details
-
WatchServiceImpl
public WatchServiceImpl(ConfluenceUserResolver confluenceUserResolver, PermissionManager permissionManager, NotificationManager notificationManager, SpaceManager spaceManager, SpaceService spaceService, ContentEntityManager contentEntityManager, ContentService contentService, AccessModeService accessModeService, PersonFactory personFactory, PaginationService paginationService)
-
-
Method Details
-
isWatchingSpace
public boolean isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, ContentType contentType) - Specified by:
isWatchingSpacein interfaceWatchService- Parameters:
userKey- the watcherspaceKey- the key of the space to checkcontentType- the content type- Returns:
- whether the user is watching the specific content type in the given
spaceor not
-
watchSpace
public final @NonNull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes) Description copied from interface:WatchServiceCreate a watch to the givenspace- Specified by:
watchSpacein interfaceWatchService- Parameters:
userKey- the key of the user to add as a watcherspaceKey- the key of the space to add the watch forcontentTypes- the content types to remove the watch for, currently onlyContentType.BLOG_POSTis supported if supplied
-
watchSpace
public final @NonNull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey) Description copied from interface:WatchServiceCreate a watch to the givenspace- Specified by:
watchSpacein interfaceWatchService- Parameters:
userKey- the key of the user to add as a watcherspaceKey- the key of the space to add the watch for
-
unwatchSpace
public final void unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes) Description copied from interface:WatchServiceRemove a watch to the givenspace- Specified by:
unwatchSpacein interfaceWatchService- Parameters:
userKey- the key of the user to add as a watcherspaceKey- the key of the space to remove the watch forcontentTypes- the content type to remove the watch for, currently onlyContentType.BLOG_POSTis supported if supplied
-
unwatchSpace
Description copied from interface:WatchServiceRemove a watch to the givenspace- Specified by:
unwatchSpacein interfaceWatchService- Parameters:
userKey- the key of the user to add as a watcherspaceKey- the key of the space to remove the watch for
-
isWatchingSpace
- Specified by:
isWatchingSpacein interfaceWatchService- Parameters:
userKey- the watcherspaceKey- the key of the space to check- Returns:
- whether the user is watching the given
spaceor not
-
watchContent
public final ContentWatch watchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId) Description copied from interface:WatchServiceCreate a watch to the givencontent- Specified by:
watchContentin interfaceWatchService- Parameters:
userKey- the key of the user to add as a watchercontentId- the id of the content to add the watch for
-
unwatchContent
Description copied from interface:WatchServiceRemove a watch to the givencontent- Specified by:
unwatchContentin interfaceWatchService- Parameters:
userKey- the key of the user to add as a watchercontentId- the id of the content to remove the watch for
-
isWatchingContent
public final boolean isWatchingContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId) - Specified by:
isWatchingContentin interfaceWatchService- Parameters:
userKey- the watchercontentId- the id of the content to check- Returns:
- whether the user is watching the given
contentor not
-
findUsersWatchingSpacePaginated
Description copied from interface:WatchServiceReturns a paginated list of Users watching the given Space identified by spaceKey. Only a Confluence Administrator or Space Administrator can perform this action.- Specified by:
findUsersWatchingSpacePaginatedin interfaceWatchService- Parameters:
spaceKey- the key of the Space the User is attempting to view.pageRequest- the pagination parameters.- Returns:
- Users watching the given Space.
-
findUsersWatchingContentPaginated
public PageResponse<User> findUsersWatchingContentPaginated(ContentId contentId, PageRequest pageRequest) Description copied from interface:WatchServiceReturns a paginated list of Users watching the given Content identified by contentId. Only a Confluence Administrator or Space Administrator can perform this action.- Specified by:
findUsersWatchingContentPaginatedin interfaceWatchService- Parameters:
contentId- the id of the Content the User is attempting to view.pageRequest- the pagination parameters.- Returns:
- Users watching the given Content.
-
validator
Description copied from interface:WatchServiceGet the validator of theWatchService.- Specified by:
validatorin interfaceWatchService- Returns:
- a Validator that can be used to validate service requests.
-