001package com.pusher.client.channel;
002
003import java.util.Set;
004
005/**
006 * Used to listen for presence specific events as well as those defined by the
007 * {@link com.pusher.client.channel.PrivateChannelEventListener
008 * PrivateChannelEventListener} and parent interfaces.
009 */
010public interface PresenceChannelEventListener extends PrivateChannelEventListener {
011
012    /**
013     * Called when the subscription has succeeded and an initial list of
014     * subscribed users has been received from Pusher.
015     *
016     * @param channelName
017     *            The name of the channel the list is for.
018     * @param users
019     *            The users.
020     */
021    void onUsersInformationReceived(String channelName, Set<User> users);
022
023    /**
024     * Called when a new user subscribes to the channel.
025     *
026     * @param channelName
027     *            channelName The name of the channel the list is for.
028     * @param user
029     *            The newly subscribed user.
030     */
031    void userSubscribed(String channelName, User user);
032
033    /**
034     * Called when an existing user unsubscribes from the channel.
035     *
036     * @param channelName
037     *            The name of the channel that the user unsubscribed from.
038     * @param user
039     *            The user who unsubscribed.
040     */
041    void userUnsubscribed(String channelName, User user);
042}