use of org.datatransferproject.transfer.daybook.photos.DaybookPhotosImporter in project data-transfer-project by google.
the class DaybookTransferExtension method initialize.
@Override
public void initialize(ExtensionContext context) {
Monitor monitor = context.getMonitor();
if (initialized) {
monitor.severe(() -> "DaybookTransferExtension 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);
ImmutableMap.Builder<String, Importer> importerBuilder = ImmutableMap.builder();
importerBuilder.put("PHOTOS", new DaybookPhotosImporter(monitor, client, mapper, jobStore, BASE_URL));
importerBuilder.put("SOCIAL-POSTS", new DaybookPostsImporter(monitor, client, mapper, BASE_URL));
importerMap = importerBuilder.build();
initialized = true;
}
Aggregations