Interface UserSubscriptionService

  • All Known Implementing Classes:
    InMemoryUserSubscriptionService

    public interface UserSubscriptionService
    The user subscription service that can be used to query and update user subscriptions.
    Author:
    Filip Hrisafov
    • Method Detail

      • subscribe

        void subscribe​(String userId,
                       String sessionId,
                       Collection<String> userIds)
        Subscribe the user with userId in the session sessionId to the users with userIds. If a subscription already exists then the existing user ids are replaced with the passed userIds
        Parameters:
        userId - the id of the user to which the subscription belongs to
        sessionId - the id of the session in which the user is subscribed to
        userIds - the ids of all the users that the user is subscribed to
      • unSubscribe

        void unSubscribe​(String userId,
                         String sessionId)
        Remove the subscription for the user with the given id and the given session.
        Parameters:
        userId - the id of the user that is being un-subscribed
        sessionId - the id of the session that is being un-subscribed
      • findSubscriptionsTo

        Collection<String> findSubscriptionsTo​(String userId)
        Find all the user(s) that have the user with userId in their subscriptions
        Parameters:
        userId - the id of the user
        Returns:
        all the user(s) that have the user with userId in their subscriptions