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:
java.util.EventListener,Response.AsyncContentListener,Response.BeginListener,Response.CompleteListener,Response.ContentListener,Response.FailureListener,Response.HeaderListener,Response.HeadersListener,Response.Listener,Response.ResponseListener,Response.SuccessListener
- Enclosing class:
- ProxyServlet
protected class ProxyServlet.ProxyResponseListener extends Response.Listener.Adapter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Response.Listener
Response.Listener.Adapter
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedProxyResponseListener(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonBegin(Response proxyResponse)Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed.voidonComplete(Result result)Callback method invoked when the request and the response have been processed, either successfully or not.voidonContent(Response proxyResponse, java.nio.ByteBuffer content, Callback callback)Callback method invoked asynchronously when the response content has been received.voidonHeaders(Response proxyResponse)Callback method invoked when the response headers have been received and parsed.-
Methods inherited from class org.eclipse.jetty.client.api.Response.Listener.Adapter
onContent, onFailure, onHeader, onSuccess
-
-
-
-
Method Detail
-
onBegin
public void onBegin(Response proxyResponse)
Description copied from interface:Response.BeginListenerCallback 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:
onBeginin interfaceResponse.BeginListener- Overrides:
onBeginin classResponse.Listener.Adapter- Parameters:
proxyResponse- the response containing the response line data
-
onHeaders
public void onHeaders(Response proxyResponse)
Description copied from interface:Response.HeadersListenerCallback method invoked when the response headers have been received and parsed.- Specified by:
onHeadersin interfaceResponse.HeadersListener- Overrides:
onHeadersin classResponse.Listener.Adapter- Parameters:
proxyResponse- the response containing the response line data and the headers
-
onContent
public void onContent(Response proxyResponse, java.nio.ByteBuffer content, Callback callback)
Description copied from interface:Response.AsyncContentListenerCallback method invoked asynchronously when the response content has been received.- Specified by:
onContentin interfaceResponse.AsyncContentListener- Overrides:
onContentin classResponse.Listener.Adapter- 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.
-
onComplete
public void onComplete(Result result)
Description copied from interface:Response.CompleteListenerCallback method invoked when the request and the response have been processed, either successfully or not.The
resultparameter 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.- Specified by:
onCompletein interfaceResponse.CompleteListener- Overrides:
onCompletein classResponse.Listener.Adapter- Parameters:
result- the result of the request / response exchange
-
-