- All Known Implementing Classes:
DefaultSubscriptionRegistry
public interface SubscriptionRegistry
-
Method Summary
Modifier and TypeMethodDescriptionintcountSubscribers(String event) Get the number of subscribers to a particular eventGet a collection of all registered eventsGet a map that maps events to a collection of clientIdsgetSubscribers(String event) Get all subscribers to a particular eventbooleanhasSubscribers(String event) Check if a particular event has subscribersbooleanisClientSubscribedToEvent(String clientId, String eventName) voidvoidunsubscribe(String clientId, String event)
-
Method Details
-
subscribe
-
unsubscribe
-
isClientSubscribedToEvent
-
getAllEvents
Get a collection of all registered events- Returns:
- an unmodifiable set of all events
-
getAllSubscriptions
Get a map that maps events to a collection of clientIds- Returns:
- map with the event as key, the value is a set of clientIds
-
getSubscribers
Get all subscribers to a particular event- Returns:
- an unmodifiable set of all subscribed clientIds to this event. Empty when nobody is subscribed
-
countSubscribers
Get the number of subscribers to a particular event- Returns:
- the number of clientIds subscribed to this event. 0 when nobody is subscribed
-
hasSubscribers
Check if a particular event has subscribers- Returns:
- true when the event has 1 or more subscribers.
-