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_MAX_AGE_OPTION

        public static final java.lang.String BROWSER_COOKIE_MAX_AGE_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
      • BROWSER_COOKIE_SAME_SITE_OPTION

        public static final java.lang.String BROWSER_COOKIE_SAME_SITE_OPTION
        See Also:
        Constant Field Values
      • BROWSER_COOKIE_PARTITIONED_OPTION

        public static final java.lang.String BROWSER_COOKIE_PARTITIONED_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_OPTION

        public static final java.lang.String TRUST_CLIENT_SESSION_OPTION
        See Also:
        Constant Field Values
      • DUPLICATE_META_CONNECT_HTTP_RESPONSE_CODE_OPTION

        public static final java.lang.String DUPLICATE_META_CONNECT_HTTP_RESPONSE_CODE_OPTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractHttpTransport

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

      • getMultiSessionInterval

        protected long getMultiSessionInterval()
      • getDuplicateMetaConnectHttpResponseCode

        protected int getDuplicateMetaConnectHttpResponseCode()
      • accept

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

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

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

        protected boolean isHTTP2​(jakarta.servlet.http.HttpServletRequest request)
      • sendError

        protected void sendError​(jakarta.servlet.http.HttpServletRequest request,
                                 jakarta.servlet.http.HttpServletResponse response,
                                 int code,
                                 java.lang.Throwable failure)
      • 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​(jakarta.servlet.http.HttpServletRequest request,
                                                jakarta.servlet.http.HttpServletResponse response,
                                                java.lang.String json,
                                                java.lang.Throwable failure)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getAsyncContext

        protected jakarta.servlet.AsyncContext getAsyncContext​(jakarta.servlet.http.HttpServletRequest request)
      • toJSONBytes

        protected byte[] toJSONBytes​(ServerMessage msg)