Search in sources :

Example 1 with BackblazePhotosImporter

use of org.datatransferproject.datatransfer.backblaze.photos.BackblazePhotosImporter in project data-transfer-project by google.

the class BackblazeTransferExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    Monitor monitor = context.getMonitor();
    monitor.debug(() -> "Starting Backblaze initialization");
    if (initialized) {
        monitor.severe(() -> "BackblazeTransferExtension already initialized.");
        return;
    }
    TemporaryPerJobDataStore jobStore = context.getService(TemporaryPerJobDataStore.class);
    ImmutableMap.Builder<String, Importer> importerBuilder = ImmutableMap.builder();
    BackblazeDataTransferClientFactory backblazeDataTransferClientFactory = new BackblazeDataTransferClientFactory(monitor);
    ImageStreamProvider isProvider = new ImageStreamProvider();
    importerBuilder.put("PHOTOS", new BackblazePhotosImporter(monitor, jobStore, isProvider, backblazeDataTransferClientFactory));
    importerBuilder.put("VIDEOS", new BackblazeVideosImporter(monitor, jobStore, isProvider, backblazeDataTransferClientFactory));
    importerMap = importerBuilder.build();
    initialized = true;
}
Also used : BackblazeDataTransferClientFactory(org.datatransferproject.datatransfer.backblaze.common.BackblazeDataTransferClientFactory) TemporaryPerJobDataStore(org.datatransferproject.spi.cloud.storage.TemporaryPerJobDataStore) BackblazePhotosImporter(org.datatransferproject.datatransfer.backblaze.photos.BackblazePhotosImporter) Monitor(org.datatransferproject.api.launcher.Monitor) ImageStreamProvider(org.datatransferproject.transfer.ImageStreamProvider) BackblazeVideosImporter(org.datatransferproject.datatransfer.backblaze.videos.BackblazeVideosImporter) ImmutableMap(com.google.common.collect.ImmutableMap) BackblazeVideosImporter(org.datatransferproject.datatransfer.backblaze.videos.BackblazeVideosImporter) BackblazePhotosImporter(org.datatransferproject.datatransfer.backblaze.photos.BackblazePhotosImporter) Importer(org.datatransferproject.spi.transfer.provider.Importer)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 Monitor (org.datatransferproject.api.launcher.Monitor)1 BackblazeDataTransferClientFactory (org.datatransferproject.datatransfer.backblaze.common.BackblazeDataTransferClientFactory)1 BackblazePhotosImporter (org.datatransferproject.datatransfer.backblaze.photos.BackblazePhotosImporter)1 BackblazeVideosImporter (org.datatransferproject.datatransfer.backblaze.videos.BackblazeVideosImporter)1 TemporaryPerJobDataStore (org.datatransferproject.spi.cloud.storage.TemporaryPerJobDataStore)1 Importer (org.datatransferproject.spi.transfer.provider.Importer)1 ImageStreamProvider (org.datatransferproject.transfer.ImageStreamProvider)1