public static interface Response.Listener
Modifier and Type | Interface and Description |
---|---|
static class |
Response.Listener.Empty
An empty implementation of
Response.Listener |
Modifier and Type | Method and Description |
---|---|
void |
onBegin(Response response)
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 response,
ByteBuffer content)
Callback method invoked when the response content has been received.
|
void |
onFailure(Response response,
Throwable failure)
Callback method invoked when the response has failed in the process of being received
|
void |
onHeaders(Response response)
Callback method invoked when the response headers have been received and parsed.
|
void |
onSuccess(Response response)
Callback method invoked when the whole response has been successfully received.
|
void onBegin(Response response)
response
- the response containing the response line datavoid onHeaders(Response response)
response
- the response containing the response line data and the headersvoid onContent(Response response, ByteBuffer content)
content
buffer must be consumed
before returning from this method.response
- the response containing the response line data and the headerscontent
- the content bytes receivedvoid onSuccess(Response response)
response
- the response containing the response line data and the headersvoid onFailure(Response response, Throwable failure)
response
- the response containing data up to the point the failure happenedfailure
- the failure happenedvoid onComplete(Result result)
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 onSuccess(Response)
or
onFailure(Response, Throwable)
, and only when request indicates that it is completed.result
- the result of the request / response exchangeCopyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.