SubscriptionSet
A helper class that manages multiple Subscriptions that can be added to it.
Use the com.pubnub.api.java.PubNub.subscriptionSetOf factory methods to create instances of this interface.
Adding multiple Subscriptions to the set, then calling subscribe or unsubscribe on the set is more efficient than calling Subscription.subscribe on each Subscription object separately, as the PubNub client can minimize the number of required reconnections internally.
Remember to always close the set when you're done using it to avoid memory leaks. Closing the set also closes all Subscriptions that are part of this set.
Properties
Returns an immutable copy of the set of subscriptions contained in this SubscriptionSet.
Functions
Add a Subscription to this set.
Add a listener.
Remove the subscription from this set. Equivalent to calling remove.
Add the subscription to this SubscriptionSet. Equivalent to calling add.
Remove the subscription from this set.
Removes all listeners.
Remove a listener.
Sets the handler for incoming channelMetadata events. This method allows the assignment of an OnChannelMetadataHandler implementation or lambda expression to handle incoming presence events.
Sets the handler for incoming file events. This method allows the assignment of an OnFileHandler implementation or lambda expression to handle incoming presence events.
Sets the handler for incoming membership events. This method allows the assignment of an OnMembershipHandler implementation or lambda expression to handle incoming presence events.
Sets the handler for incoming message events. This method allows the assignment of an OnMessageHandler implementation or lambda expression to handle incoming messages.
Sets the handler for incoming messageAction events. This method allows the assignment of an OnMessageActionHandler implementation or lambda expression to handle incoming presence events.
Sets the handler for incoming presence events. This method allows the assignment of an OnPresenceHandler implementation or lambda expression to handle incoming presence events.
Sets the handler for incoming signal events. This method allows the assignment of an OnSignalHandler implementation or lambda expression to handle incoming signals.
Sets the handler for incoming uuidMetadata events. This method allows the assignment of an OnUuidMetadataHandler implementation or lambda expression to handle incoming presence events.
Start receiving events from the subscriptions (or subscriptions) represented by this object.