Class PageSubscriptionDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.pagesubscription.PageSubscriptionDAO
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class PageSubscriptionDAO extends AbstractLogEnabled implements Component, Serviceable
DAO for page subscription
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__SUBSCRIBERS_PROPERTY_NAME
private CurrentUserProvider
_currentUserProvider
private ObservationManager
_observationManager
static String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description PageSubscriptionDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubscriber(Page page, String email)
Add a subscriber to a pageSet<String>
getSubscribers(Page page)
Get the subscribers on a pageboolean
isSubscriber(Page page, String email)
Determines if the given email is a subcriber of the given pagevoid
removeSubscriber(Page page, String email)
Remove a subscriber from a pagevoid
service(ServiceManager smanager)
void
setSubscribers(Page page, Set<String> subscribers)
Set the subscribers to a page-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__SUBSCRIBERS_PROPERTY_NAME
private static final String __SUBSCRIBERS_PROPERTY_NAME
- See Also:
- Constant Field Values
-
_observationManager
private ObservationManager _observationManager
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
-
-
Constructor Detail
-
PageSubscriptionDAO
public PageSubscriptionDAO()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSubscribers
public Set<String> getSubscribers(Page page) throws IllegalArgumentException
Get the subscribers on a page- Parameters:
page
- the page- Returns:
- the subscribers
- Throws:
IllegalArgumentException
- if the page does not support subscription
-
isSubscriber
public boolean isSubscriber(Page page, String email)
Determines if the given email is a subcriber of the given page- Parameters:
page
- The pageemail
- The email to test- Returns:
- true if the given email is a subcriber of the given page
-
addSubscriber
public void addSubscriber(Page page, String email) throws IllegalArgumentException
Add a subscriber to a page- Parameters:
page
- The pageemail
- The email to add- Throws:
IllegalArgumentException
- if the page does not support subscription
-
removeSubscriber
public void removeSubscriber(Page page, String email) throws IllegalArgumentException
Remove a subscriber from a page- Parameters:
page
- The pageemail
- The email to remove- Throws:
IllegalArgumentException
- if the page does not support subscription
-
setSubscribers
public void setSubscribers(Page page, Set<String> subscribers) throws IllegalArgumentException
Set the subscribers to a page- Parameters:
page
- The pagesubscribers
- The email of subscribers- Throws:
IllegalArgumentException
- if the page does not support subscription
-
-