@ExperimentalApi
public interface WatchService
A user can watch (subscribe) or unwatch (unsusbscribe) to events happening in a
Space
, a particular piece of
Content
or a
Label
.
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).
Modifier and Type | Interface and Description |
---|---|
static interface |
WatchService.Validator
Provides methods for validating the permissions to watch / unwatch space / content / labels.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isWatchingContent(com.atlassian.sal.api.user.UserKey userKey,
ContentId contentId) |
boolean |
isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey,
String spaceKey) |
void |
unwatchContent(com.atlassian.sal.api.user.UserKey userKey,
ContentId contentId)
Remove a watch to the given
content |
void |
unwatchSpace(com.atlassian.sal.api.user.UserKey userKey,
String spaceKey)
Remove a watch to the given
space |
WatchService.Validator |
validator()
Get the validator of the
WatchService . |
ContentWatch |
watchContent(com.atlassian.sal.api.user.UserKey userKey,
ContentId contentId)
Create a watch to the given
content |
SpaceWatch |
watchSpace(com.atlassian.sal.api.user.UserKey userKey,
String spaceKey)
Create a watch to the given
space |
@Nonnull SpaceWatch watchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
space
userKey
- the key of the user to add as a watcherspaceKey
- the key of the space to add the watch forvoid unwatchSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
space
userKey
- the key of the user to add as a watcherspaceKey
- the key of the space to remove the watch forboolean isWatchingSpace(com.atlassian.sal.api.user.UserKey userKey, String spaceKey)
userKey
- the watcherspaceKey
- the key of the space to checkspace
or notContentWatch watchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
content
userKey
- the key of the user to add as a watchercontentId
- the id of the content to add the watch forvoid unwatchContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
content
userKey
- the key of the user to add as a watchercontentId
- the id of the content to remove the watch forboolean isWatchingContent(com.atlassian.sal.api.user.UserKey userKey, ContentId contentId)
userKey
- the watchercontentId
- the id of the content to checkcontent
or notWatchService.Validator validator()
WatchService
.Copyright © 2003–2018 Atlassian. All rights reserved.