Search in sources :

Example 1 with ImgurPhotosImporter

use of org.datatransferproject.datatransfer.imgur.photos.ImgurPhotosImporter in project data-transfer-project by google.

the class ImgurTransferExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    Monitor monitor = context.getMonitor();
    if (initialized) {
        monitor.severe(() -> "ImgurTransferExtension is already initialized");
        return;
    }
    ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    OkHttpClient client = context.getService(OkHttpClient.class);
    TemporaryPerJobDataStore jobStore = context.getService(TemporaryPerJobDataStore.class);
    exporter = new ImgurPhotosExporter(monitor, client, mapper, jobStore, BASE_URL);
    importer = new ImgurPhotosImporter(monitor, client, mapper, jobStore, BASE_URL);
    initialized = true;
}
Also used : TemporaryPerJobDataStore(org.datatransferproject.spi.cloud.storage.TemporaryPerJobDataStore) Monitor(org.datatransferproject.api.launcher.Monitor) OkHttpClient(okhttp3.OkHttpClient) ImgurPhotosImporter(org.datatransferproject.datatransfer.imgur.photos.ImgurPhotosImporter) ImgurPhotosExporter(org.datatransferproject.datatransfer.imgur.photos.ImgurPhotosExporter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 OkHttpClient (okhttp3.OkHttpClient)1 Monitor (org.datatransferproject.api.launcher.Monitor)1 ImgurPhotosExporter (org.datatransferproject.datatransfer.imgur.photos.ImgurPhotosExporter)1 ImgurPhotosImporter (org.datatransferproject.datatransfer.imgur.photos.ImgurPhotosImporter)1 TemporaryPerJobDataStore (org.datatransferproject.spi.cloud.storage.TemporaryPerJobDataStore)1