Package org.jboss.aerogear.simplepush.protocol

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


                try {
                    final String endpointToken = request.params().get("endpoint");
                    final String payload = buffer.toString();
                    logger.info("Notification endpointToken  [" + endpointToken + "] " + payload);
                    final Notification notification = simplePushServer.handleNotification(endpointToken, payload);
                    final NotificationMessage notificationMessage = new NotificationMessageImpl(notification.ack());
                    vertx.eventBus().send(writeHandlerMap.get(notification.uaid()), new Buffer(toJson(notificationMessage)));
                    request.response().setStatusCode(200);
                    request.response().end();
                } catch (final Exception e) {
                    logger.error(e);
View Full Code Here


    }

    @Test
    public void fromJson() {
        final String json = "{\"messageType\": \"notification\", \"updates\": [{\"channelID\": \"abc123\", \"version\": 1}]}";
        final NotificationMessage notification = JsonUtil.fromJson(json, NotificationMessageImpl.class);
        assertThat(notification.getMessageType(), is(equalTo(MessageType.Type.NOTIFICATION)));
        assertThat(notification.getAcks(), hasItem(new AckImpl("abc123", 1L)));
    }
View Full Code Here

TOP

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

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.