com.pusher.client.channel.impl
Class ChannelManager

java.lang.Object
  extended by com.pusher.client.channel.impl.ChannelManager
All Implemented Interfaces:
ConnectionEventListener

public class ChannelManager
extends Object
implements ConnectionEventListener


Constructor Summary
ChannelManager()
           
 
Method Summary
 void onConnectionStateChange(ConnectionStateChange change)
          Callback that is fired whenever the ConnectionState of the Connection changes.
 void onError(String message, String code, Exception e)
          Callback that indicates either: An error message has been received from Pusher, or An error has occurred in the client library.
 void onMessage(String event, String wholeMessage)
           
 void setConnection(InternalConnection connection)
           
 void subscribeTo(InternalChannel channel, ChannelEventListener listener, String... eventNames)
           
 void unsubscribeFrom(String channelName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelManager

public ChannelManager()
Method Detail

setConnection

public void setConnection(InternalConnection connection)

subscribeTo

public void subscribeTo(InternalChannel channel,
                        ChannelEventListener listener,
                        String... eventNames)

unsubscribeFrom

public void unsubscribeFrom(String channelName)

onMessage

public void onMessage(String event,
                      String wholeMessage)

onConnectionStateChange

public void onConnectionStateChange(ConnectionStateChange change)
Description copied from interface: ConnectionEventListener

Callback that is fired whenever the ConnectionState of the Connection changes. The state typically changes during connection to Pusher and during disconnection and reconnection.

This callback is only fired if the ConnectionEventListener has been bound to the new state by calling Connection.bind(ConnectionState, ConnectionEventListener) with either the new state or ConnectionState.ALL.

Specified by:
onConnectionStateChange in interface ConnectionEventListener
Parameters:
change - An object that contains the previous state of the connection and the new state. The new state can be retrieved by calling ConnectionStateChange.getCurrentState().

onError

public void onError(String message,
                    String code,
                    Exception e)
Description copied from interface: ConnectionEventListener

Callback that indicates either:

All ConnectionEventListeners that have been registered by calling Connection.bind(ConnectionState, ConnectionEventListener) will receive this callback, even if the ConnectionEventListener is only bound to specific connection status changes.

Specified by:
onError in interface ConnectionEventListener
Parameters:
message - A message indicating the cause of the error.
code - The error code for the message. Can be null.
e - The exception that was thrown, if any. Can be null.


Copyright © 2013 Pusher. All Rights Reserved.