Class Topics.SubscriberStream.Default
- All Implemented Interfaces:
Callback
,Stream
,Topics.SubscriberStream
- Direct Known Subclasses:
Topics.ValueStream.Default
- Enclosing interface:
- Topics.SubscriberStream
Topics.SubscriberStream
implementation.
This logs calls to onSubscription and onUnsubscription at 'debug' level. These implementations can be useful during development but are usually overridden to provide meaningful processing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.pushtechnology.diffusion.client.callbacks.Callback
Callback.Default
Nested classes/interfaces inherited from interface com.pushtechnology.diffusion.client.callbacks.Stream
Stream.Default
Nested classes/interfaces inherited from interface com.pushtechnology.diffusion.client.features.Topics.SubscriberStream
Topics.SubscriberStream.Default
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onSubscription
(String topicPath, TopicSpecification specification) Subscription notification.void
onUnsubscription
(String topicPath, TopicSpecification specification, Topics.UnsubscribeReason reason) Unsubscription notification.Methods inherited from class com.pushtechnology.diffusion.client.callbacks.Stream.Default
onClose
Methods inherited from class com.pushtechnology.diffusion.client.callbacks.Callback.Default
onError
-
Constructor Details
-
Default
public Default()
-
-
Method Details
-
onSubscription
Description copied from interface:Topics.SubscriberStream
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 anunsubscription
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).
- Specified by:
onSubscription
in interfaceTopics.SubscriberStream
- Parameters:
topicPath
- the topic pathspecification
- the topic specification
-
onUnsubscription
public void onUnsubscription(String topicPath, TopicSpecification specification, Topics.UnsubscribeReason reason) Description copied from interface:Topics.SubscriberStream
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 beTopics.UnsubscribeReason.STREAM_CHANGE
. The fallback stream will no longer receive updates for the topic.- Specified by:
onUnsubscription
in interfaceTopics.SubscriberStream
- Parameters:
topicPath
- the topic pathspecification
- the topic specificationreason
- the reason for unsubscription
-