public class InMemoryUserSubscriptionService extends Object implements UserSubscriptionService
| Constructor and Description | 
|---|
| InMemoryUserSubscriptionService() | 
| Modifier and Type | Method and Description | 
|---|---|
| Collection<String> | findSubscriptionsTo(String userId)Find all the user(s) that have the user with  userIdin their subscriptions | 
| void | subscribe(String userId,
         String sessionId,
         Collection<String> userIds)Subscribe the user with  userIdin the sessionsessionIdto the users withuserIds. | 
| void | unSubscribe(String userId,
           String sessionId)Remove the subscription for the user with the given id and the given session. | 
public void subscribe(String userId, String sessionId, Collection<String> userIds)
UserSubscriptionServiceuserId in the session sessionId to the users with userIds.
 If a subscription already exists then the existing user ids are replaced with the passed userIdssubscribe in interface UserSubscriptionServiceuserId - the id of the user to which the subscription belongs tosessionId - the id of the session in which the user is subscribed touserIds - the ids of all the users that the user is subscribed topublic void unSubscribe(String userId, String sessionId)
UserSubscriptionServiceunSubscribe in interface UserSubscriptionServiceuserId - the id of the user that is being un-subscribedsessionId - the id of the session that is being un-subscribedpublic Collection<String> findSubscriptionsTo(String userId)
UserSubscriptionServiceuserId in their subscriptionsfindSubscriptionsTo in interface UserSubscriptionServiceuserId - the id of the useruserId in their subscriptionsCopyright © 2019. All rights reserved.