Package org.apache.wiki.notification
Interface SubscriptionManager
- All Known Implementing Classes:
DefaultSubscriptionManager
public interface SubscriptionManager
Keeps track of the pages that users want to be notified about by e-mail when they change.
The subscriptions of a user are kept in the attributes of the user profile, so they are stored by the configured
UserDatabase and need no additional storage.
- Since:
- 3.0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the user profile attribute that holds the subscribed page names. -
Method Summary
Modifier and TypeMethodDescriptiongetSubscriptions(String loginName) Returns the names of the pages a user is subscribed to.booleanisSubscribed(String loginName, String pageName) Tells whether a user is subscribed to a page.voidSubscribes a user to the changes of a page.voidunsubscribe(String loginName, String pageName) Removes the subscription of a user to a page.
-
Field Details
-
PROFILE_ATTR_SUBSCRIPTIONS
Name of the user profile attribute that holds the subscribed page names. Value is "subscriptions".- See Also:
-
-
Method Details
-
subscribe
void subscribe(String loginName, String pageName) throws org.apache.wiki.api.exceptions.WikiException Subscribes a user to the changes of a page. Subscribing twice has no effect.- Parameters:
loginName- login name of the user.pageName- name of the page.- Throws:
org.apache.wiki.api.exceptions.WikiException- if the user does not exist or the profile cannot be saved.
-
unsubscribe
void unsubscribe(String loginName, String pageName) throws org.apache.wiki.api.exceptions.WikiException Removes the subscription of a user to a page. Removing a subscription that does not exist has no effect.- Parameters:
loginName- login name of the user.pageName- name of the page.- Throws:
org.apache.wiki.api.exceptions.WikiException- if the user does not exist or the profile cannot be saved.
-
isSubscribed
Tells whether a user is subscribed to a page.- Parameters:
loginName- login name of the user.pageName- name of the page.- Returns:
trueif the user is subscribed to the page,falseotherwise, also for an unknown user.
-
getSubscriptions
Returns the names of the pages a user is subscribed to.- Parameters:
loginName- login name of the user.- Returns:
- an unmodifiable set of page names, empty for an unknown user.
-