Package com.amazonaws.event.request
Class ProgressSupport
java.lang.Object
com.amazonaws.event.request.Progress
com.amazonaws.event.request.ProgressSupport
An actual implementation to represent the progress of a request/response.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestBytesTransferred
(long bytes) void
addRequestContentLength
(long contentLength) Adds the number of bytes to be expected in the request.void
addResponseBytesTransferred
(long bytes) void
addResponseContentLength
(long contentLength) Adds the number of bytes to be expected in the response.long
Returns the number of bytes that have been transferred in the request.long
Returns the number of bytes to be expected in the request, or -1 if the number is unknown (e.g. when the request is still not serialized yet, or when the request contains raw InputStream as the payload in which case the SDK cannot infer the content-length in advance).long
Returns the number of bytes that have been transferred in the response.long
Returns the number of bytes to be expected in the response, or -1 if the number is unknown (e.g. when the client hasn't received the response yet).final boolean
Returns true if progress tracking is enabled; false otherwise.toString()
-
Constructor Details
-
ProgressSupport
public ProgressSupport()
-
-
Method Details
-
getRequestContentLength
public long getRequestContentLength()Returns the number of bytes to be expected in the request, or -1 if the number is unknown (e.g. when the request is still not serialized yet, or when the request contains raw InputStream as the payload in which case the SDK cannot infer the content-length in advance).- Overrides:
getRequestContentLength
in classProgress
-
addRequestContentLength
public void addRequestContentLength(long contentLength) Adds the number of bytes to be expected in the request.- Overrides:
addRequestContentLength
in classProgress
-
getRequestBytesTransferred
public long getRequestBytesTransferred()Returns the number of bytes that have been transferred in the request.- Overrides:
getRequestBytesTransferred
in classProgress
-
getResponseContentLength
public long getResponseContentLength()Returns the number of bytes to be expected in the response, or -1 if the number is unknown (e.g. when the client hasn't received the response yet).- Overrides:
getResponseContentLength
in classProgress
-
addResponseContentLength
public void addResponseContentLength(long contentLength) Adds the number of bytes to be expected in the response.- Overrides:
addResponseContentLength
in classProgress
-
getResponseBytesTransferred
public long getResponseBytesTransferred()Returns the number of bytes that have been transferred in the response.- Overrides:
getResponseBytesTransferred
in classProgress
-
addRequestBytesTransferred
public void addRequestBytesTransferred(long bytes) - Overrides:
addRequestBytesTransferred
in classProgress
- Parameters:
bytes
- can be negative if it was a reset event.
-
addResponseBytesTransferred
public void addResponseBytesTransferred(long bytes) - Overrides:
addResponseBytesTransferred
in classProgress
- Parameters:
bytes
- can be negative if it was a reset event.
-
toString
-
isEnabled
public final boolean isEnabled()Description copied from class:Progress
Returns true if progress tracking is enabled; false otherwise.
-