|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.api.statistics.DataTransferListener<S,T,E>
S - type of the supported sources of dataT - type of the supported targets of dataE - type of the entries managed by this list, created for each individual data transfer with a call to
newDataTransfer(Object, long, Object)public abstract class DataTransferListener<S,T,E extends DataTransfer<S,T>>
A basic management structure for data transfers occurring in parallel.
DownloadListener,
DataTransfer| Constructor Summary | |
|---|---|
DataTransferListener()
|
|
| Method Summary | |
|---|---|
void |
aborted(S source,
T target,
Exception error)
Notifies that the data transfer has been aborted. |
void |
completed(S source,
T target)
Notifies that a data transfer has been finalized. |
List<E> |
getActiveTransfers()
Returns a copy of the internal list of currently active transfers |
boolean |
isAborted()
Returns a flag indicating whether the data transfer was aborted. |
boolean |
isRunning()
Returns a flag indicating whether the data transfer is running. |
boolean |
isStarted()
Returns a flag indicating whether the data transfer has been started. |
Iterator<E> |
iterator()
|
protected abstract E |
newDataTransfer(S source,
long totalSize,
T target)
Creates a a new DataTransfer |
int |
size()
Returns the number of active transfers currently maintained by this list |
void |
started(S source,
long totalSize,
T target)
Notifies a data transfer has been started. |
void |
transferred(S source,
long transferred,
T target)
Notifies how much data has been transferred from source to target. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataTransferListener()
| Method Detail |
|---|
public void started(S source,
long totalSize,
T target)
DataTransfer
started in interface DataTransfer<S,T>source - the source of datatotalSize - the total size of the data. The meaning of the
amount provided depends on the underlying implementation: this can be bytes, number of
records, etc. If -1, the total size is unknown ahead of time.target - the data target
public void transferred(S source,
long transferred,
T target)
DataTransfer
transferred in interface DataTransfer<S,T>source - the source of datatransferred - the amount of data transferred since the last time this method was called. The meaning of the
amount provided depends on the underlying implementation: this can be bytes, number of
records, etc.target - the data target
public void completed(S source,
T target)
DataTransfer
completed in interface DataTransfer<S,T>source - the source of datatarget - the data target
public void aborted(S source,
T target,
Exception error)
DataTransfer
aborted in interface DataTransfer<S,T>source - the source of datatarget - the data targeterror - exception that caused the process abortion.
protected abstract E newDataTransfer(S source,
long totalSize,
T target)
DataTransfer
source - where the data will be transferred fromtotalSize - the total size of the data to be transferredtarget - the target where the data will be transferred to
DataTransfer that will transfer data of size totalSize
from source to targetpublic final boolean isStarted()
DataTransfer
isStarted in interface DataTransfer<S,T>public final boolean isRunning()
DataTransfer
isRunning in interface DataTransfer<S,T>public final boolean isAborted()
DataTransfer
isAborted in interface DataTransfer<S,T>public int size()
public List<E> getActiveTransfers()
public Iterator<E> iterator()
iterator in interface Iterable<E extends DataTransfer<S,T>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||