com.univocity.api.statistics
Class NoopDataTransfer

java.lang.Object
  extended by com.univocity.api.statistics.NoopDataTransfer
All Implemented Interfaces:
DataTransfer

public final class NoopDataTransfer
extends Object
implements DataTransfer

A singleton DataTransfer that does nothing.

Author:
uniVocity Software Pty Ltd - dev@univocity.com

Field Summary
static DataTransfer instance
          The only instance available of a NoopDataTransfer
 
Method Summary
 void aborted(Object source, Object target, Exception error)
          Notifies that the data transfer has been aborted.
 void completed(Object source, Object target)
          Notifies that a data transfer has been finalized.
static
<S,T> DataTransfer<S,T>
getInstance()
          Returns the singleton instance of a NoopDataTransfer in generic-friendly way
 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.
 void started(Object source, long totalSize, Object target)
          Notifies a data transfer has been started.
 void transferred(Object source, long transferred, Object 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
 

Field Detail

instance

public static final DataTransfer instance
The only instance available of a NoopDataTransfer

Method Detail

getInstance

public static final <S,T> DataTransfer<S,T> getInstance()
Returns the singleton instance of a NoopDataTransfer in generic-friendly way

Type Parameters:
S - the source of data, where data is coming from
T - the target of data, where data is being transferred into.
Returns:
the NoopDataTransfer singleton instance

started

public final void started(Object source,
                          long totalSize,
                          Object target)
Description copied from interface: DataTransfer
Notifies a data transfer has been started.

Specified by:
started in interface DataTransfer
Parameters:
source - the source of data
totalSize - 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

transferred

public final void transferred(Object source,
                              long transferred,
                              Object target)
Description copied from interface: DataTransfer
Notifies how much data has been transferred from source to target. Can be invoked multiple times until the data transfer is completed or aborted.

Specified by:
transferred in interface DataTransfer
Parameters:
source - the source of data
transferred - 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

completed

public final void completed(Object source,
                            Object target)
Description copied from interface: DataTransfer
Notifies that a data transfer has been finalized.

Specified by:
completed in interface DataTransfer
Parameters:
source - the source of data
target - the data target

aborted

public final void aborted(Object source,
                          Object target,
                          Exception error)
Description copied from interface: DataTransfer
Notifies that the data transfer has been aborted.

Specified by:
aborted in interface DataTransfer
Parameters:
source - the source of data
target - the data target
error - exception that caused the process abortion.

isStarted

public boolean isStarted()
Description copied from interface: DataTransfer
Returns a flag indicating whether the data transfer has been started.

Specified by:
isStarted in interface DataTransfer
Returns:
a flag indicating whether the data transfer has been started.

isRunning

public boolean isRunning()
Description copied from interface: DataTransfer
Returns a flag indicating whether the data transfer is running.

Specified by:
isRunning in interface DataTransfer
Returns:
a flag indicating whether the data transfer is running.

isAborted

public boolean isAborted()
Description copied from interface: DataTransfer
Returns a flag indicating whether the data transfer was aborted.

Specified by:
isAborted in interface DataTransfer
Returns:
a flag indicating whether the data transfer was aborted.


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.