All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mindsnacks.zinc.classes.ZincBundleDownloader Maven / Gradle / Ivy

There is a newer version: 1.6.2
Show newest version
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