public class DefaultSubscriptionRegistry extends Object implements SubscriptionRegistry
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
DefaultSubscriptionRegistry(org.springframework.util.PathMatcher pathMatcher) |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
findSubscriptions(PubSubMessage pubSubMessge)
Find all WebSocket session ids that should receive the given message.
|
boolean |
hasSubscriptions()
Returns true if there are any subscription stored in the registry
|
void |
registerSubscription(SubscribeMessage subscribeMessage)
Register a subscription represented by the given message.
|
protected void |
removeSessionDestination(String sessionId,
String destination) |
void |
setCacheLimit(int cacheLimit)
Specify the maximum number of entries for the resolved destination cache.
|
void |
unregisterSession(String sessionId)
Unregister all subscriptions of the given WebSocket session
|
void |
unregisterSubscription(UnsubscribeMessage unsubscribeMessage)
Unregister a subscription.
|
public DefaultSubscriptionRegistry(org.springframework.util.PathMatcher pathMatcher)
public final void registerSubscription(SubscribeMessage subscribeMessage)
SubscriptionRegistryregisterSubscription in interface SubscriptionRegistrysubscribeMessage - the subscription requestpublic final void unregisterSubscription(UnsubscribeMessage unsubscribeMessage)
SubscriptionRegistryunregisterSubscription in interface SubscriptionRegistryunsubscribeMessage - the request to unsubscribepublic final Set<String> findSubscriptions(PubSubMessage pubSubMessge)
SubscriptionRegistryfindSubscriptions in interface SubscriptionRegistrySet of WebSocket session ids, possibly empty.public boolean hasSubscriptions()
SubscriptionRegistryhasSubscriptions in interface SubscriptionRegistrypublic void setCacheLimit(int cacheLimit)
protected void removeSessionDestination(String sessionId, String destination)
public void unregisterSession(String sessionId)
SubscriptionRegistryunregisterSession in interface SubscriptionRegistryCopyright © 2014–2017. All rights reserved.