fr.paris.lutece.plugins.subscribe.service
Class SubscriptionService

java.lang.Object
  extended by fr.paris.lutece.plugins.subscribe.service.SubscriptionService

public final class SubscriptionService
extends Object

Service to manage subscriptions


Method Summary
 void createSubscription(Subscription subscription)
          Create a new subscription.
 void createSubscription(Subscription subscription, fr.paris.lutece.portal.service.security.LuteceUser user)
          Create a new subscription for the given user
 List<Subscription> findByFilter(SubscriptionFilter filter)
          Find subscriptions that match a given filter
 Subscription findBySubscriptionId(int nIdSubscription)
          Get a subscription from its id
static SubscriptionService getInstance()
          Get the instance of the subscription service
 fr.paris.lutece.portal.service.security.LuteceUser getLuteceUserFromSubscription(Subscription subscription)
          Get a lutece user associated to a subscription
 ISubscriptionProviderService getProviderService(String strProvider)
          Get a provider service from its name
 Collection<fr.paris.lutece.portal.service.security.LuteceUser> getSubscriberList(String strSubscriptionProvider, String strSubscriptionKey, String strIdSubscribedResource)
          Get the collection of users that subscribed to a given resource with the given key
 void removeSubscription(int nIdSubscription, boolean bNotifySubscriptionProvider)
          Remove a subscription from its id
 void removeSubscription(Subscription subscription, boolean bNotifySubscriptionProvider)
          Remove a subscription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SubscriptionService getInstance()
Get the instance of the subscription service

Returns:
The instance of the subscription service

createSubscription

public void createSubscription(Subscription subscription,
                               fr.paris.lutece.portal.service.security.LuteceUser user)
Create a new subscription for the given user

Parameters:
subscription - The subscription to create
user - The user to associate the subscription to

createSubscription

public void createSubscription(Subscription subscription)
Create a new subscription. The subscriber id of the subscription must have been filled

Parameters:
subscription - The subscription to create

findBySubscriptionId

public Subscription findBySubscriptionId(int nIdSubscription)
Get a subscription from its id

Parameters:
nIdSubscription - The id of the subscription
Returns:
The subscription, or null if no subscription has the given id

findByFilter

public List<Subscription> findByFilter(SubscriptionFilter filter)
Find subscriptions that match a given filter

Parameters:
filter - The filter
Returns:
The list of subscriptions that match the given filter

removeSubscription

public void removeSubscription(int nIdSubscription,
                               boolean bNotifySubscriptionProvider)
Remove a subscription from its id

Parameters:
nIdSubscription - The id of the subscription to remove
bNotifySubscriptionProvider - True to notify the provider of the subscription that it has been removed, false otherwise

removeSubscription

public void removeSubscription(Subscription subscription,
                               boolean bNotifySubscriptionProvider)
Remove a subscription

Parameters:
subscription - The subscription to remove
bNotifySubscriptionProvider - True to notify the provider of the subscription that it has been removed, false otherwise

getLuteceUserFromSubscription

public fr.paris.lutece.portal.service.security.LuteceUser getLuteceUserFromSubscription(Subscription subscription)
Get a lutece user associated to a subscription

Parameters:
subscription - The subscription
Returns:
The lutece user, or null if no lutece user was found

getSubscriberList

public Collection<fr.paris.lutece.portal.service.security.LuteceUser> getSubscriberList(String strSubscriptionProvider,
                                                                                        String strSubscriptionKey,
                                                                                        String strIdSubscribedResource)
Get the collection of users that subscribed to a given resource with the given key

Parameters:
strSubscriptionProvider - The subscription provider of subscribers to get
strSubscriptionKey - The subscription key of subscribers to get
strIdSubscribedResource - The id of the subscribed resource
Returns:
The collection of users that subscribed to the given resource with the given key. Returns an empty collection if no users was found

getProviderService

public ISubscriptionProviderService getProviderService(String strProvider)
Get a provider service from its name

Parameters:
strProvider - The name of the provider service to get
Returns:
The provider service, or null if no provider service has the given name


Copyright © 2013 Mairie de Paris. All Rights Reserved.