|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Channel
An object that represents a Pusher channel. An implementation of this interface is returned when you call
Pusher.subscribe(String)
or Pusher.subscribe(String, ChannelEventListener, String...)
.
Method Summary | |
---|---|
void |
bind(String eventName,
SubscriptionEventListener listener)
Binds a SubscriptionEventListener to an event. |
String |
getName()
Gets the name of the Pusher channel that this object represents. |
void |
unbind(String eventName,
SubscriptionEventListener listener)
Unbinds a previously bound SubscriptionEventListener from an event. |
Method Detail |
---|
String getName()
void bind(String eventName, SubscriptionEventListener listener)
SubscriptionEventListener
to an event. The SubscriptionEventListener
will be notified whenever the
specified event is received on this channel.
eventName
- The name of the event to listen to.listener
- A listener to receive notifications when the event is received.
IllegalArgumentException
- If either of the following are true:
SubscriptionEventListener
is null.IllegalStateException
- If the channel has been unsubscribed by calling Pusher.unsubscribe(String)
.
This puts the Channel in a terminal state from which it can no longer be used. To resubscribe, call
Pusher.subscribe(String)
or Pusher.subscribe(String, ChannelEventListener, String...)
again to receive a fresh Channel instance.void unbind(String eventName, SubscriptionEventListener listener)
Unbinds a previously bound SubscriptionEventListener
from an event. The SubscriptionEventListener
will no
longer be notified whenever the specified event is received on this channel.
Calling this method does not unsubscribe from the channel even if there are no more SubscriptionEventListener
s
bound to it. If you want to unsubscribe from the channel completely, call Pusher.unsubscribe(String)
.
It is not necessary to unbind your SubscriptionEventListener
s first.
eventName
- The name of the event to stop listening to.listener
- The listener to unbind from the event.
IllegalArgumentException
- If either of the following are true:
SubscriptionEventListener
is null.IllegalStateException
- If the channel has been unsubscribed by calling Pusher.unsubscribe(String)
.
This puts the Channel in a terminal state from which it can no longer be used. To resubscribe, call
Pusher.subscribe(String)
or Pusher.subscribe(String, ChannelEventListener, String...)
again to receive a fresh Channel instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |