Class SubscribersDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.datasource.AbstractMyBatisDAO
org.ametys.plugins.newsletter.daos.SubscribersDAO
- All Implemented Interfaces:
 LogEnabled,PluginAware,Component,Configurable,Contextualizable,Serviceable,ThreadSafe
DAO for accessing newsletters subscribers.
- 
Field Summary
FieldsFields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidEmpty a category's subscribers.getSubscriber(String email, String siteName, String categoryId) Get a subscriber to a newsletter categorygetSubscriberByToken(String token) Get a subscriber by his tokenGet the whole list for subscribersgetSubscribers(String siteName, String categoryId) Get the subscribers to a newsletter categorygetSubscribers(String siteName, String categoryId, List<Map<String, Object>> sorts, int offset, int limit) Get the subscribers to a newsletter categorygetSubscribers(List<Map<String, Object>> sorts) Get the whole list for subscribersintgetSubscribersCount(String siteName, String categoryId) Get the subscribers count for a newsletter categorygetSubscriptions(String email, String siteName) Get the list of subscriptions for a given email and site name.voidmodifySubscriptions(Collection<Subscriber> newSubscribers, Collection<String> removeSubscriptions) Insert several subscriptions to newsletters.voidsubscribe(Collection<Subscriber> subscribers) Insert several subscriptions to newsletters.voidsubscribe(Subscriber subscriber) Subscribes to the newslettervoidunsubscribe(String token) Unsubscribes to the newslettervoidunsubscribe(String email, String siteName) Remove all subscriptions for a subscriber in a given site.Methods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_configureDatasource, _getDataSourceId, _getMyBatisConfiguration, configure, contextualize, getSession, getSession, reload, service, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger 
- 
Field Details
- 
ROLE
The Avalon role name. 
 - 
 - 
Constructor Details
- 
SubscribersDAO
public SubscribersDAO() 
 - 
 - 
Method Details
- 
getSubscribers
Get the whole list for subscribers- Returns:
 - The list for subscribers
 
 - 
getSubscribers
Get the whole list for subscribers- Parameters:
 sorts- The sorts list- Returns:
 - The list for subscribers
 
 - 
getSubscribers
Get the subscribers to a newsletter category- Parameters:
 siteName- The site namecategoryId- The newsletter category's id- Returns:
 - the subscribers
 
 - 
getSubscribers
public List<Subscriber> getSubscribers(String siteName, String categoryId, List<Map<String, Object>> sorts, int offset, int limit) Get the subscribers to a newsletter category- Parameters:
 siteName- The site namecategoryId- The newsletter category's idsorts- The sorts listoffset- The number of results to ignore.limit- The maximum number of results to return.- Returns:
 - the subscribers
 
 - 
getSubscribersCount
Get the subscribers count for a newsletter category- Parameters:
 siteName- The site namecategoryId- The newsletter category's id- Returns:
 - the subscribers count
 
 - 
getSubscriber
Get a subscriber to a newsletter category- Parameters:
 email- The subscriber emailsiteName- The site namecategoryId- The newsletter category's id- Returns:
 - the subscribers
 
 - 
getSubscriberByToken
Get a subscriber by his token- Parameters:
 token- The user token- Returns:
 - the subscribers
 
 - 
getSubscriptions
Get the list of subscriptions for a given email and site name.- Parameters:
 email- the email.siteName- the site name.- Returns:
 - the list of subscriptions.
 
 - 
subscribe
Subscribes to the newsletter- Parameters:
 subscriber- The subscriber
 - 
subscribe
Insert several subscriptions to newsletters.- Parameters:
 subscribers- a list of subscribers.
 - 
modifySubscriptions
public void modifySubscriptions(Collection<Subscriber> newSubscribers, Collection<String> removeSubscriptions) Insert several subscriptions to newsletters.- Parameters:
 newSubscribers- the collection of subscribers to insert.removeSubscriptions- the collection of subscription tokens to remove.
 - 
unsubscribe
Unsubscribes to the newsletter- Parameters:
 token- The unique token
 - 
empty
Empty a category's subscribers.- Parameters:
 categoryId- the category to empty.siteName- the site name.
 - 
unsubscribe
Remove all subscriptions for a subscriber in a given site.- Parameters:
 email- the category to empty.siteName- the site name.
 
 -