|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.client.AsyncCompletionHandler<T>
T
- Type of the value that will be returned by the associated Future
public abstract class AsyncCompletionHandler<T>
An AsyncHandler
augmented with an onCompleted(Response)
convenience method which gets called
when the Response
processing is finished. This class also implement the ProgressAsyncHandler
callback,
all doing nothing except returning AsyncHandler.STATE.CONTINUE
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.ning.http.client.AsyncHandler |
---|
AsyncHandler.STATE |
Constructor Summary | |
---|---|
AsyncCompletionHandler()
|
Method Summary | |
---|---|
AsyncHandler.STATE |
onBodyPartReceived(HttpResponseBodyPart content)
Invoked as soon as some response body part are received. |
T |
onCompleted()
Invoked once the HTTP response processing is finished. |
abstract T |
onCompleted(Response response)
Invoked once the HTTP response processing is finished. |
AsyncHandler.STATE |
onContentWriteCompleted()
Invoked when the content (a File , String or FileInputStream has been fully
written on the I/O socket. |
AsyncHandler.STATE |
onContentWriteProgress(long amount,
long current,
long total)
Invoked when the I/O operation associated with the Request body as been progressed. |
AsyncHandler.STATE |
onHeadersReceived(HttpResponseHeaders headers)
Invoked as soon as the HTTP headers has been received. |
AsyncHandler.STATE |
onHeaderWriteCompleted()
Invoked when the content (a File , String or FileInputStream has been fully
written on the I/O socket. |
AsyncHandler.STATE |
onStatusReceived(HttpResponseStatus status)
Invoked as soon as the HTTP status line has been received |
void |
onThrowable(Throwable t)
Invoked when an unexpected exception occurs during the processing of the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncCompletionHandler()
Method Detail |
---|
public AsyncHandler.STATE onBodyPartReceived(HttpResponseBodyPart content) throws Exception
onBodyPartReceived
in interface AsyncHandler<T>
content
- response's body part.
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
Exception
- if something wrong happenspublic AsyncHandler.STATE onStatusReceived(HttpResponseStatus status) throws Exception
onStatusReceived
in interface AsyncHandler<T>
status
- the status code and test of the response
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
Exception
- if something wrong happenspublic AsyncHandler.STATE onHeadersReceived(HttpResponseHeaders headers) throws Exception
onHeadersReceived
in interface AsyncHandler<T>
headers
- the HTTP headers.
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
Exception
- if something wrong happenspublic final T onCompleted() throws Exception
onCompleted
in interface AsyncHandler<T>
Future
Exception
- if something wrong happenspublic void onThrowable(Throwable t)
onThrowable
in interface AsyncHandler<T>
t
- a Throwable
public abstract T onCompleted(Response response) throws Exception
response
- The Response
Future
Exception
- if something wrong happenspublic AsyncHandler.STATE onHeaderWriteCompleted()
File
, String
or FileInputStream
has been fully
written on the I/O socket.
onHeaderWriteCompleted
in interface ProgressAsyncHandler<T>
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.public AsyncHandler.STATE onContentWriteCompleted()
File
, String
or FileInputStream
has been fully
written on the I/O socket.
onContentWriteCompleted
in interface ProgressAsyncHandler<T>
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.public AsyncHandler.STATE onContentWriteProgress(long amount, long current, long total)
Request
body as been progressed.
onContentWriteProgress
in interface ProgressAsyncHandler<T>
amount
- The amount of bytes to transfer.current
- The amount of bytes transferredtotal
- The total number of bytes transferred
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |