com.ning.http.client
Interface ProgressAsyncHandler<T>

All Superinterfaces:
AsyncHandler<T>
All Known Implementing Classes:
AsyncCompletionHandler, AsyncCompletionHandlerBase, TransferCompletionHandler

public interface ProgressAsyncHandler<T>
extends AsyncHandler<T>

An extended AsyncHandler with two extra callback who get invoked during the content upload to a remote server. This AsyncHandler must be used only with PUT and POST request.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ning.http.client.AsyncHandler
AsyncHandler.STATE
 
Method Summary
 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 wasn't fully written in a single I/O write operation.
 AsyncHandler.STATE onHeaderWriteCompleted()
          Invoked when the content (a File, String or FileInputStream has been fully written on the I/O socket.
 
Methods inherited from interface com.ning.http.client.AsyncHandler
onBodyPartReceived, onCompleted, onHeadersReceived, onStatusReceived, onThrowable
 

Method Detail

onHeaderWriteCompleted

AsyncHandler.STATE onHeaderWriteCompleted()
Invoked when the content (a File, String or FileInputStream has been fully written on the I/O socket.

Returns:
a AsyncHandler.STATE telling to CONTINUE or ABORT the current processing.

onContentWriteCompleted

AsyncHandler.STATE onContentWriteCompleted()
Invoked when the content (a File, String or FileInputStream has been fully written on the I/O socket.

Returns:
a AsyncHandler.STATE telling to CONTINUE or ABORT the current processing.

onContentWriteProgress

AsyncHandler.STATE onContentWriteProgress(long amount,
                                          long current,
                                          long total)
Invoked when the I/O operation associated with the Request body wasn't fully written in a single I/O write operation. This method is never invoked if the write operation complete in a sinfle I/O write.

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.


Copyright © 2011. All Rights Reserved.