Package org.asynchttpclient
Class AsyncCompletionHandler<T>
- java.lang.Object
- 
- org.asynchttpclient.AsyncCompletionHandler<T>
 
- 
- Type Parameters:
- T- Type of the value that will be returned by the associated- Future
 - All Implemented Interfaces:
- AsyncHandler<T>,- ProgressAsyncHandler<T>
 - Direct Known Subclasses:
- AsyncCompletionHandlerBase
 
 public abstract class AsyncCompletionHandler<T> extends Object implements ProgressAsyncHandler<T> AnAsyncHandleraugmented with anonCompleted(Response)convenience method which gets called when theResponseprocessing is finished. This class also implements theProgressAsyncHandlercallback, all doing nothing except returningAsyncHandler.State.CONTINUE
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.asynchttpclient.AsyncHandlerAsyncHandler.State
 
- 
 - 
Constructor SummaryConstructors Constructor Description AsyncCompletionHandler()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AsyncHandler.StateonBodyPartReceived(HttpResponseBodyPart content)Invoked as soon as some response body part are received.TonCompleted()Invoked once the HTTP response processing is finished.abstract TonCompleted(@Nullable Response response)Invoked once the HTTP response processing is finished.AsyncHandler.StateonContentWriteProgress(long amount, long current, long total)Invoked when the I/O operation associated with theRequestbody as been progressed.AsyncHandler.StateonContentWritten()AsyncHandler.StateonHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers)Invoked as soon as the HTTP headers have been received.AsyncHandler.StateonHeadersWritten()Invoked when the HTTP headers have been fully written on the I/O socket.AsyncHandler.StateonStatusReceived(HttpResponseStatus status)Invoked as soon as the HTTP status line has been receivedvoidonThrowable(Throwable t)Invoked when an unexpected exception occurs during the processing of the response.AsyncHandler.StateonTrailingHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers)Invoked when trailing headers have been received.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.asynchttpclient.AsyncHandleronConnectionOffer, onConnectionPoolAttempt, onConnectionPooled, onHostnameResolutionAttempt, onHostnameResolutionFailure, onHostnameResolutionSuccess, onRequestSend, onRetry, onTcpConnectAttempt, onTcpConnectFailure, onTcpConnectSuccess, onTlsHandshakeAttempt, onTlsHandshakeFailure, onTlsHandshakeSuccess
 
- 
 
- 
- 
- 
Method Detail- 
onStatusReceivedpublic AsyncHandler.State onStatusReceived(HttpResponseStatus status) throws Exception Description copied from interface:AsyncHandlerInvoked as soon as the HTTP status line has been received- Specified by:
- onStatusReceivedin interface- AsyncHandler<T>
- Parameters:
- status- the status code and test of the response
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing.
- Throws:
- Exception- if something wrong happens
 
 - 
onHeadersReceivedpublic AsyncHandler.State onHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers) throws Exception Description copied from interface:AsyncHandlerInvoked as soon as the HTTP headers have been received.- Specified by:
- onHeadersReceivedin interface- AsyncHandler<T>
- Parameters:
- headers- the HTTP headers.
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing.
- Throws:
- Exception- if something wrong happens
 
 - 
onBodyPartReceivedpublic AsyncHandler.State onBodyPartReceived(HttpResponseBodyPart content) throws Exception Description copied from interface:AsyncHandlerInvoked as soon as some response body part are received. Could be invoked many times. Beware that, depending on the provider (Netty) this can be notified with empty body parts.- Specified by:
- onBodyPartReceivedin interface- AsyncHandler<T>
- Parameters:
- content- response's body part.
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing. Aborting will also close the connection.
- Throws:
- Exception- if something wrong happens
 
 - 
onTrailingHeadersReceivedpublic AsyncHandler.State onTrailingHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers) throws Exception Description copied from interface:AsyncHandlerInvoked when trailing headers have been received.- Specified by:
- onTrailingHeadersReceivedin interface- AsyncHandler<T>
- Parameters:
- headers- the trailing HTTP headers.
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing.
- Throws:
- Exception- if something wrong happens
 
 - 
onCompleted@Nullable public final T onCompleted() throws Exception Description copied from interface:AsyncHandlerInvoked once the HTTP response processing is finished.
 Gets always invoked as last callback method.- Specified by:
- onCompletedin interface- AsyncHandler<T>
- Returns:
- T Value that will be returned by the associated Future
- Throws:
- Exception- if something wrong happens
 
 - 
onThrowablepublic void onThrowable(Throwable t) Description copied from interface:AsyncHandlerInvoked when an unexpected exception occurs during the processing of the response. The exception may have been produced by implementation of onXXXReceived method invocation.- Specified by:
- onThrowablein interface- AsyncHandler<T>
- Parameters:
- t- a- Throwable
 
 - 
onCompleted@Nullable public abstract T onCompleted(@Nullable @Nullable Response response) throws Exception Invoked once the HTTP response processing is finished.
 - 
onHeadersWrittenpublic AsyncHandler.State onHeadersWritten() Invoked when the HTTP headers have been fully written on the I/O socket.- Specified by:
- onHeadersWrittenin interface- ProgressAsyncHandler<T>
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing.
 
 - 
onContentWrittenpublic AsyncHandler.State onContentWritten() - Specified by:
- onContentWrittenin interface- ProgressAsyncHandler<T>
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing.
 
 - 
onContentWriteProgresspublic AsyncHandler.State onContentWriteProgress(long amount, long current, long total) Invoked when the I/O operation associated with theRequestbody as been progressed.- Specified by:
- onContentWriteProgressin interface- ProgressAsyncHandler<T>
- Parameters:
- amount- The amount of bytes to transfer
- current- The amount of bytes transferred
- total- The total number of bytes transferred
- Returns:
- a AsyncHandler.Statetelling to CONTINUE or ABORT the current processing.
 
 
- 
 
-