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    /**
027     * <p>
028     * Callback that is fired when a subscription success acknowledgement
029     * message is received from Pusher after subscribing to the channel.
030     * </p>
031     *
032     * <p>
033     * For public channels this callback will be more or less immediate,
034     * assuming that you are connected to Pusher at the time of subscription.
035     * For private channels this callback will not be fired unless you are
036     * successfully authenticated.
037     * </p>
038     *
039     * @param channelName
040     *            The name of the channel that was successfully subscribed.
041     */
042    void onSubscriptionSucceeded(String channelName);
043}