Interface WatchService
-
- All Known Implementing Classes:
WatchServiceImpl
@ExperimentalApi @ParametersAreNonnullByDefault @ReturnValuesAreNonnullByDefault public interface WatchService
API service for managing content watchers.A user can watch (subscribe) or unwatch (unsusbscribe) to events happening in a
Space
, a particular piece ofContent
or aLabel
.It also provides a means for retrieving the effective watchers of a given piece of content. For e.g., if a user is watching a Space, and a Page in that Space is modified, for that page change it needs to produce a list of all watchers (i.e. watchers of that particular page plus watchers of the whole space).
- Since:
- 6.5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
WatchService.Validator
Deprecated.since 7.9
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
isWatchingContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
boolean
isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
boolean
isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, ContentType contentType)
void
unwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
Remove a watch to the givencontent
void
unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
Remove a watch to the givenspace
void
unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes)
Remove a watch to the givenspace
WatchService.Validator
validator()
Deprecated.since 7.9ContentWatch
watchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
Create a watch to the givencontent
@NonNull SpaceWatch
watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
Create a watch to the givenspace
@NonNull SpaceWatch
watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes)
Create a watch to the givenspace
-
-
-
Method Detail
-
isWatchingSpace
boolean isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, ContentType contentType)
- 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
space
or not - Since:
- 6.8.0
-
watchSpace
@NonNull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes)
Create a watch to the givenspace
- 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_POST
is supported if supplied- Since:
- 6.8.0
-
watchSpace
@NonNull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
Create a watch to the givenspace
- Parameters:
userKey
- the key of the user to add as a watcherspaceKey
- the key of the space to add the watch for
-
unwatchSpace
void unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes)
Remove a watch to the givenspace
- 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_POST
is supported if supplied- Since:
- 6.8.0
-
unwatchSpace
void unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
Remove a watch to the givenspace
- Parameters:
userKey
- the key of the user to add as a watcherspaceKey
- the key of the space to remove the watch for
-
isWatchingSpace
boolean isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
- Parameters:
userKey
- the watcherspaceKey
- the key of the space to check- Returns:
- whether the user is watching the given
space
or not
-
watchContent
ContentWatch watchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
Create a watch to the givencontent
- Parameters:
userKey
- the key of the user to add as a watchercontentId
- the id of the content to add the watch for
-
unwatchContent
void unwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
Remove a watch to the givencontent
- Parameters:
userKey
- the key of the user to add as a watchercontentId
- the id of the content to remove the watch for
-
isWatchingContent
boolean isWatchingContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
- Parameters:
userKey
- the watchercontentId
- the id of the content to check- Returns:
- whether the user is watching the given
content
or not
-
validator
@Deprecated WatchService.Validator validator()
Deprecated.since 7.9Get the validator of theWatchService
.- Returns:
- a Validator that can be used to validate service requests.
-
-