Package org.jboss.aerogear.simplepush.protocol

Examples of org.jboss.aerogear.simplepush.protocol.AckMessage


                            logger.info("UserAgent [" + uaid + "] Unregistered[" + response.getChannelId() + "]");
                        }
                        break;
                    case ACK:
                        if (checkHandshakeCompleted(uaid)) {
                            final AckMessage ack = fromJson(buffer.toString(), AckMessageImpl.class);
                            simplePushServer.handleAcknowledgement(ack, uaid);
                            processUnacked(uaid);
                        }
                        break;
                    case PING:
View Full Code Here


public class AckMessageImplTest {

    @Test
    public void constructNullUpdates() {
        final AckMessage ack = new AckMessageImpl(null);
        assertThat(ack.getMessageType(), is(equalTo(MessageType.Type.ACK)));
        assertThat(ack.getAcks().isEmpty(), is(true));
    }
View Full Code Here

    }

    @Test
    public void constructWithUpdates() {
        final Set<Ack> acks = acks(ack("abc123", 1L), ack("efg456", 20L));
        final AckMessage ack = new AckMessageImpl(acks);
        assertThat(ack.getAcks(), hasItems(ack("abc123", 1L), ack("efg456", 20L)));
    }
View Full Code Here

    }

    @Test
    public void fromJson() {
        final String json = "{\"messageType\": \"ack\", \"updates\": [{\"channelID\": \"abc123\", \"version\": 20}, {\"channelID\": \"efg456\", \"version\": 10}]}";
        final AckMessage ack = JsonUtil.fromJson(json, AckMessageImpl.class);
        assertThat(ack.getMessageType(), is(equalTo(MessageType.Type.ACK)));
        assertThat(ack.getAcks(), hasItems(ack("abc123", 20L), ack("efg456", 10L)));
    }
View Full Code Here

    @Test
    public void toJson() {
        final Set<Ack> acks = acks(ack("abc123", 1L), ack("efg456", 20L));
        final String json = JsonUtil.toJson(new AckMessageImpl(acks));
        final AckMessage ack = JsonUtil.fromJson(json, AckMessageImpl.class);
        assertThat(ack.getMessageType(), is(equalTo(MessageType.Type.ACK)));
        assertThat(ack.getAcks(), hasItems(ack("abc123", 1L), ack("efg456", 20L)));
    }
View Full Code Here

                logger.info("UserAgent [" + uaid + "] Unregistered[" + response.getChannelId() + "]");
            }
            break;
        case ACK:
            if (checkHandshakeCompleted(uaid)) {
                final AckMessage ack = fromJson(message, AckMessageImpl.class);
                simplePushServer.handleAcknowledgement(ack, uaid);
                processUnacked(uaid, session, simplePushServer.config().acknowledmentInterval());
            }
            break;
        case PING:
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.simplepush.protocol.AckMessage

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.