Interface Topics.SubscriberStream

All Superinterfaces:
Callback, Stream
All Known Subinterfaces:
Topics.ValueStream<V>
All Known Implementing Classes:
Topics.SubscriberStream.Default, Topics.ValueStream.Default
Enclosing interface:
Topics

public static interface Topics.SubscriberStream extends Stream
Base subscriber stream interface.

See Topics.ValueStream and Topics class documentation for further details of the use of subscriber streams.

Since:
5.7
  • Method Details

    • onSubscription

      void onSubscription(String topicPath, TopicSpecification specification)
      Subscription notification.

      This method is called when a session is subscribed to a topic that matches the stream registration. This method is also called when a stream is added, for all of the session's subscriptions to topics that match the stream registration.

      For a given topic, onSubscription will be the initial notification, and the first notification following an unsubscription notification if the session re-subscribes to the topic.

      This method is also called for fallback streams that match the topic type when the session removes the last stream that selected a subscribed topic. The fallback stream will now receive updates for the topic, starting with an immediate notification of the currently cached value (if any).

      Parameters:
      topicPath - the topic path
      specification - the topic specification
    • onUnsubscription

      void onUnsubscription(String topicPath, TopicSpecification specification, Topics.UnsubscribeReason reason)
      Unsubscription notification.

      This method is called if the session is unsubscribed from a topic that matches the stream registration. The stream will receive no more updates for the topic unless the session re-subscribes to the topic.

      This method is also called for fallback streams that match the topic type if the session adds the first stream that selects a subscribed topic. For these notifications, reason will be Topics.UnsubscribeReason.STREAM_CHANGE. The fallback stream will no longer receive updates for the topic.

      Parameters:
      topicPath - the topic path
      specification - the topic specification
      reason - the reason for unsubscription