Class AbstractSubscriptionRegistry
java.lang.Object
org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry
- All Implemented Interfaces:
SubscriptionRegistry
- Direct Known Subclasses:
DefaultSubscriptionRegistry
Abstract base class for implementations of
SubscriptionRegistry
that
looks up information in messages but delegates to abstract methods for the
actual storage and retrieval.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addSubscriptionInternal
(String sessionId, String subscriptionId, String destination, Message<?> message) final MultiValueMap<String,
String> findSubscriptions
(Message<?> message) Find all subscriptions that should receive the given message.protected abstract MultiValueMap<String,
String> findSubscriptionsInternal
(String destination, Message<?> message) final void
registerSubscription
(Message<?> message) Register a subscription represented by the given message.protected abstract void
removeSubscriptionInternal
(String sessionId, String subscriptionId, Message<?> message) final void
unregisterSubscription
(Message<?> message) Unregister a subscription.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.messaging.simp.broker.SubscriptionRegistry
unregisterAllSubscriptions
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractSubscriptionRegistry
public AbstractSubscriptionRegistry()
-
-
Method Details
-
registerSubscription
Description copied from interface:SubscriptionRegistry
Register a subscription represented by the given message.- Specified by:
registerSubscription
in interfaceSubscriptionRegistry
- Parameters:
message
- the subscription request
-
unregisterSubscription
Description copied from interface:SubscriptionRegistry
Unregister a subscription.- Specified by:
unregisterSubscription
in interfaceSubscriptionRegistry
- Parameters:
message
- the request to unsubscribe
-
findSubscriptions
Description copied from interface:SubscriptionRegistry
Find all subscriptions that should receive the given message. The map returned is safe to iterate and will never be modified.- Specified by:
findSubscriptions
in interfaceSubscriptionRegistry
- Parameters:
message
- the message- Returns:
- a
MultiValueMap
with sessionId-subscriptionId pairs (possibly empty)
-
addSubscriptionInternal
-
removeSubscriptionInternal
-
findSubscriptionsInternal
protected abstract MultiValueMap<String,String> findSubscriptionsInternal(String destination, Message<?> message)
-