public abstract class MultipleFileTransfer<T extends Transfer> extends AbstractTransfer
Transfer.TransferState
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<? extends T> |
subTransfers |
private java.util.concurrent.atomic.AtomicBoolean |
subTransferStarted
Whether any of the sub-transfers has started.
|
listenerChain, monitor, state, stateChangeListeners
Constructor and Description |
---|
MultipleFileTransfer(java.lang.String description,
TransferProgress transferProgress,
ProgressListenerChain progressListenerChain,
java.util.Collection<? extends T> subTransfers) |
Modifier and Type | Method and Description |
---|---|
void |
collateFinalState()
Set the state based on the states of all file downloads.
|
void |
setState(Transfer.TransferState state)
Override this method so that TransferState updates are also sent out to the
progress listener chain in forms of ProgressEvent.
|
addProgressListener, addProgressListener, addStateChangeListener, fireProgressEvent, getDescription, getMonitor, getProgress, getState, isDone, notifyStateChangeListeners, removeProgressListener, removeProgressListener, removeStateChangeListener, rethrowExecutionException, setMonitor, unwrapExecutionException, waitForCompletion, waitForException
private java.util.concurrent.atomic.AtomicBoolean subTransferStarted
MultipleFileTransfer(java.lang.String description, TransferProgress transferProgress, ProgressListenerChain progressListenerChain, java.util.Collection<? extends T> subTransfers)
public void collateFinalState()
A single failed sub-transfer makes the entire transfer failed. If there are no failed sub-transfers, a single canceled sub-transfer makes the entire transfer canceled. Otherwise, we consider ourselves Completed.
public void setState(Transfer.TransferState state)
setState
in class AbstractTransfer