1 package fr.paris.lutece.plugins.module.announce.subscribe.business; 2 3 4 import fr.paris.lutece.plugins.subscribe.business.SubscriptionFilter; 5 import fr.paris.lutece.portal.service.plugin.Plugin; 6 7 import java.util.Collection; 8 import java.util.List; 9 10 public interface IAnnounceSubscribtionDAO { 11 /** 12 * Insert a new record in the table. 13 * @param subscription instance of the Subscription object to insert 14 * @param plugin the Plugin 15 */ 16 void insert(AnnounceSubscribtionDTO subscription, Plugin plugin ); 17 18 /** 19 * Update the record in the table 20 * @param subscription the reference of the Subscription 21 * @param plugin the Plugin 22 */ 23 void store(AnnounceSubscribtionDTO subscription, Plugin plugin ); 24 25 /** 26 * Delete a record from the table 27 * @param nIdSubscription int identifier of the Subscription to delete 28 * @param plugin the Plugin 29 */ 30 void delete( int nIdSubscription, Plugin plugin ); 31 32 /////////////////////////////////////////////////////////////////////////// 33 // Finders 34 35 /** 36 * Load the data from the table 37 * @param nKey The identifier of the subscription 38 * @param plugin the plugin 39 * @return The instance of the subscription 40 */ 41 AnnounceSubscribtionDTO load(int nKey, Plugin plugin ); 42 43 /** 44 * Load the data of all the subscription objects and returns them as a 45 * collection 46 * @param plugin the plugin 47 * @return The collection which contains the data of all the subscription 48 * objects 49 */ 50 Collection<AnnounceSubscribtionDTO> selectSubscriptionsList(Plugin plugin ); 51 52 /** 53 * Find a list of subscriptions from a filter 54 * @param filter The filter 55 * @return The list of subscriptions that matches the given filter 56 */ 57 List<AnnounceSubscribtionDTO> findByFilter(SubscriptionFilter filter ); 58 59 List<AnnounceSubscribtionDTO> findByFilterOr(String userId, String categoryId, String limitRows ); 60 61 }