fr.paris.lutece.plugins.calendar.business
Class CalendarSubscriberDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.calendar.business.CalendarSubscriberDAO
All Implemented Interfaces:
ICalendarSubscriberDAO

public final class CalendarSubscriberDAO
extends java.lang.Object
implements ICalendarSubscriberDAO

This class provides Data Access methods for subscriber objects


Constructor Summary
CalendarSubscriberDAO()
           
 
Method Summary
 void delete(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteSubscriber(int nCalendarId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the subscriber's inscription to a calendar
 void insert(CalendarSubscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 void insertSubscriber(int nCalendarId, int nSubscriberId, java.sql.Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new subscriber for a calendar
 boolean isRegistered(int nCalendarId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          check if the subscriber is not yet registered to a calendar
 boolean isUserSubscribed(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if the user is subscribed to any agenda
 CalendarSubscriber load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          loads data from a subscriber's identifier
 java.util.List<CalendarSubscriber> selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Loads the list of subscribers
 CalendarSubscriber selectByEmail(java.lang.String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Finds a subscriber from his email
 int selectSubscriberNumber(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns, for a subscriber, the number of his subscriptions
 java.util.List<CalendarSubscriber> selectSubscribers(int nCalendarId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          loads the list of subscribers for a calendar
 java.util.List<CalendarSubscriber> selectSubscribers(int nCalendarId, java.lang.String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          loads the list of subscribers for a Calendar
 java.util.List<CalendarSubscriber> selectSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          loads the list of subscribers
 void store(CalendarSubscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarSubscriberDAO

public CalendarSubscriberDAO()
Method Detail

insert

public void insert(CalendarSubscriber subscriber,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface ICalendarSubscriberDAO
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 ICalendarSubscriberDAO
Parameters:
nId - the subscriber's identifier
plugin - the Plugin

load

public CalendarSubscriber load(int nId,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads data from a subscriber's identifier

Specified by:
load in interface ICalendarSubscriberDAO
Parameters:
nId - the subscriber's identifier
plugin - the Plugin
Returns:
an object Subscriber

store

public void store(CalendarSubscriber subscriber,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Specified by:
store in interface ICalendarSubscriberDAO
Parameters:
subscriber - the instance of subscriber class to be updated
plugin - the Plugin

selectAll

public java.util.List<CalendarSubscriber> selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Loads the list of subscribers

Specified by:
selectAll in interface ICalendarSubscriberDAO
Parameters:
plugin - the Plugin
Returns:
a collection of objects Subscriber

selectByEmail

public CalendarSubscriber selectByEmail(java.lang.String strEmail,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Finds a subscriber from his email

Specified by:
selectByEmail in interface ICalendarSubscriberDAO
Parameters:
strEmail - the subscriber's email
plugin - the Plugin
Returns:
a subscriber object if it exists, null if not

selectSubscribers

public java.util.List<CalendarSubscriber> selectSubscribers(int nCalendarId,
                                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers for a calendar

Specified by:
selectSubscribers in interface ICalendarSubscriberDAO
Parameters:
nCalendarId - the Calendar identifier
plugin - the Plugin
Returns:
a collection of subscribers

selectSubscribers

public java.util.List<CalendarSubscriber> selectSubscribers(int nCalendarId,
                                                            java.lang.String strSearchString,
                                                            int nBegin,
                                                            int nEnd,
                                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers for a Calendar

Specified by:
selectSubscribers in interface ICalendarSubscriberDAO
Parameters:
nCalendarId - the Calendar 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

selectSubscriberNumber

public int selectSubscriberNumber(int nSubscriberId,
                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns, for a subscriber, the number of his subscriptions

Specified by:
selectSubscriberNumber in interface ICalendarSubscriberDAO
Parameters:
nSubscriberId - the subscriber's identifier
plugin - the Plugin
Returns:
the number of subscriptions

selectSubscribersList

public java.util.List<CalendarSubscriber> selectSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers

Specified by:
selectSubscribersList in interface ICalendarSubscriberDAO
Parameters:
plugin - the Plugin
Returns:
a collection of subscribers

deleteSubscriber

public void deleteSubscriber(int nCalendarId,
                             int nSubscriberId,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the subscriber's inscription to a calendar

Specified by:
deleteSubscriber in interface ICalendarSubscriberDAO
Parameters:
nCalendarId - the calendar identifier
nSubscriberId - the subscriber identifier
plugin - the Plugin

insertSubscriber

public void insertSubscriber(int nCalendarId,
                             int nSubscriberId,
                             java.sql.Timestamp tToday,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new subscriber for a calendar

Specified by:
insertSubscriber in interface ICalendarSubscriberDAO
Parameters:
nCalendarId - the calendar identifier
nSubscriberId - the subscriber identifier
tToday - The day
plugin - the Plugin

isRegistered

public boolean isRegistered(int nCalendarId,
                            int nSubscriberId,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
check if the subscriber is not yet registered to a calendar

Parameters:
nCalendarId - the calendar identifier
nSubscriberId - the subscriber identifier
plugin - the Plugin
Returns:
true if he is registered and false if not

isUserSubscribed

public boolean isUserSubscribed(int nSubscriberId,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if the user is subscribed to any agenda

Specified by:
isUserSubscribed in interface ICalendarSubscriberDAO
Parameters:
nSubscriberId - the ID of the subscriber
plugin - plugin
Returns:
true if the user is subscribed to any calendar, false otherwise


Copyright © 2011 Mairie de Paris. All Rights Reserved.