public class DownloadWorker extends Object implements Callable<DownloadReportMap>
| Constructor and Description |
|---|
DownloadWorker(BlockingQueue<String> queue,
eu.dnetlib.data.objectstore.modular.connector.ObjectStore objectStore,
eu.dnetlib.data.objectstore.rmi.Protocols protocol,
String mimeType,
int connectTimeoutMs,
int readTimeoutMs,
int sleepTimeMs,
com.google.common.base.Function<String,eu.dnetlib.data.download.rmi.DownloadItem> converter)
Instantiates a new download worker.
|
| Modifier and Type | Method and Description |
|---|---|
DownloadReportMap |
call() |
void |
doDownload(long threadId,
DownloadReportMap report,
eu.dnetlib.data.download.rmi.DownloadItem di) |
int |
getConnectTimeoutMs() |
com.google.common.base.Function<String,eu.dnetlib.data.download.rmi.DownloadItem> |
getConverter() |
int |
getReadTimeoutMs() |
int |
getSleepTimeMs() |
void |
setConnectTimeoutMs(int connectTimeoutMs) |
void |
setConverter(com.google.common.base.Function<String,eu.dnetlib.data.download.rmi.DownloadItem> converter) |
void |
setMimeType(String mimeType)
Sets the mime type.
|
void |
setObjectStore(eu.dnetlib.data.objectstore.modular.connector.ObjectStore objectStore)
Sets the object store.
|
void |
setProtocol(eu.dnetlib.data.objectstore.rmi.Protocols protocol)
Sets the protocol.
|
void |
setQueue(BlockingQueue<String> queue)
Sets the queue.
|
void |
setReadTimeoutMs(int readTimeoutMs) |
void |
setSleepTimeMs(int sleepTimeMs) |
public DownloadWorker(BlockingQueue<String> queue, eu.dnetlib.data.objectstore.modular.connector.ObjectStore objectStore, eu.dnetlib.data.objectstore.rmi.Protocols protocol, String mimeType, int connectTimeoutMs, int readTimeoutMs, int sleepTimeMs, com.google.common.base.Function<String,eu.dnetlib.data.download.rmi.DownloadItem> converter)
queue - the queueobjectStore - the object storeprotocol - the protocolmimeType - the mime typepublic DownloadReportMap call() throws Exception
call in interface Callable<DownloadReportMap>Exceptionpublic void doDownload(long threadId,
DownloadReportMap report,
eu.dnetlib.data.download.rmi.DownloadItem di)
public void setObjectStore(eu.dnetlib.data.objectstore.modular.connector.ObjectStore objectStore)
objectStore - the objectStore to setpublic void setQueue(BlockingQueue<String> queue)
queue - the queue to setpublic void setProtocol(eu.dnetlib.data.objectstore.rmi.Protocols protocol)
protocol - the protocol to setpublic void setMimeType(String mimeType)
mimeType - the mimeType to setpublic com.google.common.base.Function<String,eu.dnetlib.data.download.rmi.DownloadItem> getConverter()
public void setConverter(com.google.common.base.Function<String,eu.dnetlib.data.download.rmi.DownloadItem> converter)
public int getReadTimeoutMs()
public void setReadTimeoutMs(int readTimeoutMs)
public int getConnectTimeoutMs()
public void setConnectTimeoutMs(int connectTimeoutMs)
public int getSleepTimeMs()
public void setSleepTimeMs(int sleepTimeMs)
Copyright © 2018. All rights reserved.