protected class ProxyServlet.ProxyResponseListener extends Response.Listener.Adapter
Response.Listener.Adapter| Modifier and Type | Field and Description |
|---|---|
private javax.servlet.http.HttpServletRequest |
request |
private javax.servlet.http.HttpServletResponse |
response |
| Modifier | Constructor and Description |
|---|---|
protected |
ProxyResponseListener(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
| Modifier and Type | Method and Description |
|---|---|
void |
onBegin(Response proxyResponse)
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,
java.nio.ByteBuffer content,
Callback callback)
Callback method invoked asynchronously when the response content has been received.
|
void |
onHeaders(Response proxyResponse)
Callback method invoked when the response headers have been received and parsed.
|
onContent, onFailure, onHeader, onSuccessprivate final javax.servlet.http.HttpServletRequest request
private final javax.servlet.http.HttpServletResponse response
protected ProxyResponseListener(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
public void onBegin(Response proxyResponse)
Response.BeginListenerThis method is the best approximation to detect when the first bytes of the response arrived to the client.
onBegin in interface Response.BeginListeneronBegin in class Response.Listener.AdapterproxyResponse - the response containing the response line datapublic void onHeaders(Response proxyResponse)
Response.HeadersListeneronHeaders in interface Response.HeadersListeneronHeaders in class Response.Listener.AdapterproxyResponse - the response containing the response line data and the headerspublic void onContent(Response proxyResponse, java.nio.ByteBuffer content, Callback callback)
Response.AsyncContentListeneronContent in interface Response.AsyncContentListeneronContent in class Response.Listener.AdapterproxyResponse - the response containing the response line data and the headerscontent - the content bytes receivedcallback - the callback to call when the content is consumed.public void onComplete(Result result)
Response.CompleteListener
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.
onComplete in interface Response.CompleteListeneronComplete in class Response.Listener.Adapterresult - the result of the request / response exchange