Package org.jboss.aerogear.simplepush.server

Examples of org.jboss.aerogear.simplepush.server.Notification


            public void handle(final Buffer buffer) {
                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);
                    request.response().setStatusCode(400);
View Full Code Here


        }

        @Override
        public Void call() throws Exception {
            try {
                final Notification notification = simplePushServer.handleNotification(endpoint, payload.toString(UTF_8));
                final String uaid = notification.uaid();
                final SockJsSessionContext session = userAgents.get(uaid).context();
                if (logger.isDebugEnabled()) {
                    logger.debug("Sending notification for UAID [ " + notification.uaid() + "] " +
                            toJson(new NotificationMessageImpl(notification.ack())));
                }
                session.send(toJson(new NotificationMessageImpl(notification.ack())));
                userAgents.updateAccessedTime(uaid);
            } catch (final ChannelNotFoundException e) {
                logger.debug("Could not find channel for [" + endpoint + "]");
            } catch (final VersionException e) {
                logger.debug(e.getMessage());
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.simplepush.server.Notification

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.