use of org.dataportabilityproject.spi.transfer.provider.Exporter in project data-transfer-project by google.
the class LocalExportTestRunner method main.
@SuppressWarnings("unchecked")
public static void main(String... args) throws Exception {
AuthTestDriver authTestDriver = new AuthTestDriver();
MicrosoftTransferExtension serviceProvider = new MicrosoftTransferExtension();
TokenAuthData token = authTestDriver.getOAuthTokenCode();
Exporter<TokenAuthData, ContactsModelWrapper> contacts = (Exporter<TokenAuthData, ContactsModelWrapper>) serviceProvider.getExporter("contacts");
ExportResult<ContactsModelWrapper> wrapper = contacts.export(UUID.randomUUID(), token);
}
use of org.dataportabilityproject.spi.transfer.provider.Exporter in project data-transfer-project by google.
the class GoogleTransferExtension method initialize.
@Override
public void initialize(ExtensionContext context) {
// times.
if (initialized)
return;
jobStore = context.getService(JobStore.class);
ImmutableMap.Builder<String, Importer> importerBuilder = ImmutableMap.builder();
importerBuilder.put("contacts", new GoogleContactsImporter());
importerBuilder.put("calendar", new GoogleCalendarImporter(jobStore));
importerBuilder.put("tasks", new GoogleTasksImporter(jobStore));
importerMap = importerBuilder.build();
ImmutableMap.Builder<String, Exporter> exporterBuilder = ImmutableMap.builder();
exporterBuilder.put("contacts", new GoogleContactsExporter());
exporterBuilder.put("calendar", new GoogleCalendarExporter());
exporterBuilder.put("tasks", new GoogleTasksExporter());
exporterMap = exporterBuilder.build();
initialized = true;
}
Aggregations