fr.paris.lutece.plugins.stock.service
Class SubscriptionProductService

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.service.impl.AbstractService
      extended by fr.paris.lutece.plugins.stock.service.SubscriptionProductService
All Implemented Interfaces:
ISubscriptionProductService

public class SubscriptionProductService
extends fr.paris.lutece.plugins.stock.service.impl.AbstractService
implements ISubscriptionProductService

ProductService

Author:
jchaline

Constructor Summary
SubscriptionProductService()
           
 
Method Summary
 void doDeleteByIdProduct(String strIdProduct)
          Delete subscriptions to a given product
 void doDeleteSubscriptionProduct(String strUserEmail, String strIdProduct)
          Delete a subscription for a product to an user
 void doSaveSubscriptionProduct(String strUserEmail, String strIdProduct)
          save the subscription to a product for an user
 List<String> getListEmailSubscriber(String strIdProduct)
          Get the list of emails users that subscribed to a list given product
 List<Product> getProductsByUserSubscription(String strUserEmail)
          Find the list of products a user subscribed to
 boolean hasUserSubscribedToProduct(String strUserEmail, String strIdProduct)
          Check if a user has subscribed to a given product
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionProductService

public SubscriptionProductService()
Method Detail

hasUserSubscribedToProduct

public boolean hasUserSubscribedToProduct(String strUserEmail,
                                          String strIdProduct)
Check if a user has subscribed to a given product

Specified by:
hasUserSubscribedToProduct in interface ISubscriptionProductService
Parameters:
strUserEmail - The email of the user
strIdProduct - The id of the product
Returns:
True if the user has subscribed to the product, false otherwise

getProductsByUserSubscription

public List<Product> getProductsByUserSubscription(String strUserEmail)
Find the list of products a user subscribed to

Specified by:
getProductsByUserSubscription in interface ISubscriptionProductService
Parameters:
strUserEmail - The email of the user to get product subscriptions of
Returns:
the list of products

doSaveSubscriptionProduct

@Transactional(readOnly=false,
               propagation=REQUIRES_NEW)
public void doSaveSubscriptionProduct(String strUserEmail,
                                                    String strIdProduct)
save the subscription to a product for an user

Specified by:
doSaveSubscriptionProduct in interface ISubscriptionProductService
Parameters:
strUserEmail - The email of the user that made the subscription
strIdProduct - The id of the product the user subscribed to

doDeleteSubscriptionProduct

public void doDeleteSubscriptionProduct(String strUserEmail,
                                        String strIdProduct)
Delete a subscription for a product to an user

Specified by:
doDeleteSubscriptionProduct in interface ISubscriptionProductService
Parameters:
strUserEmail - the email of the subscription
strIdProduct - The id of the product to unsubscribe

doDeleteByIdProduct

public void doDeleteByIdProduct(String strIdProduct)
Delete subscriptions to a given product

Specified by:
doDeleteByIdProduct in interface ISubscriptionProductService
Parameters:
strIdProduct - the id of the product to remove subscriptions of

getListEmailSubscriber

public List<String> getListEmailSubscriber(String strIdProduct)
Get the list of emails users that subscribed to a list given product

Specified by:
getListEmailSubscriber in interface ISubscriptionProductService
Parameters:
strIdProduct - The id of the product
Returns:
The list of emails of users that subscribed to a given product


Copyright © 2013 Mairie de Paris. All Rights Reserved.