public class ReliableResourceDownloadManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DOWNLOAD_ID_PROPERTY_KEY |
Constructor and Description |
---|
ReliableResourceDownloadManager(ReliableResourceDownloaderConfig downloaderConfig,
DownloadStatusInfo downloadStatusInfo,
ExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
ResourceResponse |
download(ResourceRequest resourceRequest,
Metacard metacard,
ResourceRetriever retriever) |
List<ddf.catalog.resource.download.DownloadInfo> |
getDownloadsInProgress() |
void |
init() |
boolean |
isCacheEnabled() |
void |
setCacheEnabled(boolean cacheEnabled) |
void |
setCacheWhenCanceled(boolean cacheWhenCanceled) |
void |
setChunkSize(int chunkSize) |
void |
setDelayBetweenAttempts(int delayBetweenAttempts) |
void |
setDownloaderConfig(ReliableResourceDownloaderConfig downloaderConfig) |
void |
setMaxRetryAttempts(int maxRetryAttempts) |
void |
setMonitorInitialDelay(int monitorInitialDelay) |
void |
setMonitorPeriod(long monitorPeriod) |
void |
setProductCacheDirectory(String productCacheDirectory) |
public static final String DOWNLOAD_ID_PROPERTY_KEY
public ReliableResourceDownloadManager(ReliableResourceDownloaderConfig downloaderConfig, DownloadStatusInfo downloadStatusInfo, ExecutorService executor)
downloaderConfig
- reference to the ReliableResourceDownloaderConfig
public void init()
public void cleanUp()
public ResourceResponse download(ResourceRequest resourceRequest, Metacard metacard, ResourceRetriever retriever) throws DownloadException
resourceRequest
- the original @ResourceRequest to retrieve the resourcemetacard
- the @Metacard associated with the resource being downloadedretriever
- the @ResourceRetriever to be used to get the resourceDownloadException
public void setMaxRetryAttempts(int maxRetryAttempts)
public void setDelayBetweenAttempts(int delayBetweenAttempts)
public void setMonitorPeriod(long monitorPeriod)
public void setMonitorInitialDelay(int monitorInitialDelay)
public void setCacheEnabled(boolean cacheEnabled)
public void setCacheWhenCanceled(boolean cacheWhenCanceled)
public void setDownloaderConfig(ReliableResourceDownloaderConfig downloaderConfig)
public void setChunkSize(int chunkSize)
public boolean isCacheEnabled()
public void setProductCacheDirectory(String productCacheDirectory)
public List<ddf.catalog.resource.download.DownloadInfo> getDownloadsInProgress()
This work is licensed under a Creative Commons Attribution 4.0 International License.