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
  • Constructor Details

  • Method Details

    • isWatchingSpace

      public boolean isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, ContentType contentType)
      Specified by:
      isWatchingSpace in interface WatchService
      Parameters:
      userKey - the watcher
      spaceKey - the key of the space to check
      contentType - the content type
      Returns:
      whether the user is watching the specific content type in the given space or not
    • watchSpace

      public final @NonNull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes)
      Description copied from interface: WatchService
      Create a watch to the given space
      Specified by:
      watchSpace in interface WatchService
      Parameters:
      userKey - the key of the user to add as a watcher
      spaceKey - the key of the space to add the watch for
      contentTypes - the content types to remove the watch for, currently only ContentType.BLOG_POST is supported if supplied
    • watchSpace

      public final @NonNull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
      Description copied from interface: WatchService
      Create a watch to the given space
      Specified by:
      watchSpace in interface WatchService
      Parameters:
      userKey - the key of the user to add as a watcher
      spaceKey - 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: WatchService
      Remove a watch to the given space
      Specified by:
      unwatchSpace in interface WatchService
      Parameters:
      userKey - the key of the user to add as a watcher
      spaceKey - the key of the space to remove the watch for
      contentTypes - the content type to remove the watch for, currently only ContentType.BLOG_POST is supported if supplied
    • unwatchSpace

      public final void unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
      Description copied from interface: WatchService
      Remove a watch to the given space
      Specified by:
      unwatchSpace in interface WatchService
      Parameters:
      userKey - the key of the user to add as a watcher
      spaceKey - the key of the space to remove the watch for
    • isWatchingSpace

      public final boolean isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
      Specified by:
      isWatchingSpace in interface WatchService
      Parameters:
      userKey - the watcher
      spaceKey - the key of the space to check
      Returns:
      whether the user is watching the given space or not
    • watchContent

      public final ContentWatch watchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
      Description copied from interface: WatchService
      Create a watch to the given content
      Specified by:
      watchContent in interface WatchService
      Parameters:
      userKey - the key of the user to add as a watcher
      contentId - the id of the content to add the watch for
    • unwatchContent

      public final void unwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
      Description copied from interface: WatchService
      Remove a watch to the given content
      Specified by:
      unwatchContent in interface WatchService
      Parameters:
      userKey - the key of the user to add as a watcher
      contentId - 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:
      isWatchingContent in interface WatchService
      Parameters:
      userKey - the watcher
      contentId - the id of the content to check
      Returns:
      whether the user is watching the given content or not
    • findUsersWatchingSpacePaginated

      public PageResponse<User> findUsersWatchingSpacePaginated(String spaceKey, PageRequest pageRequest)
      Description copied from interface: WatchService
      Returns 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:
      findUsersWatchingSpacePaginated in interface WatchService
      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: WatchService
      Returns 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:
      findUsersWatchingContentPaginated in interface WatchService
      Parameters:
      contentId - the id of the Content the User is attempting to view.
      pageRequest - the pagination parameters.
      Returns:
      Users watching the given Content.
    • validator

      public WatchService.Validator validator()
      Description copied from interface: WatchService
      Get the validator of the WatchService.
      Specified by:
      validator in interface WatchService
      Returns:
      a Validator that can be used to validate service requests.