org.springframework.messaging.simp.broker

## Class AbstractSubscriptionRegistry

- java.lang.Object
- - org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry

All Implemented Interfaces:
  SubscriptionRegistry

Direct Known Subclasses:
  DefaultSubscriptionRegistry

    public abstract class AbstractSubscriptionRegistry
    extends Object
    implements SubscriptionRegistry

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

Fields
`protected Log` `logger`

### Constructor Summary

Constructors
Constructor and Description
`AbstractSubscriptionRegistry()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract void` `addSubscriptionInternal(String sessionId, String subscriptionId, String destination, Message<?> message)`
`org.springframework.util.MultiValueMap<String,String>` `findSubscriptions(Message<?> message)` Find all subscriptions that should receive the given message.
`protected abstract org.springframework.util.MultiValueMap<String,String>` `findSubscriptionsInternal(String destination, Message<?> message)`
`void` `registerSubscription(Message<?> message)` Register a subscription represented by the given message.
`protected abstract void` `removeSubscriptionInternal(String sessionId, String subscriptionId, Message<?> message)`
`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 Detail

#### logger

    protected final Log logger

### Constructor Detail

#### AbstractSubscriptionRegistry

    public AbstractSubscriptionRegistry()

### Method Detail

#### registerSubscription

    public final void registerSubscription(Message<?> message)

Description copied from interface: `SubscriptionRegistry`
Register a subscription represented by the given message.

Specified by:
  `registerSubscription` in interface `SubscriptionRegistry`
Parameters:
  `message` - the subscription request

#### unregisterSubscription

    public final void unregisterSubscription(Message<?> message)

Description copied from interface: `SubscriptionRegistry`
Unregister a subscription.

Specified by:
  `unregisterSubscription` in interface `SubscriptionRegistry`
Parameters:
  `message` - the request to unsubscribe

#### findSubscriptions

    public final org.springframework.util.MultiValueMap<String,String> findSubscriptions(Message<?> message)

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 interface `SubscriptionRegistry`
Parameters:
  `message` - the message
Returns:
  a `MultiValueMap` with sessionId-subscriptionId pairs (possibly empty)

#### addSubscriptionInternal

    protected abstract void addSubscriptionInternal(String sessionId,
                                                    String subscriptionId,
                                                    String destination,
                                                    Message<?> message)

#### removeSubscriptionInternal

    protected abstract void removeSubscriptionInternal(String sessionId,
                                                       String subscriptionId,
                                                       Message<?> message)

#### findSubscriptionsInternal

    protected abstract org.springframework.util.MultiValueMap<String,String> findSubscriptionsInternal(String destination,
                                                                                                       Message<?> message)