Class SubscriberHome
java.lang.Object
fr.paris.lutece.plugins.newsletter.business.SubscriberHome
This class provides instacnes management methods (create, find, ...) for Subscriber objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic Subscribercreate(Subscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin) Create an instance of the Subscriber classstatic Collection<Subscriber>findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) static SubscriberfindByEmail(String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a subscriber object from the emailstatic SubscriberfindByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an object Subscriber from its identifierstatic intfindNewsLetters(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns, for a subscriber, the number of his subscriptionsstatic Collection<Subscriber>findSubscribers(int nNewsLetterId, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers for a newsletterstatic Collection<Subscriber>findSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers for a newsletterstatic Collection<Subscriber>findSubscribers(int nNewsLetterId, String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers for a newsletterstatic Collection<Subscriber>findSubscribersForSending(int nNewsLetterId, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find the collection of subscribers to send a newsletterstatic Collection<Subscriber>getSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribersstatic voidremove(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the subscriber whose identifier is specified in parameter
-
Method Details
-
create
public static Subscriber create(Subscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin) Create an instance of the Subscriber class- Parameters:
subscriber- the object to insert into the databaseplugin- the plugin- Returns:
- the instance created
-
remove
public static void remove(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the subscriber whose identifier is specified in parameter- Parameters:
nSubscriberId- the subscriber's identifierplugin- the plugin
-
findByPrimaryKey
public static Subscriber findByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an object Subscriber from its identifier- Parameters:
nKey- the primary key of the subscriberplugin- the plugin- Returns:
- an instance of the class
-
findAll
- Parameters:
plugin- the plugin- Returns:
- a collection of objects Subscriber
-
findByEmail
public static Subscriber findByEmail(String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a subscriber object from the email- Parameters:
strEmail- the subscriber's emailplugin- the plugin- Returns:
- a subscriber object if it exists, null if not
-
findSubscribers
public static Collection<Subscriber> findSubscribers(int nNewsLetterId, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers for a newsletter- Parameters:
nNewsLetterId- the newsletter identifiernBegin- the rank of the first subscriber to returnnEnd- the maximum number of suscribers to returnplugin- the plugin- Returns:
- a collection of subscribers
-
findSubscribersForSending
public static Collection<Subscriber> findSubscribersForSending(int nNewsLetterId, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find the collection of subscribers to send a newsletter- Parameters:
nNewsLetterId- The id of the newsletternBegin- The begin index of subscribers to getnEnd- The end index of subscribers to getplugin- The plugin- Returns:
- The collection of subscribers found
-
findSubscribers
public static Collection<Subscriber> findSubscribers(int nNewsLetterId, String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers for a newsletter- Parameters:
nNewsLetterId- the newsletter identifierstrSearchString- gets all the subscribers if null or empty and gets the subscribers whith an email containing this string otherwisenBegin- the rank of the first subscriber to returnnEnd- the maximum number of suscribers to returnplugin- the plugin- Returns:
- a collection of subscribers
-
findSubscribers
public static Collection<Subscriber> findSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers for a newsletter- Parameters:
nNewsLetterId- the newsletter identifierplugin- the plugin- Returns:
- a collection of subscribers
-
findNewsLetters
public static int findNewsLetters(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns, for a subscriber, the number of his subscriptions- Parameters:
nSubscriberId- the subscriber's identifierplugin- the plugin- Returns:
- the number of subscriptions
-
getSubscribersList
public static Collection<Subscriber> getSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the list of subscribers- Parameters:
plugin- the plugin- Returns:
- a collection of subscribers
-