use of org.datatransferproject.types.transfer.serviceconfig.TransferServiceConfig 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;
}
use of org.datatransferproject.types.transfer.serviceconfig.TransferServiceConfig in project data-transfer-project by google.
the class DeezerTransferExtension method initialize.
@Override
public void initialize(ExtensionContext context) {
if (initialized) {
Monitor monitor = context.getMonitor();
monitor.severe(() -> "DeezerTransferExtension already initialized");
return;
}
Monitor monitor = context.getMonitor();
HttpTransport httpTransport = context.getService(HttpTransport.class);
TransferServiceConfig transferServiceConfig = context.getService(TransferServiceConfig.class);
exporter = new DeezerPlaylistExporter(monitor, httpTransport, transferServiceConfig);
importer = new DeezerPlaylistImporter(monitor, httpTransport, transferServiceConfig);
initialized = true;
}
Aggregations