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 * Called when the subscription has succeeded and an initial list of 013 * subscribed users has been received from Pusher. 014 * 015 * @param channelName The name of the channel the list is for. 016 * @param users The users. 017 */ 018 void onUsersInformationReceived(String channelName, Set<User> users); 019 020 /** 021 * Called when a new user subscribes to the channel. 022 * 023 * @param channelName channelName The name of the channel the list is for. 024 * @param user The newly subscribed user. 025 */ 026 void userSubscribed(String channelName, User user); 027 028 /** 029 * Called when an existing user unsubscribes from the channel. 030 * 031 * @param channelName The name of the channel that the user unsubscribed from. 032 * @param user The user who unsubscribed. 033 */ 034 void userUnsubscribed(String channelName, User user); 035}