com.univocity.api.statistics
Class DownloadStatistics

java.lang.Object
  extended by com.univocity.api.statistics.DataTransferStatistics<UrlReaderProvider,File>
      extended by com.univocity.api.statistics.DownloadStatistics
All Implemented Interfaces:
DataTransfer<UrlReaderProvider,File>

public abstract class DownloadStatistics
extends DataTransferStatistics<UrlReaderProvider,File>

A simple implementation of DataTransferStatistics to notify the progress/completion of download processes

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
DataTransferStatistics, DataTransfer, TimedNotificationHandler

Constructor Summary
DownloadStatistics()
          Creates a default download listener that notifies the dataDownloaded(DownloadStatistics, boolean) every 250ms.
DownloadStatistics(long notificationInterval)
          Creates a default download listener that notifies the dataDownloaded(DownloadStatistics, boolean) at a rate defined by the user
 
Method Summary
protected abstract  void dataDownloaded(DownloadStatistics status, boolean lastNotification)
          Notifies of an update on the status of a download process.
 
Methods inherited from class com.univocity.api.statistics.DataTransferStatistics
aborted, completed, equals, getAbortError, getAverageRate, getAverageRate, getEndTime, getEndTime, getEndTime, getFormattedAverageRate, getFormattedAverageRate, getFormattedRatePerSecond, getFormattedRatePerSecond, getFormattedTotalSize, getFormattedTotalSize, getFormattedTotalTransferredSoFar, getFormattedTotalTransferredSoFar, getFormattedTransferPercentage, getFormattedTransferPercentage, getRatePerSecond, getSource, getStartTime, getStartTime, getStartTime, getTarget, getTimeElapsed, getTimeElapsed, getTotalSize, getTotalTransferredSoFar, getTransferPercentage, getUnitDescription, getUnitDivisor, hashCode, isAborted, isRunning, isStarted, setNotificationHandler, setNotificationHandler, setUnit, setUnit, started, toString, transferred
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DownloadStatistics

public DownloadStatistics()
Creates a default download listener that notifies the dataDownloaded(DownloadStatistics, boolean) every 250ms.


DownloadStatistics

public DownloadStatistics(long notificationInterval)
Creates a default download listener that notifies the dataDownloaded(DownloadStatistics, boolean) at a rate defined by the user

Parameters:
notificationInterval - how often, in milliseconds, the dataDownloaded(DownloadStatistics, boolean) should be invoked.
Method Detail

dataDownloaded

protected abstract void dataDownloaded(DownloadStatistics status,
                                       boolean lastNotification)
Notifies of an update on the status of a download process.

Parameters:
status - an object with statistics and information about the download and its progress
lastNotification - a flag indicating whether this notification is the last one (i.e. the download completed or was aborted due to an error)


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