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
    Modifier and Type | Field and Description
    --- | ---
    `protected Log` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractSubscriptionRegistry()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `addSubscriptionInternal(String sessionId, String subscriptionId, String destination, Message<?> message)`
    `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)`
    `void` | `registerSubscription(Message<?> message)` Register a subscription represented by the given message.
    `protected abstract void` | `removeSubscriptionInternal(String sessionId, String subscriptionId, Message<?> message)`
    `abstract void` | `unregisterAllSubscriptions(String sessionId)` Remove all subscriptions associated with the given sessionId.
    `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`

- - ### 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

    - #### addSubscriptionInternal

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

    - #### 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

    - #### removeSubscriptionInternal

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

    - #### unregisterAllSubscriptions

          public abstract void unregisterAllSubscriptions(String sessionId)

      Description copied from interface: `SubscriptionRegistry`
      Remove all subscriptions associated with the given sessionId.
      Specified by:
        `unregisterAllSubscriptions` in interface `SubscriptionRegistry`

    - #### findSubscriptions

          public final MultiValueMap<String,String> findSubscriptions(Message<?> message)

      Description copied from interface: `SubscriptionRegistry`
      Find all subscriptions that should receive the given message.
      Specified by:
        `findSubscriptions` in interface `SubscriptionRegistry`
      Parameters:
        `message` - the message
      Returns:
        a `MultiValueMap` from sessionId to subscriptionId's, possibly empty.

    - #### findSubscriptionsInternal

          protected abstract MultiValueMap<String,String> findSubscriptionsInternal(String destination,
                                                                                    Message<?> message)