Search in sources :

Example 1 with FlickrPhotosExporter

use of org.datatransferproject.datatransfer.flickr.photos.FlickrPhotosExporter in project data-transfer-project by google.

the class FlickrTransferExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    if (initialized)
        return;
    jobStore = context.getService(TemporaryPerJobDataStore.class);
    Monitor monitor = context.getMonitor();
    try {
        appCredentials = context.getService(AppCredentialStore.class).getAppCredentials(FLICKR_KEY, FLICKR_SECRET);
    } catch (Exception e) {
        monitor.info(() -> format("Unable to retrieve Flickr AppCredentials. Did you set %s and %s?", FLICKR_KEY, FLICKR_SECRET), e);
        initialized = false;
        return;
    }
    TransferServiceConfig serviceConfig = context.getService(TransferServiceConfig.class);
    importer = new FlickrPhotosImporter(appCredentials, jobStore, monitor, serviceConfig);
    exporter = new FlickrPhotosExporter(appCredentials, serviceConfig);
    initialized = true;
}
Also used : FlickrPhotosImporter(org.datatransferproject.datatransfer.flickr.photos.FlickrPhotosImporter) TemporaryPerJobDataStore(org.datatransferproject.spi.cloud.storage.TemporaryPerJobDataStore) Monitor(org.datatransferproject.api.launcher.Monitor) FlickrPhotosExporter(org.datatransferproject.datatransfer.flickr.photos.FlickrPhotosExporter) TransferServiceConfig(org.datatransferproject.types.transfer.serviceconfig.TransferServiceConfig)

Aggregations

Monitor (org.datatransferproject.api.launcher.Monitor)1 FlickrPhotosExporter (org.datatransferproject.datatransfer.flickr.photos.FlickrPhotosExporter)1 FlickrPhotosImporter (org.datatransferproject.datatransfer.flickr.photos.FlickrPhotosImporter)1 TemporaryPerJobDataStore (org.datatransferproject.spi.cloud.storage.TemporaryPerJobDataStore)1 TransferServiceConfig (org.datatransferproject.types.transfer.serviceconfig.TransferServiceConfig)1