Class AsyncMiddleManServlet.ProxyResponseListener

    • Constructor Detail

      • ProxyResponseListener

        protected ProxyResponseListener​(javax.servlet.http.HttpServletRequest clientRequest,
                                        javax.servlet.http.HttpServletResponse proxyResponse)
    • Method Detail

      • onBegin

        public void onBegin​(Response serverResponse)
        Description copied from interface: Response.BeginListener
        Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.

        This method is the best approximation to detect when the first bytes of the response arrived to the client.

        Specified by:
        onBegin in interface Response.BeginListener
        Specified by:
        onBegin in interface Response.Listener
        Parameters:
        serverResponse - the response containing the response line data
      • onContent

        public void onContent​(Response serverResponse,
                              java.nio.ByteBuffer content,
                              Callback callback)
        Description copied from interface: Response.AsyncContentListener
        Callback method invoked when the response content has been received, parsed and there is demand. The callback object should be succeeded to signal that the content buffer has been consumed and to demand more content.
        Specified by:
        onContent in interface Response.AsyncContentListener
        Specified by:
        onContent in interface Response.ContentListener
        Parameters:
        serverResponse - the response containing the response line data and the headers
        content - the content bytes received
        callback - the callback to call when the content is consumed and to demand more content
      • failed

        public void failed​(java.lang.Throwable failure)
        Description copied from interface: Callback

        Callback invoked when the operation fails.

        Specified by:
        failed in interface Callback
        Parameters:
        failure - the reason for the operation failure