Package com.amazonaws.event.request
Class ProgressSupport
- java.lang.Object
-
- com.amazonaws.event.request.Progress
-
- com.amazonaws.event.request.ProgressSupport
-
public class ProgressSupport extends Progress
An actual implementation to represent the progress of a request/response.
-
-
Constructor Summary
Constructors Constructor Description ProgressSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
getRequestBytesTransferred()
Returns the number of bytes that have been transferred in the request.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).long
getResponseBytesTransferred()
Returns the number of bytes that have been transferred in the response.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).boolean
isEnabled()
Returns true if progress tracking is enabled; false otherwise.String
toString()
-
-
-
Method Detail
-
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.
-
-