001package com.pusher.client.channel; 002 003/** 004 * Client applications should implement this interface if they want to be 005 * notified when events are received on a public or private channel. 006 * 007 * <p> 008 * To bind your implementation of this interface to a channel, either: 009 * </p> 010 * <ul> 011 * <li>Call {@link com.pusher.client.Pusher#subscribe(String)} to subscribe and 012 * receive an instance of {@link Channel}.</li> 013 * <li>Call {@link Channel#bind(String, SubscriptionEventListener)} to bind your 014 * listener to a specified event.</li> 015 * </ul> 016 * 017 * <p> 018 * Or, call 019 * {@link com.pusher.client.Pusher#subscribe(String, ChannelEventListener, String...)} 020 * to subscribe to a channel and bind your listener to one or more events at the 021 * same time. 022 * </p> 023 */ 024public interface ChannelEventListener extends SubscriptionEventListener { 025 /** 026 * <p> 027 * Callback that is fired when a subscription success acknowledgement 028 * message is received from Pusher after subscribing to the channel. 029 * </p> 030 * 031 * <p> 032 * For public channels this callback will be more or less immediate, 033 * assuming that you are connected to Pusher at the time of subscription. 034 * For private channels this callback will not be fired unless you are 035 * successfully authenticated. 036 * </p> 037 * 038 * @param channelName The name of the channel that was successfully subscribed. 039 */ 040 void onSubscriptionSucceeded(String channelName); 041}