Class SubscriptionService


  • public final class SubscriptionService
    extends Object
    Service to manage subscriptions
    • 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,
                                       String strLuteceUserName)
        Create a new subscription for the given user Key
        Parameters:
        subscription - The subscription to create
        strLuteceUserName - 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 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
      • setSubscription

        public void setSubscription​(Subscription subscription)
        setSubscription
        Parameters:
        subscription -