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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the user profile attribute that holds the subscribed page names.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the names of the pages a user is subscribed to.
    boolean
    isSubscribed(String loginName, String pageName)
    Tells whether a user is subscribed to a page.
    void
    subscribe(String loginName, String pageName)
    Subscribes a user to the changes of a page.
    void
    unsubscribe(String loginName, String pageName)
    Removes the subscription of a user to a page.
  • Field Details

  • 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

      boolean isSubscribed(String loginName, String pageName)
      Tells whether a user is subscribed to a page.
      Parameters:
      loginName - login name of the user.
      pageName - name of the page.
      Returns:
      true if the user is subscribed to the page, false otherwise, 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.