Interface JettyHttpUtils

  • All Known Implementing Classes:
    Jetty11HttpUtils

    public interface JettyHttpUtils
    Helper utility interface to inject Jetty 11/12/... specific response / request handling
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean IS_JETTY  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isBrowserProxyRequest​(jakarta.servlet.http.HttpServletRequest request)
      Checks if the HttpServletRequest is a browser proxy request
      static boolean isJetty()  
      void setStatusWithReason​(int status, java.lang.String reason, jakarta.servlet.http.HttpServletResponse httpServletResponse)
      Sets the HttpServletResponse status and reason (if supported), depending on Jetty version.
      java.net.Socket socket​(org.eclipse.jetty.server.Response response)
      Extracts the raw network socket of out Jetty's Response
      java.net.Socket tlsSocket​(org.eclipse.jetty.server.Response response)
      Extracts the raw network TLS socket of out Jetty's Response
      org.eclipse.jetty.io.EndPoint unwrapEndPoint​(org.eclipse.jetty.server.Response response)
      Unwraps Jetty's EndPoint out of the Response
      org.eclipse.jetty.server.Response unwrapResponse​(jakarta.servlet.http.HttpServletResponse httpServletResponse)
      Unwraps Jetty's Response out of the HttpServletResponse
    • Field Detail

      • IS_JETTY

        static final boolean IS_JETTY
    • Method Detail

      • isJetty

        static boolean isJetty()
      • unwrapResponse

        org.eclipse.jetty.server.Response unwrapResponse​(jakarta.servlet.http.HttpServletResponse httpServletResponse)
        Unwraps Jetty's Response out of the HttpServletResponse
        Parameters:
        httpServletResponse - HttpServletResponse instance
        Returns:
        unwrapped Response instance
      • socket

        java.net.Socket socket​(org.eclipse.jetty.server.Response response)
        Extracts the raw network socket of out Jetty's Response
        Parameters:
        response - Response instance
        Returns:
        raw network socket
      • setStatusWithReason

        void setStatusWithReason​(int status,
                                 java.lang.String reason,
                                 jakarta.servlet.http.HttpServletResponse httpServletResponse)
        Sets the HttpServletResponse status and reason (if supported), depending on Jetty version.
        Parameters:
        status - status
        reason - reason
        httpServletResponse - HttpServletResponse instance to set status and reason (if supported)
      • tlsSocket

        java.net.Socket tlsSocket​(org.eclipse.jetty.server.Response response)
        Extracts the raw network TLS socket of out Jetty's Response
        Parameters:
        response - Response instance
        Returns:
        raw network TLS socket
      • unwrapEndPoint

        org.eclipse.jetty.io.EndPoint unwrapEndPoint​(org.eclipse.jetty.server.Response response)
        Unwraps Jetty's EndPoint out of the Response
        Parameters:
        response - Response instance
        Returns:
        unwrapped EndPoint instance
      • isBrowserProxyRequest

        boolean isBrowserProxyRequest​(jakarta.servlet.http.HttpServletRequest request)
        Checks if the HttpServletRequest is a browser proxy request
        Parameters:
        request - HttpServletRequest instance
        Returns:
        true if is a request isbrowser proxy request, false otherwise