|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jets3t.service.multithread.ThreadWatcher
public class ThreadWatcher
A thread watcher is associated with a multi-threaded S3 operation and contains information about the progress of the operation.
As a minimum, this object will contain a count of the total number of threads involved in the operation
(via getThreadCount()
) and the count of threads that have already finished
(via getCompletedThreads()
).
For operations involving data transfer, such as uploads or downloads, this object may
also include a count of the total bytes being transferred (via getBytesTotal()
) and a count
of how many bytes have already been transferred (via getBytesTransferred()
). The
availability of this information is indicated by the result of isBytesTransferredInfoAvailable()
.
Further data tranfer information may be also available, such as the current transfer rate (via
getBytesPerSecond()
) and an estimate of the time remaining until the transfer is
completed (via getTimeRemaining()
). The availability of this information is indicated
by the result of isTimeRemainingAvailable()
.
It is possible to cancel some S3 operations. If an operation may be cancelled, this object will
include a CancelEventTrigger
(available from getCancelEventListener()
) which can
be used to trigger a cancellation. Whether the operation can be cancelled is indicated by
isCancelTaskSupported()
.
Method Summary | |
---|---|
void |
cancelTask()
Convenience method to trigger an event cancellation via CancelEventTrigger.cancelTask(java.lang.Object)
if this thread watcher is associated with an operation that can be cancelled. |
long |
getBytesPerSecond()
|
long |
getBytesTotal()
|
long |
getBytesTransferred()
|
CancelEventTrigger |
getCancelEventListener()
|
long |
getCompletedThreads()
|
long |
getThreadCount()
|
long |
getTimeRemaining()
|
boolean |
isBytesTransferredInfoAvailable()
If this method returns true, the methods getBytesTotal() and getBytesTransferred()
will contain information about the amount of data being transferred by the watched threads. |
boolean |
isCancelTaskSupported()
|
boolean |
isTimeRemainingAvailable()
If this method returns true, the method getTimeRemaining() will contain
an estimate of the completion time for the data transfer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public long getCompletedThreads()
public long getThreadCount()
public boolean isBytesTransferredInfoAvailable()
getBytesTotal()
and getBytesTransferred()
will contain information about the amount of data being transferred by the watched threads.
public long getBytesTotal() throws IllegalStateException
IllegalStateException
- if the bytes transferred information is not available - check this availability
with the isBytesTransferredInfoAvailable()
method.public long getBytesTransferred()
IllegalStateException
- if the bytes transferred information is not available - check this availability
with the isBytesTransferredInfoAvailable()
method.public long getBytesPerSecond()
public boolean isTimeRemainingAvailable()
getTimeRemaining()
will contain
an estimate of the completion time for the data transfer.
public long getTimeRemaining()
IllegalStateException
- if the time remaining estimave is not available - check this availability
with the isTimeRemainingAvailable()
method.public boolean isCancelTaskSupported()
CancelEventTrigger
is available.public void cancelTask()
CancelEventTrigger.cancelTask(java.lang.Object)
if this thread watcher is associated with an operation that can be cancelled.
public CancelEventTrigger getCancelEventListener()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |