com.pusher.client.channel.impl
Class PresenceChannelImpl

java.lang.Object
  extended by com.pusher.client.channel.impl.ChannelImpl
      extended by com.pusher.client.channel.impl.PrivateChannelImpl
          extended by com.pusher.client.channel.impl.PresenceChannelImpl
All Implemented Interfaces:
Channel, InternalChannel, PresenceChannel, PrivateChannel, Comparable<InternalChannel>

public class PresenceChannelImpl
extends PrivateChannelImpl
implements PresenceChannel


Field Summary
 
Fields inherited from class com.pusher.client.channel.impl.ChannelImpl
eventNameToListenerMap, name, state, SUBSCRIPTION_SUCCESS_EVENT
 
Constructor Summary
PresenceChannelImpl(InternalConnection connection, String channelName, Authorizer authorizer)
           
 
Method Summary
 void bind(String eventName, SubscriptionEventListener listener)
          Binds a SubscriptionEventListener to an event.
protected  String[] getDisallowedNameExpressions()
           
 User getMe()
          Gets the user that represents the currently connected client.
 Set<User> getUsers()
          Gets a set of users currently subscribed to the channel.
 void onMessage(String event, String message)
           
 String toString()
           
 String toSubscribeMessage()
           
 
Methods inherited from class com.pusher.client.channel.impl.PrivateChannelImpl
getAuthResponse, trigger
 
Methods inherited from class com.pusher.client.channel.impl.ChannelImpl
compareTo, getEventListener, getName, setEventListener, toUnsubscribeMessage, unbind, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.pusher.client.channel.PrivateChannel
trigger
 
Methods inherited from interface com.pusher.client.channel.Channel
getName, unbind
 

Constructor Detail

PresenceChannelImpl

public PresenceChannelImpl(InternalConnection connection,
                           String channelName,
                           Authorizer authorizer)
Method Detail

getUsers

public Set<User> getUsers()
Description copied from interface: PresenceChannel
Gets a set of users currently subscribed to the channel.

Specified by:
getUsers in interface PresenceChannel
Returns:
The users.

getMe

public User getMe()
Description copied from interface: PresenceChannel
Gets the user that represents the currently connected client.

Specified by:
getMe in interface PresenceChannel
Returns:
A user.

onMessage

public void onMessage(String event,
                      String message)
Specified by:
onMessage in interface InternalChannel
Overrides:
onMessage in class ChannelImpl

toSubscribeMessage

public String toSubscribeMessage()
Specified by:
toSubscribeMessage in interface InternalChannel
Overrides:
toSubscribeMessage in class PrivateChannelImpl

bind

public void bind(String eventName,
                 SubscriptionEventListener listener)
Description copied from interface: Channel
Binds a SubscriptionEventListener to an event. The SubscriptionEventListener will be notified whenever the specified event is received on this channel.

Specified by:
bind in interface Channel
Overrides:
bind in class PrivateChannelImpl
Parameters:
eventName - The name of the event to listen to.
listener - A listener to receive notifications when the event is received.

getDisallowedNameExpressions

protected String[] getDisallowedNameExpressions()
Overrides:
getDisallowedNameExpressions in class PrivateChannelImpl

toString

public String toString()
Overrides:
toString in class PrivateChannelImpl


Copyright © 2013 Pusher. All Rights Reserved.