Package com.pusher.client.channel

Examples of com.pusher.client.channel.User


        inOrder.verify(mockEventListener).onUsersInformationReceived(eq(getChannelName()), argument.capture());

        assertEquals(1, argument.getValue().size());
        assertTrue(argument.getValue().toArray()[0] instanceof User);

        User user = (User) argument.getValue().toArray()[0];
        assertEquals(USER_ID, user.getId());
        assertEquals("{\"name\":\"Phil Leggetter\",\"twitter_id\":\"@leggetter\"}", user.getInfo());
    }
View Full Code Here


        InOrder inOrder = inOrder(mockEventListener);
        inOrder.verify(mockEventListener).userSubscribed(eq(getChannelName()), argument.capture());

        assertTrue(argument.getValue() instanceof User);

        User user = argument.getValue();
        assertEquals(USER_ID, user.getId());
        assertEquals("{\"name\":\"Phil Leggetter\",\"twitter_id\":\"@leggetter\"}", user.getInfo());
    }
View Full Code Here

        ArgumentCaptor<User> argument = ArgumentCaptor.forClass(User.class);
        verify(mockEventListener).userUnsubscribed(eq(getChannelName()), argument.capture());

        assertTrue(argument.getValue() instanceof User);

        User user = argument.getValue();
        assertEquals(userId, user.getId());
        assertEquals("{\"name\":\"Phil Leggetter\",\"twitter_id\":\"@leggetter\"}", user.getInfo());
    }
View Full Code Here

        Map<String, ?> hash = (Map<String, ?>)presenceMap.get("hash");

        // build the collection of Users
        for (String id : ids) {
            String userData = (hash.get(id) != null) ? new Gson().toJson(hash.get(id)) : null;
            User user = new User(id, userData);
            idToUserMap.put(id, user);
        }

        ChannelEventListener listener = this.getEventListener();
        if (listener != null) {
View Full Code Here

        Map dataMap = extractDataMapFrom(message);
        String id = String.valueOf(dataMap.get("user_id"));
        String userData = (dataMap.get("user_info") != null) ? new Gson().toJson(dataMap.get("user_info")) : null;

        final User user = new User(id, userData);
        idToUserMap.put(id, user);

        ChannelEventListener listener = this.getEventListener();
        if (listener != null) {
            PresenceChannelEventListener presenceListener = (PresenceChannelEventListener)listener;
View Full Code Here

    private void handleMemberRemovedEvent(String message) {

        Map dataMap = extractDataMapFrom(message);
        String id = String.valueOf(dataMap.get("user_id"));

        final User user = idToUserMap.remove(id);

        ChannelEventListener listener = this.getEventListener();
        if( listener != null ) {
            PresenceChannelEventListener presenceListener = (PresenceChannelEventListener)listener;
            presenceListener.userUnsubscribed(getName(), user);
View Full Code Here

TOP

Related Classes of com.pusher.client.channel.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.