Package com.pusher.client.channel
Interface SubscriptionEventListener
-
- All Known Subinterfaces:
ChannelEventListener,PresenceChannelEventListener,PrivateChannelEventListener,PrivateEncryptedChannelEventListener
public interface SubscriptionEventListener
Client applications should implement this interface if they want to be notified when events are received on a public or private channel.To bind your implementation of this interface to a channel, either:
- Call
Pusher.subscribe(String)to subscribe and receive an instance ofChannel. - Call
Channel.bind(String, SubscriptionEventListener)to bind your listener to a specified event.
Or, call
Pusher.subscribe(String, ChannelEventListener, String...)to subscribe to a channel and bind your listener to one or more events at the same time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidonError(java.lang.String message, java.lang.Exception e)Callback that is fired whenever an unexpected error occurs processing for this SubscriptionEventListener.voidonEvent(PusherEvent event)Callback that is fired whenever an event that this SubscriptionEventListener has been bound to is received.
-
-
-
Method Detail
-
onEvent
void onEvent(PusherEvent event)
Callback that is fired whenever an event that this SubscriptionEventListener has been bound to is received.- Parameters:
event- A PusherEvent object which exposes the whole event. See PusherEvent for more.
-
onError
default void onError(java.lang.String message, java.lang.Exception e)
Callback that is fired whenever an unexpected error occurs processing for this SubscriptionEventListener.- Parameters:
message- A description of the problem.e- An associated exception, if available.
-
-