org.springframework.messaging.simp.broker

## Interface SubscriptionRegistry

- All Known Implementing Classes:
    AbstractSubscriptionRegistry, DefaultSubscriptionRegistry

      public interface SubscriptionRegistry

  A registry of subscription by session that allows looking up subscriptions.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultiValueMap<String,String>` | `findSubscriptions(Message<?> message)` Find all subscriptions that should receive the given message.
    `void` | `registerSubscription(Message<?> subscribeMessage)` Register a subscription represented by the given message.
    `void` | `unregisterAllSubscriptions(String sessionId)` Remove all subscriptions associated with the given sessionId.
    `void` | `unregisterSubscription(Message<?> unsubscribeMessage)` Unregister a subscription.

- - ### Method Detail

    - #### registerSubscription

          void registerSubscription(Message<?> subscribeMessage)

      Register a subscription represented by the given message.
      Parameters:
        `subscribeMessage` - the subscription request

    - #### unregisterSubscription

          void unregisterSubscription(Message<?> unsubscribeMessage)

      Unregister a subscription.
      Parameters:
        `unsubscribeMessage` - the request to unsubscribe

    - #### unregisterAllSubscriptions

          void unregisterAllSubscriptions(String sessionId)

      Remove all subscriptions associated with the given sessionId.

    - #### findSubscriptions

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

      Find all subscriptions that should receive the given message. The map returned is safe to iterate and will never be modified.
      Parameters:
        `message` - the message
      Returns:
        a `MultiValueMap` with sessionId-subscriptionId pairs (possibly empty)