Interface WatchService
-
- All Known Implementing Classes:
WatchServiceImpl
@ExperimentalApi @ParametersAreNonnullByDefault @ReturnValuesAreNonnullByDefault public interface WatchServiceAPI service for managing content watchers.A user can watch (subscribe) or unwatch (unsusbscribe) to events happening in a
Space, a particular piece ofContentor 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 interfaceWatchService.ValidatorDeprecated.since 7.9
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanisWatchingContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)booleanisWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)booleanisWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, ContentType contentType)voidunwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)Remove a watch to the givencontentvoidunwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)Remove a watch to the givenspacevoidunwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey, List<ContentType> contentTypes)Remove a watch to the givenspaceWatchService.Validatorvalidator()Deprecated.since 7.9ContentWatchwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)Create a watch to the givencontent@NonNull SpaceWatchwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)Create a watch to the givenspace@NonNull SpaceWatchwatchSpace(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
spaceor 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_POSTis 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_POSTis 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
spaceor 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
contentor 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.
-
-