Package org.cometd.bayeux.server

Examples of org.cometd.bayeux.server.BayeuxContext


        final CountDownLatch latch = new CountDownLatch(1);
        bayeux.getChannel(Channel.META_HANDSHAKE).addListener(new ServerChannel.MessageListener()
        {
            public boolean onMessage(ServerSession from, ServerChannel channel, ServerMessage.Mutable message)
            {
                BayeuxContext context = bayeux.getContext();
                Assert.assertEquals(context.getHeader("Host"), context.getHeader("HOST"));
                Assert.assertEquals(context.getHeader("Host"), context.getHeaderValues("HOST").get(0));
                latch.countDown();
                return true;
            }
        });
View Full Code Here


        final CountDownLatch latch = new CountDownLatch(1);
        bayeux.getChannel(Channel.META_HANDSHAKE).addListener(new ServerChannel.MessageListener()
        {
            public boolean onMessage(ServerSession from, ServerChannel channel, ServerMessage.Mutable message)
            {
                BayeuxContext context = bayeux.getContext();
                Assert.assertEquals(cookieValue, context.getCookie(cookieName));
                latch.countDown();
                return true;
            }
        });
View Full Code Here

        public void onMessage(ServerSessionImpl session, final Mutable message)
        {
            if (session == null)
                session = newServerSession();

            BayeuxContext context = getContext();
            if (context != null)
                session.setUserAgent(context.getHeader("User-Agent"));

            ServerMessage.Mutable reply = message.getAssociated();
            if (_policy != null && !_policy.canHandshake(BayeuxServerImpl.this, session, message))
            {
                error(reply, "403::Handshake denied");
View Full Code Here

            addService(channelName, "process");
        }

        public void metaHandshake(ServerSession session, ServerMessage message)
        {
            BayeuxContext context = getBayeux().getContext();
            String value1 = context.getCookie(cookie1);
            String value2 = context.getCookie(cookie2);
            if (value1 != null && value2 != null)
                handshakeLatch.countDown();
        }
View Full Code Here

                handshakeLatch.countDown();
        }

        public void metaConnect(ServerSession session, ServerMessage message)
        {
            BayeuxContext context = getBayeux().getContext();
            String value1 = context.getCookie(cookie1);
            String value2 = context.getCookie(cookie2);
            String value3 = context.getCookie("BAYEUX_BROWSER");
            if (value1 != null && value2 != null && value3 != null)
                connectLatch.countDown();
        }
View Full Code Here

                connectLatch.countDown();
        }

        public void metaSubscribe(ServerSession session, ServerMessage message)
        {
            BayeuxContext context = getBayeux().getContext();
            String value1 = context.getCookie(cookie1);
            String value2 = context.getCookie(cookie2);
            String value3 = context.getCookie("BAYEUX_BROWSER");
            if (value1 != null && value2 != null && value3 != null)
                subscribeLatch.countDown();
        }
View Full Code Here

                subscribeLatch.countDown();
        }

        public void metaUnsubscribe(ServerSession session, ServerMessage message)
        {
            BayeuxContext context = getBayeux().getContext();
            String value1 = context.getCookie(cookie1);
            String value2 = context.getCookie(cookie2);
            String value3 = context.getCookie("BAYEUX_BROWSER");
            if (value1 != null && value2 != null && value3 != null)
                unsubscribeLatch.countDown();
        }
View Full Code Here

                unsubscribeLatch.countDown();
        }

        public void process(ServerSession session, ServerMessage message)
        {
            BayeuxContext context = getBayeux().getContext();
            String value1 = context.getCookie(cookie1);
            String value2 = context.getCookie(cookie2);
            String value3 = context.getCookie("BAYEUX_BROWSER");
            if (value1 != null && value2 != null && value3 != null)
                publishLatch.countDown();
        }
View Full Code Here

TOP

Related Classes of org.cometd.bayeux.server.BayeuxContext

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.