Class SubscriptionService
- java.lang.Object
-
- fr.paris.lutece.plugins.subscribe.service.SubscriptionService
-
public final class SubscriptionService extends Object
Service to manage subscriptions
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateSubscription(Subscription subscription)Create a new subscription.voidcreateSubscription(Subscription subscription, fr.paris.lutece.portal.service.security.LuteceUser user)Create a new subscription for the given uservoidcreateSubscription(Subscription subscription, String strLuteceUserName)Create a new subscription for the given user KeyList<Subscription>findByFilter(SubscriptionFilter filter)Find subscriptions that match a given filterSubscriptionfindBySubscriptionId(int nIdSubscription)Get a subscription from its idstatic SubscriptionServicegetInstance()Get the instance of the subscription servicefr.paris.lutece.portal.service.security.LuteceUsergetLuteceUserFromSubscription(Subscription subscription)Get a lutece user associated to a subscriptionISubscriptionProviderServicegetProviderService(String strProvider)Get a provider service from its nameCollection<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 keyvoidremoveSubscription(int nIdSubscription, boolean bNotifySubscriptionProvider)Remove a subscription from its idvoidremoveSubscription(Subscription subscription, boolean bNotifySubscriptionProvider)Remove a subscriptionvoidsetSubscription(Subscription subscription)setSubscription
-
-
-
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 createuser- The user to associate the subscription to
-
createSubscription
public void createSubscription(Subscription subscription, String strLuteceUserName)
Create a new subscription for the given user Key- Parameters:
subscription- The subscription to createstrLuteceUserName- The user key 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 removebNotifySubscriptionProvider- 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 removebNotifySubscriptionProvider- 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 getstrSubscriptionKey- The subscription key of subscribers to getstrIdSubscribedResource- 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
-
setSubscription
public void setSubscription(Subscription subscription)
setSubscription- Parameters:
subscription-
-
-