Class WatchedLocationReference
- java.lang.Object
-
- org.xwiki.notifications.filters.watch.WatchedLocationReference
-
- All Implemented Interfaces:
WatchedEntityReference
public class WatchedLocationReference extends Object implements WatchedEntityReference
Reference of a location to watch.- Since:
- 9.8RC1
- Version:
- $Id: 0bbf1f2df0597113e37485f47f20a61189288ce8 $
-
-
Constructor Summary
Constructors Constructor Description WatchedLocationReference(org.xwiki.model.reference.EntityReference entityReference, String serializedReference, org.xwiki.model.reference.EntityReferenceResolver<String> resolver, org.xwiki.notifications.filters.internal.scope.ScopeNotificationFilterLocationStateComputer stateComputer, NotificationFilterPreferenceManager notificationFilterPreferenceManager)
Construct a WatchedLocationReference.
-
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
isWatchedWithAllEventTypes(org.xwiki.model.reference.DocumentReference userReference)
boolean
matchExactly(NotificationFilterPreference notificationFilterPreference)
String
toString()
-
-
-
Constructor Detail
-
WatchedLocationReference
public WatchedLocationReference(org.xwiki.model.reference.EntityReference entityReference, String serializedReference, org.xwiki.model.reference.EntityReferenceResolver<String> resolver, org.xwiki.notifications.filters.internal.scope.ScopeNotificationFilterLocationStateComputer stateComputer, NotificationFilterPreferenceManager notificationFilterPreferenceManager)
Construct a WatchedLocationReference.- Parameters:
entityReference
- the reference of the location to watchserializedReference
- the serialized reference of the location to watchresolver
- the default entity reference resolverstateComputer
- the default ScopeNotificationFilterLocationStateComputernotificationFilterPreferenceManager
- the notification filter preference 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
-
isWatchedWithAllEventTypes
public boolean isWatchedWithAllEventTypes(org.xwiki.model.reference.DocumentReference userReference) throws org.xwiki.notifications.NotificationException
- Specified by:
isWatchedWithAllEventTypes
in interfaceWatchedEntityReference
- Parameters:
userReference
- a user- Returns:
true
if the given user watch the current entity reference for all events.- 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
-
-