com.mindsnacks.zinc.classes.ZincBundleDownloader Maven / Gradle / Ivy
package com.mindsnacks.zinc.classes;
import com.mindsnacks.zinc.classes.data.ZincBundle;
import com.mindsnacks.zinc.classes.data.ZincCatalogsCache;
import com.mindsnacks.zinc.classes.data.ZincCloneBundleRequest;
import com.mindsnacks.zinc.classes.downloads.PriorityJobQueue;
import java.util.concurrent.Callable;
/**
* User: NachoSoto
* Date: 10/8/13
*/
public class ZincBundleDownloader implements PriorityJobQueue.DataProcessor {
private final ZincJobFactory mJobFactory;
private final ZincCatalogsCache mCatalogs;
public ZincBundleDownloader(final ZincJobFactory jobFactory, final ZincCatalogsCache catalogs) {
mJobFactory = jobFactory;
mCatalogs = catalogs;
}
@Override
public Callable process(final ZincCloneBundleRequest request) {
return mJobFactory.cloneBundle(request, mCatalogs.getCatalog(request.getSourceURL()));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy