public abstract static class AgentUtils.ArtifactDownloader<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<String,T> |
artifacts |
protected List<Throwable> |
errors |
protected ConcurrentMap<String,DownloadFuture> |
futures |
protected Object |
lock |
protected DownloadManager |
manager |
protected AtomicInteger |
pendings |
Constructor and Description |
---|
AgentUtils.ArtifactDownloader(DownloadManager manager) |
Modifier and Type | Method and Description |
---|---|
Map<String,T> |
await() |
void |
download(Iterable<String> uris) |
DownloadFuture |
download(String uri) |
void |
download(String uri,
AgentUtils.DownloadCallback callback) |
protected abstract T |
getArtifact(String uri,
File file) |
protected void |
onDownloaded(DownloadFuture future,
AgentUtils.DownloadCallback callback) |
protected final DownloadManager manager
protected final Object lock
protected final ConcurrentMap<String,DownloadFuture> futures
protected final ConcurrentMap<String,T> artifacts
protected final AtomicInteger pendings
public AgentUtils.ArtifactDownloader(DownloadManager manager)
public void download(String uri, AgentUtils.DownloadCallback callback) throws MalformedURLException
MalformedURLException
public DownloadFuture download(String uri) throws MalformedURLException
MalformedURLException
protected void onDownloaded(DownloadFuture future, AgentUtils.DownloadCallback callback)
protected abstract T getArtifact(String uri, File file) throws Exception
Exception
public void download(Iterable<String> uris) throws MalformedURLException
MalformedURLException
public Map<String,T> await() throws InterruptedException, io.fabric8.common.util.MultiException
InterruptedException
io.fabric8.common.util.MultiException
Copyright © 2011–2014 Red Hat. All rights reserved.