public class PostDownloadHandler extends java.lang.Object implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private java.util.function.Consumer<java.util.Collection<java.lang.Object>> |
errorReporter |
private java.util.concurrent.Future<?> |
future |
private DownloadTask |
task |
Constructor and Description |
---|
PostDownloadHandler(DownloadTask task,
java.util.concurrent.Future<?> future)
Creates a new
PostDownloadHandler |
PostDownloadHandler(DownloadTask task,
java.util.concurrent.Future<?> future,
java.util.function.Consumer<java.util.Collection<java.lang.Object>> errorReporter)
Creates a new
PostDownloadHandler using a custom error reporter |
Modifier and Type | Method and Description |
---|---|
void |
run() |
private final DownloadTask task
private final java.util.concurrent.Future<?> future
private java.util.function.Consumer<java.util.Collection<java.lang.Object>> errorReporter
public PostDownloadHandler(DownloadTask task, java.util.concurrent.Future<?> future)
PostDownloadHandler
task
- the asynchronous download taskfuture
- the future on which the completion of the download task can be synchronizedpublic PostDownloadHandler(DownloadTask task, java.util.concurrent.Future<?> future, java.util.function.Consumer<java.util.Collection<java.lang.Object>> errorReporter)
PostDownloadHandler
using a custom error reportertask
- the asynchronous download taskfuture
- the future on which the completion of the download task can be synchronizederrorReporter
- a callback to inform about the number errors happened during the download
taskpublic void run()
run
in interface java.lang.Runnable