public class ProgressSupport extends Progress
Modifier and Type | Field and Description |
---|---|
private static java.lang.Object |
lock |
private long |
requestBytesTransferred |
private long |
requestContentLength |
private long |
responseBytesTransferred |
private long |
responseContentLength |
Constructor and Description |
---|
ProgressSupport() |
Modifier and Type | Method and 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.
|
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.
|
boolean |
isEnabled()
Returns true if progress tracking is enabled; false otherwise.
|
java.lang.String |
toString() |
private volatile long requestContentLength
private volatile long requestBytesTransferred
private volatile long responseContentLength
private volatile long responseBytesTransferred
private static final java.lang.Object lock
public long getRequestContentLength()
getRequestContentLength
in class Progress
public void addRequestContentLength(long contentLength)
addRequestContentLength
in class Progress
public long getRequestBytesTransferred()
getRequestBytesTransferred
in class Progress
public long getResponseContentLength()
getResponseContentLength
in class Progress
public void addResponseContentLength(long contentLength)
addResponseContentLength
in class Progress
public long getResponseBytesTransferred()
getResponseBytesTransferred
in class Progress
public void addRequestBytesTransferred(long bytes)
addRequestBytesTransferred
in class Progress
bytes
- can be negative if it was a reset event.public void addResponseBytesTransferred(long bytes)
addResponseBytesTransferred
in class Progress
bytes
- can be negative if it was a reset event.public java.lang.String toString()
toString
in class java.lang.Object