Class AsyncCompletionHandler<T>

    • Constructor Detail

      • AsyncCompletionHandler

        public AsyncCompletionHandler()
    • Method Detail

      • onBodyPartReceived

        public AsyncHandler.State onBodyPartReceived​(HttpResponseBodyPart content)
                                              throws Exception
        Description copied from interface: AsyncHandler
        Invoked 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:
        onBodyPartReceived in interface AsyncHandler<T>
        Parameters:
        content - response's body part.
        Returns:
        a AsyncHandler.State telling to CONTINUE or ABORT the current processing. Aborting will also close the connection.
        Throws:
        Exception - if something wrong happens
      • onCompleted

        @Nullable
        public final T onCompleted()
                            throws Exception
        Description copied from interface: AsyncHandler
        Invoked once the HTTP response processing is finished.
        Gets always invoked as last callback method.
        Specified by:
        onCompleted in interface AsyncHandler<T>
        Returns:
        T Value that will be returned by the associated Future
        Throws:
        Exception - if something wrong happens
      • onThrowable

        public void onThrowable​(Throwable t)
        Description copied from interface: AsyncHandler
        Invoked 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:
        onThrowable in 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.
        Parameters:
        response - The Response
        Returns:
        T Value that will be returned by the associated Future
        Throws:
        Exception - if something wrong happens
      • onContentWriteProgress

        public AsyncHandler.State onContentWriteProgress​(long amount,
                                                         long current,
                                                         long total)
        Invoked when the I/O operation associated with the Request body as been progressed.
        Specified by:
        onContentWriteProgress in 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.State telling to CONTINUE or ABORT the current processing.