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 Summary
Modifier and Type Method Description java.util.Collection<java.lang.String>
findSubscriptionsTo(java.lang.String userId)
Find all the user(s) that have the user withuserId
in their subscriptionsvoid
subscribe(java.lang.String userId, java.lang.String sessionId, java.util.Collection<java.lang.String> userIds)
Subscribe the user withuserId
in the sessionsessionId
to the users withuserIds
.void
unSubscribe(java.lang.String userId, java.lang.String sessionId)
Remove the subscription for the user with the given id and the given session.
-
Method Details
-
subscribe
void subscribe(java.lang.String userId, java.lang.String sessionId, java.util.Collection<java.lang.String> userIds)Subscribe the user withuserId
in the sessionsessionId
to the users withuserIds
. If a subscription already exists then the existing user ids are replaced with the passeduserIds
- Parameters:
userId
- 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 to
-
unSubscribe
void unSubscribe(java.lang.String userId, java.lang.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-subscribedsessionId
- the id of the session that is being un-subscribed
-
findSubscriptionsTo
java.util.Collection<java.lang.String> findSubscriptionsTo(java.lang.String userId)Find all the user(s) that have the user withuserId
in their subscriptions- Parameters:
userId
- the id of the user- Returns:
- all the user(s) that have the user with
userId
in their subscriptions
-