public abstract class AbstractTransfer extends java.lang.Object implements Transfer
Transfer.TransferState| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected TransferMonitor |
monitor |
protected ProgressListenerChain |
progressListenerChain
Hook for adding/removing more progress listeners.
|
protected java.util.Collection<TransferStateChangeListener> |
stateChangeListeners
Collection of listeners to be notified for changes to the state of this transfer via setState()
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addProgressListener(ProgressListener listener)
Adds the specified progress listener to the list of listeners
receiving updates about this transfer's progress.
|
void |
addStateChangeListener(TransferStateChangeListener listener)
Adds the given state change listener to the collection of listeners.
|
java.lang.String |
getDescription()
Returns a human-readable description of this transfer.
|
TransferMonitor |
getMonitor() |
TransferProgress |
getProgress()
Returns progress information about this transfer.
|
Transfer.TransferState |
getState()
Returns the current state of this transfer.
|
boolean |
isDone()
Returns whether or not the transfer is finished (i.e. completed successfully,
failed, or was canceled).
|
void |
removeProgressListener(ProgressListener listener)
Removes the specified progress listener from the list of progress
listeners receiving updates about this transfer's progress.
|
void |
removeStateChangeListener(TransferStateChangeListener listener)
Removes the given state change listener from the collection of listeners.
|
protected void |
rethrowExecutionException(java.util.concurrent.ExecutionException e)
Examines the cause of the specified ExecutionException and either
rethrows it directly (if it's a type of AmazonClientException) or wraps
it in an AmazonClientException and rethrows it.
|
void |
setMonitor(TransferMonitor monitor)
Sets the monitor used to poll for transfer completion.
|
void |
setState(Transfer.TransferState state)
Sets the current state of this transfer.
|
protected AmazonClientException |
unwrapExecutionException(java.util.concurrent.ExecutionException e)
Unwraps the root exception that caused the specified ExecutionException
and returns it.
|
void |
waitForCompletion()
Waits for this transfer to complete.
|
AmazonClientException |
waitForException()
Waits for this transfer to finish and returns any error that occurred, or
returns
null if no errors occurred. |
protected TransferMonitor monitor
protected ProgressListenerChain progressListenerChain
protected final java.util.Collection<TransferStateChangeListener> stateChangeListeners
public boolean isDone()
public void waitForCompletion()
throws AmazonClientException,
AmazonServiceException,
java.lang.InterruptedException
waitForCompletion インタフェース内 TransferAmazonClientException - If any errors were encountered in the client while making the
request or handling the response.AmazonServiceException - If any errors occurred in Amazon S3 while processing the
request.java.lang.InterruptedException - If this thread is interrupted while waiting for the transfer
to complete.public AmazonClientException waitForException() throws java.lang.InterruptedException
null if no errors occurred.
This is a blocking call; the current thread
will be suspended until this transfer either fails or completes
successfully.waitForException インタフェース内 Transfernull if no errors occurred.java.lang.InterruptedException - If this thread is interrupted while waiting for the transfer
to complete.public java.lang.String getDescription()
getDescription インタフェース内 Transferpublic Transfer.TransferState getState()
public void setState(Transfer.TransferState state)
public void addProgressListener(ProgressListener listener)
addProgressListener インタフェース内 Transferlistener - The progress listener to add.public void removeProgressListener(ProgressListener listener)
removeProgressListener インタフェース内 Transferlistener - The progress listener to remove.public void addStateChangeListener(TransferStateChangeListener listener)
public void removeStateChangeListener(TransferStateChangeListener listener)
public TransferProgress getProgress()
getProgress インタフェース内 Transferpublic void setMonitor(TransferMonitor monitor)
public TransferMonitor getMonitor()
protected void rethrowExecutionException(java.util.concurrent.ExecutionException e)
e - The execution exception to examine.protected AmazonClientException unwrapExecutionException(java.util.concurrent.ExecutionException e)
e - The ExecutionException to unwrap.