Class AbstractHttpTransport

    • Field Detail

      • JSON_DEBUG_OPTION

        public static final java.lang.String JSON_DEBUG_OPTION
        See Also:
        Constant Field Values
      • BROWSER_COOKIE_NAME_OPTION

        public static final java.lang.String BROWSER_COOKIE_NAME_OPTION
        See Also:
        Constant Field Values
      • BROWSER_COOKIE_DOMAIN_OPTION

        public static final java.lang.String BROWSER_COOKIE_DOMAIN_OPTION
        See Also:
        Constant Field Values
      • BROWSER_COOKIE_PATH_OPTION

        public static final java.lang.String BROWSER_COOKIE_PATH_OPTION
        See Also:
        Constant Field Values
      • BROWSER_COOKIE_SECURE_OPTION

        public static final java.lang.String BROWSER_COOKIE_SECURE_OPTION
        See Also:
        Constant Field Values
      • BROWSER_COOKIE_HTTP_ONLY_OPTION

        public static final java.lang.String BROWSER_COOKIE_HTTP_ONLY_OPTION
        See Also:
        Constant Field Values
      • MAX_SESSIONS_PER_BROWSER_OPTION

        public static final java.lang.String MAX_SESSIONS_PER_BROWSER_OPTION
        See Also:
        Constant Field Values
      • HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION

        public static final java.lang.String HTTP2_MAX_SESSIONS_PER_BROWSER_OPTION
        See Also:
        Constant Field Values
      • MULTI_SESSION_INTERVAL_OPTION

        public static final java.lang.String MULTI_SESSION_INTERVAL_OPTION
        See Also:
        Constant Field Values
      • TRUST_CLIENT_SESSION

        public static final java.lang.String TRUST_CLIENT_SESSION
        See Also:
        Constant Field Values
      • _logger

        protected final org.slf4j.Logger _logger
    • Constructor Detail

      • AbstractHttpTransport

        protected AbstractHttpTransport​(BayeuxServerImpl bayeux,
                                        java.lang.String name)
    • Method Detail

      • getMultiSessionInterval

        protected long getMultiSessionInterval()
      • setCurrentRequest

        public void setCurrentRequest​(javax.servlet.http.HttpServletRequest request)
      • getCurrentRequest

        public javax.servlet.http.HttpServletRequest getCurrentRequest()
      • accept

        public abstract boolean accept​(javax.servlet.http.HttpServletRequest request)
      • handle

        public abstract void handle​(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • write

        protected abstract void write​(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      ServerSessionImpl session,
                                      boolean scheduleExpiration,
                                      java.util.List<ServerMessage> messages,
                                      ServerMessage.Mutable[] replies)
      • processMessages

        protected void processMessages​(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       ServerMessage.Mutable[] messages)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • findCurrentSessions

        protected java.util.Collection<ServerSessionImpl> findCurrentSessions​(javax.servlet.http.HttpServletRequest request)
      • isHTTP2

        protected boolean isHTTP2​(javax.servlet.http.HttpServletRequest request)
      • flush

        protected void flush​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             ServerSessionImpl session,
                             boolean sendQueue,
                             boolean scheduleExpiration,
                             ServerMessage.Mutable... replies)
      • resume

        protected void resume​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              javax.servlet.AsyncContext asyncContext,
                              ServerSessionImpl session,
                              ServerMessage.Mutable reply)
      • getContext

        public BayeuxContext getContext()
        Returns:
        The current transport context or null if no current context
      • findBrowserId

        protected java.lang.String findBrowserId​(javax.servlet.http.HttpServletRequest request)
      • setBrowserId

        protected java.lang.String setBrowserId​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response)
      • incBrowserId

        protected boolean incBrowserId​(ServerSessionImpl session,
                                       boolean http2)
        Increments the count of sessions for the given browser identifier.
        Parameters:
        session - the session that increments the count
        http2 - whether the HTTP protocol is HTTP/2
        Returns:
        true if the count is below the max sessions per browser value. If false is returned, the count is not incremented.
        See Also:
        decBrowserId(ServerSessionImpl, boolean)
      • decBrowserId

        protected void decBrowserId​(ServerSessionImpl session,
                                    boolean http2)
      • handleJSONParseException

        protected void handleJSONParseException​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response,
                                                java.lang.String json,
                                                java.lang.Throwable exception)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • error

        protected void error​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             javax.servlet.AsyncContext asyncContext,
                             int responseCode)
      • metaConnectSuspended

        protected void metaConnectSuspended​(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response,
                                            javax.servlet.AsyncContext asyncContext,
                                            ServerSession session)
      • metaConnectResumed

        protected void metaConnectResumed​(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          javax.servlet.AsyncContext asyncContext,
                                          ServerSession session)