Subscription
Represents a potential subscription to the PubNub real-time network.
Create objects of this class through the com.pubnub.api.v2.entities.Subscribable.subscription method of the respective entities, such as com.pubnub.api.v2.entities.Channel, com.pubnub.api.v2.entities.ChannelGroup, com.pubnub.api.v2.entities.ChannelMetadata and com.pubnub.api.v2.entities.UserMetadata.
Created subscriptions are initially inactive, which means you must call subscribe to start receiving events.
This class implements the AutoCloseable interface to help you release resources by calling unsubscribe and removing all listeners on close. Remember to always call close when you no longer need this Subscription.
Properties
A nullable property to set a function or lambda for responding to file events. This function is invoked whenever a new file event is received, providing a convenient way to process or react to file events.
A nullable property that can be set to a function (or lambda expression) to handle incoming message events. This function is invoked whenever a new message is received, providing a convenient way to process or react to messages.
A nullable property that allows setting a function or lambda to react to message action events. This function is invoked whenever a new message action is received, providing a convenient way to process or react to message actions.
A nullable property for assigning a function or lambda to handle object events. This function is triggered with each new object event, providing a mechanism to manage object-related updates.
A nullable property designed to set a function or lambda expression for handling incoming presence events. This function is called whenever a new presence event occurs, offering an efficient method for tracking presence updates.
A nullable property for assigning a function or lambda expression to handle incoming signal events. This function is called whenever a new signal is received, providing a convenient way to process or react to signals.
Functions
Add a listener.
Create a SubscriptionSet containing this Subscription and the added subscription.
Removes all listeners.
Remove a listener.