Class SubscriberDAO

java.lang.Object
fr.paris.lutece.plugins.newsletter.business.SubscriberDAO
All Implemented Interfaces:
ISubscriberDAO

public final class SubscriberDAO extends Object implements ISubscriberDAO
This class provides Data Access methods for subscriber objects
  • Constructor Details

    • SubscriberDAO

      public SubscriberDAO()
  • Method Details

    • insert

      public void insert(Subscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Specified by:
      insert in interface ISubscriberDAO
      Parameters:
      subscriber - the object to be inserted
      plugin - the Plugin
    • delete

      public void delete(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a record from the table
      Specified by:
      delete in interface ISubscriberDAO
      Parameters:
      nId - the subscriber's identifier
      plugin - the Plugin
    • load

      public Subscriber load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      loads data from a subscriber's identifier
      Specified by:
      load in interface ISubscriberDAO
      Parameters:
      nId - the subscriber's identifier
      plugin - the Plugin
      Returns:
      an object Subscriber
    • selectAll

      public Collection<Subscriber> selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Loads the list of subscribers
      Specified by:
      selectAll in interface ISubscriberDAO
      Parameters:
      plugin - the Plugin
      Returns:
      a collection of objects Subscriber
    • selectByEmail

      public Subscriber selectByEmail(String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Finds a subscriber from his email
      Specified by:
      selectByEmail in interface ISubscriberDAO
      Parameters:
      strEmail - the subscriber's email
      plugin - the Plugin
      Returns:
      a subscriber object if it exists, null if not
    • selectSubscribers

      public Collection<Subscriber> selectSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      loads the list of subscribers for a newsletter
      Specified by:
      selectSubscribers in interface ISubscriberDAO
      Parameters:
      nNewsLetterId - the newsletter identifier
      plugin - the Plugin
      Returns:
      a collection of subscribers
    • selectSubscribers

      public Collection<Subscriber> selectSubscribers(int nNewsLetterId, String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      loads the list of subscribers for a newsletter
      Specified by:
      selectSubscribers in interface ISubscriberDAO
      Parameters:
      nNewsLetterId - the newsletter identifier
      strSearchString - gets all the subscribers if null or empty and gets the subscribers whith an email containing this string otherwise
      nBegin - the rank of the first subscriber to return
      nEnd - the maximum number of suscribers to return
      plugin - the Plugin
      Returns:
      a collection of subscribers
    • selectSubscribersForSending

      public Collection<Subscriber> selectSubscribersForSending(int nNewsLetterId, String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      loads the list of subscribers for a newsletter
      Specified by:
      selectSubscribersForSending in interface ISubscriberDAO
      Parameters:
      nNewsLetterId - the newsletter identifier
      strSearchString - gets all the subscribers if null or empty and gets the subscribers whith an email containing this string otherwise
      nBegin - the rank of the first subscriber to return
      nEnd - the maximum number of suscribers to return
      plugin - the Plugin
      Returns:
      a collection of subscribers
    • selectNewsLetters

      public int selectNewsLetters(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns, for a subscriber, the number of his subscriptions
      Specified by:
      selectNewsLetters in interface ISubscriberDAO
      Parameters:
      nSubscriberId - the subscriber's identifier
      plugin - the Plugin
      Returns:
      the number of subscriptions
    • selectSubscribersList

      public Collection<Subscriber> selectSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      loads the list of subscribers
      Specified by:
      selectSubscribersList in interface ISubscriberDAO
      Parameters:
      plugin - the Plugin
      Returns:
      a collection of subscribers