Class WatchedUserReference
- java.lang.Object
-
- org.xwiki.notifications.filters.watch.WatchedUserReference
-
- All Implemented Interfaces:
WatchedEntityReference
public class WatchedUserReference extends Object implements WatchedEntityReference
Reference to a user to watch.- Since:
- 9.8RC1
- Version:
- $Id: b74f622a9262e6dc07cb878addfb6c40e54e4874 $
-
-
Constructor Summary
Constructors Constructor Description WatchedUserReference(String userId, org.xwiki.notifications.filters.internal.user.EventUserFilterPreferencesGetter preferencesGetter, NotificationFilterPreferenceManager notificationFilterPreferenceManager)
Construct a WatchedUserReference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NotificationFilterPreference
createExclusiveFilterPreference()
Create a notification filter preference to watch this entity.NotificationFilterPreference
createInclusiveFilterPreference()
Create a notification filter preference to watch this entity.boolean
isWatched(org.xwiki.model.reference.DocumentReference userReference)
boolean
matchExactly(NotificationFilterPreference notificationFilterPreference)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xwiki.notifications.filters.watch.WatchedEntityReference
isWatchedWithAllEventTypes
-
-
-
-
Constructor Detail
-
WatchedUserReference
public WatchedUserReference(String userId, org.xwiki.notifications.filters.internal.user.EventUserFilterPreferencesGetter preferencesGetter, NotificationFilterPreferenceManager notificationFilterPreferenceManager)
Construct a WatchedUserReference.- Parameters:
userId
- id of the user to watch.preferencesGetter
- the instance of EventUserFilterPreferencesGetternotificationFilterPreferenceManager
- the notification filter manager- Since:
- 10.9
-
-
Method Detail
-
isWatched
public boolean isWatched(org.xwiki.model.reference.DocumentReference userReference) throws org.xwiki.notifications.NotificationException
- Specified by:
isWatched
in interfaceWatchedEntityReference
- Parameters:
userReference
- a user- Returns:
true
if the given user watch the current entity reference for any event type or format.- Throws:
org.xwiki.notifications.NotificationException
- if an error happens
-
matchExactly
public boolean matchExactly(NotificationFilterPreference notificationFilterPreference)
- Specified by:
matchExactly
in interfaceWatchedEntityReference
- Parameters:
notificationFilterPreference
- a filter preference- Returns:
- either or not the filter preference concerns this exact entity
-
createInclusiveFilterPreference
public NotificationFilterPreference createInclusiveFilterPreference()
Description copied from interface:WatchedEntityReference
Create a notification filter preference to watch this entity.- Specified by:
createInclusiveFilterPreference
in interfaceWatchedEntityReference
- Returns:
- a NotificationFilterPreference to save in order to watch this entity
-
createExclusiveFilterPreference
public NotificationFilterPreference createExclusiveFilterPreference()
Description copied from interface:WatchedEntityReference
Create a notification filter preference to watch this entity.- Specified by:
createExclusiveFilterPreference
in interfaceWatchedEntityReference
- Returns:
- a NotificationFilterPreference to save in order to watch this entity
-
-