Class AsyncMiddleManServlet.ProxyResponseListener

java.lang.Object
org.eclipse.jetty.ee10.proxy.AsyncMiddleManServlet.ProxyResponseListener
All Implemented Interfaces:
EventListener, Response.AsyncContentListener, Response.BeginListener, Response.CompleteListener, Response.ContentListener, Response.ContentSourceListener, Response.FailureListener, Response.HeaderListener, Response.HeadersListener, Response.Listener, Response.ResponseListener, Response.SuccessListener, Callback, Invocable
Enclosing class:
AsyncMiddleManServlet

protected class AsyncMiddleManServlet.ProxyResponseListener extends Object implements Callback, Response.Listener
  • Constructor Details

    • ProxyResponseListener

      protected ProxyResponseListener(jakarta.servlet.http.HttpServletRequest clientRequest, jakarta.servlet.http.HttpServletResponse proxyResponse)
  • Method Details

    • 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
    • onHeaders

      public void onHeaders(Response serverResponse)
      Description copied from interface: Response.HeadersListener
      Callback method invoked when all the response headers have been received and parsed.
      Specified by:
      onHeaders in interface Response.HeadersListener
      Specified by:
      onHeaders in interface Response.Listener
      Parameters:
      serverResponse - the response containing the response line data and the headers
    • onContent

      public void onContent(Response serverResponse, Content.Chunk chunk, Runnable demander)
      Description copied from interface: Response.AsyncContentListener
      Callback method invoked when the response content has been received, parsed and there is demand. The chunk must be consumed, copied, or retained before returning from this method as it is then automatically released. The demander must be run before this method may be invoked again.
      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
      chunk - the chunk received
      demander - the runnable to be run to demand the next chunk
    • onSuccess

      public void onSuccess(Response serverResponse)
      Description copied from interface: Response.SuccessListener
      Callback method invoked when the whole response has been successfully received.
      Specified by:
      onSuccess in interface Response.Listener
      Specified by:
      onSuccess in interface Response.SuccessListener
      Parameters:
      serverResponse - the response containing the response line data and the headers
    • onComplete

      public void onComplete(Result result)
      Description copied from interface: Response.CompleteListener
      Callback method invoked when the request and the response have been processed, either successfully or not.

      The result parameter contains the request, the response, and eventual failures.

      Requests may complete after response, for example in case of big uploads that are discarded or read asynchronously by the server. This method is always invoked after Response.SuccessListener.onSuccess(Response) or Response.FailureListener.onFailure(Response, Throwable), and only when request indicates that it is completed.

      Specified by:
      onComplete in interface Response.CompleteListener
      Specified by:
      onComplete in interface Response.Listener
      Parameters:
      result - the result of the request / response exchange
    • succeeded

      public void succeeded()
      Description copied from interface: Callback

      Callback invoked when the operation completes.

      Specified by:
      succeeded in interface Callback
      See Also:
    • failed

      public void failed(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