@Component @Singleton @Named(value="notification.watch") public class NotificationWatchScriptService extends Object implements org.xwiki.script.service.ScriptService
Modifier and Type | Field and Description |
---|---|
static String |
ROLE_HINT
Hint of the component.
|
Constructor and Description |
---|
NotificationWatchScriptService() |
Modifier and Type | Method and Description |
---|---|
AutomaticWatchMode |
getAutomaticWatchMode() |
AutomaticWatchMode |
getAutomaticWatchMode(org.xwiki.user.UserReference userReference) |
AutomaticWatchMode |
getDefaultAutomaticWatchMode() |
Collection<String> |
getWatchedUsers() |
boolean |
isEnabled() |
boolean |
isLocationWatched(org.xwiki.model.reference.EntityReference location) |
boolean |
isLocationWatchedWithAllEventTypes(org.xwiki.model.reference.EntityReference location) |
boolean |
isUserWatched(String userId) |
void |
unwatchLocation(org.xwiki.model.reference.EntityReference location)
Remove a filter to stop watching the specified entity.
|
void |
unwatchUser(String userId)
Remove a filter to stop watching the specified user.
|
void |
watchLocation(org.xwiki.model.reference.EntityReference location)
Add a filter to watch the specified location.
|
void |
watchUser(String userId)
Add a filter to watch the specified user.
|
public static final String ROLE_HINT
public boolean isEnabled()
public void watchLocation(org.xwiki.model.reference.EntityReference location) throws org.xwiki.notifications.NotificationException
location
- the location to watchorg.xwiki.notifications.NotificationException
- if an error happenspublic void unwatchLocation(org.xwiki.model.reference.EntityReference location) throws org.xwiki.notifications.NotificationException
location
- the locationorg.xwiki.notifications.NotificationException
- if an error happenspublic boolean isLocationWatched(org.xwiki.model.reference.EntityReference location) throws org.xwiki.notifications.NotificationException
location
- the locationorg.xwiki.notifications.NotificationException
- if an error happens@Unstable public boolean isLocationWatchedWithAllEventTypes(org.xwiki.model.reference.EntityReference location) throws org.xwiki.notifications.NotificationException
location
- the locationorg.xwiki.notifications.NotificationException
- if an error happenspublic boolean isUserWatched(String userId) throws org.xwiki.notifications.NotificationException
userId
- id of the userorg.xwiki.notifications.NotificationException
- if an error happenspublic void watchUser(String userId) throws org.xwiki.notifications.NotificationException
userId
- the user to watchorg.xwiki.notifications.NotificationException
- if an error happenspublic void unwatchUser(String userId) throws org.xwiki.notifications.NotificationException
userId
- the user to unwatchorg.xwiki.notifications.NotificationException
- if an error happenspublic AutomaticWatchMode getAutomaticWatchMode()
@Unstable public AutomaticWatchMode getAutomaticWatchMode(org.xwiki.user.UserReference userReference) throws org.xwiki.notifications.NotificationException
userReference
- the user for which to retrieve the watch modeorg.xwiki.notifications.NotificationException
public AutomaticWatchMode getDefaultAutomaticWatchMode()
public Collection<String> getWatchedUsers() throws org.xwiki.notifications.NotificationException
org.xwiki.notifications.NotificationException
- if an error occursCopyright © 2004–2022 XWiki. All rights reserved.