public class UserWatchResource extends Object
Constructor and Description |
---|
UserWatchResource(WatchService watchService,
PersonService personService) |
Modifier and Type | Method and Description |
---|---|
ContentWatch |
addContentWatcher(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
Create a new watcher for the given user and content id.
|
SpaceWatch |
addSpaceWatch(com.atlassian.sal.api.user.UserKey key,
String username,
String spaceKey)
Create a new watcher for the given user and space key.
|
javax.ws.rs.core.Response |
isWatchingContent(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
Get information about whether a user is watching a specified content.
|
javax.ws.rs.core.Response |
isWatchingSpace(com.atlassian.sal.api.user.UserKey key,
String username,
String spaceKey)
Get information about whether a user is watching a specified space.
|
javax.ws.rs.core.Response |
removeContentWatcher(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
Delete an existing watcher for the given user and content id.
|
javax.ws.rs.core.Response |
removeSpaceWatch(com.atlassian.sal.api.user.UserKey key,
String username,
String spaceKey)
Delete an existing watcher for the given user and space key.
|
public UserWatchResource(WatchService watchService, PersonService personService)
@PublicApi public SpaceWatch addSpaceWatch(com.atlassian.sal.api.user.UserKey key, String username, String spaceKey) throws ServiceException
Create a new watcher for the given user and space key.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
POST http://example.com/rest/api/user/watch/space/SPACEKEY
POST http://example.com/rest/api/user/watch/space/SPACEKEY?username=jblogs
POST http://example.com/rest/api/user/watch/space/SPACEKEY?key=ff8080815a58e24c015a58e263710000
key
- userKey of the user to create the new watcher forusername
- userName of the user to create the new watcher forServiceException
@PublicApi public javax.ws.rs.core.Response removeSpaceWatch(com.atlassian.sal.api.user.UserKey key, String username, String spaceKey) throws ServiceException
Delete an existing watcher for the given user and space key.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
DELETE http://example.com/rest/api/user/watch/space/SPACEKEY
DELETE http://example.com/rest/api/user/watch/space/SPACEKEY?username=jblogs
DELETE http://example.com/rest/api/user/watch/space/SPACEKEY?key=ff8080815a58e24c015a58e263710000
key
- userkey of the user to delete the watcher forusername
- username of the user to delete the watcher forServiceException
@PublicApi public javax.ws.rs.core.Response isWatchingSpace(com.atlassian.sal.api.user.UserKey key, String username, String spaceKey) throws ServiceException
Get information about whether a user is watching a specified space.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
http://example.com/rest/api/user/watch/space/SPACEKEY
http://example.com/rest/api/user/watch/space/SPACEKEY?username=jblogs
http://example.com/rest/api/user/watch/space/SPACEKEY?key=ff8080815a58e24c015a58e263710000
key
- userkey of the user to check for watching stateusername
- username of the user to check for watching stateServiceException
@PublicApi public ContentWatch addContentWatcher(com.atlassian.sal.api.user.UserKey key, String username, ContentId contentId) throws ServiceException
Create a new watcher for the given user and content id.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
POST http://example.com/rest/api/user/watch/content/131213
POST http://example.com/rest/api/user/watch/content/131213?username=jblogs
POST http://example.com/rest/api/user/watch/content/131213?key=ff8080815a58e24c015a58e263710000
key
- userkey of the user to create the new watcher forusername
- username of the user to create the new watcher forServiceException
@PublicApi public javax.ws.rs.core.Response removeContentWatcher(com.atlassian.sal.api.user.UserKey key, String username, ContentId contentId) throws ServiceException
Delete an existing watcher for the given user and content id.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
DELETE http://example.com/rest/api/user/watch/content/131213
DELETE http://example.com/rest/api/user/watch/content/131213?username=jblogs
DELETE http://example.com/rest/api/user/watch/content/131213?key=ff8080815a58e24c015a58e263710000
key
- userkey of the user to delete the watcher forusername
- username of the user to delete the watcher forServiceException
@PublicApi public javax.ws.rs.core.Response isWatchingContent(com.atlassian.sal.api.user.UserKey key, String username, ContentId contentId) throws ServiceException
Get information about whether a user is watching a specified content.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
http://example.com/rest/api/user/watch/content/131213
http://example.com/rest/api/user/watch/content/131213?username=jblogs
http://example.com/rest/api/user/watch/content/131213?key=ff8080815a58e24c015a58e263710000
key
- userkey of the user to check for watching stateusername
- username of the user to check for watching stateServiceException
Copyright © 2003–2017 Atlassian. All rights reserved.