Package org.eclipse.jetty.proxy
Class ProxyServlet.ProxyResponseListener
java.lang.Object
org.eclipse.jetty.client.api.Response.Listener.Adapter
org.eclipse.jetty.proxy.ProxyServlet.ProxyResponseListener
- All Implemented Interfaces:
EventListener
,Response.AsyncContentListener
,Response.BeginListener
,Response.CompleteListener
,Response.ContentListener
,Response.DemandedContentListener
,Response.FailureListener
,Response.HeaderListener
,Response.HeadersListener
,Response.Listener
,Response.ResponseListener
,Response.SuccessListener
- Enclosing class:
- ProxyServlet
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Response.Listener
Response.Listener.Adapter
-
Constructor Summary
ModifierConstructorDescriptionprotected
ProxyResponseListener
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.void
onComplete
(Result result) Callback method invoked when the request and the response have been processed, either successfully or not.void
onContent
(Response proxyResponse, ByteBuffer content, Callback callback) Callback method invoked when the response content has been received, parsed and there is demand.void
Callback method invoked when all the response headers have been received and parsed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.client.api.Response.AsyncContentListener
onContent
Methods inherited from interface org.eclipse.jetty.client.api.Response.DemandedContentListener
onBeforeContent
Methods inherited from interface org.eclipse.jetty.client.api.Response.Listener
onContent, onFailure, onHeader, onSuccess
-
Constructor Details
-
ProxyResponseListener
protected ProxyResponseListener(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
-
-
Method Details
-
onBegin
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.
- Parameters:
proxyResponse
- the response containing the response line data
-
onHeaders
Description copied from interface:Response.HeadersListener
Callback method invoked when all the response headers have been received and parsed.- Parameters:
proxyResponse
- the response containing the response line data and the headers
-
onContent
Description copied from interface:Response.AsyncContentListener
Callback method invoked when the response content has been received, parsed and there is demand. Thecallback
object should be succeeded to signal that thecontent
buffer has been consumed and to demand more content.- Parameters:
proxyResponse
- the response containing the response line data and the headerscontent
- the content bytes receivedcallback
- the callback to call when the content is consumed and to demand more content
-
onComplete
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)
orResponse.FailureListener.onFailure(Response, Throwable)
, and only when request indicates that it is completed.- Parameters:
result
- the result of the request / response exchange
-