Search in sources :

Example 1 with MicrosoftContactsExporter

use of org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsExporter in project data-transfer-project by google.

the class MicrosoftTransferExtension method getExporter.

@Override
public Exporter<?, ?> getExporter(String transferDataType) {
    // TODO consider memoizing w/ Supplier but we will only use once and pass to worker.
    // This could allow us to refactor these params into supplier.
    OkHttpClient client = new OkHttpClient.Builder().build();
    ObjectMapper mapper = new ObjectMapper();
    TransformerService transformerService = new TransformerServiceImpl();
    if (transferDataType.equals(CONTACTS)) {
        return new MicrosoftContactsExporter(BASE_GRAPH_URL, client, mapper, transformerService);
    }
    if (transferDataType.equals(CALENDAR)) {
        return new MicrosoftCalendarExporter(BASE_GRAPH_URL, client, mapper, transformerService);
    }
    return null;
}
Also used : MicrosoftCalendarExporter(org.dataportabilityproject.transfer.microsoft.calendar.MicrosoftCalendarExporter) MicrosoftContactsExporter(org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsExporter) OkHttpClient(okhttp3.OkHttpClient) TransformerService(org.dataportabilityproject.transfer.microsoft.transformer.TransformerService) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) TransformerServiceImpl(org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 OkHttpClient (okhttp3.OkHttpClient)1 MicrosoftCalendarExporter (org.dataportabilityproject.transfer.microsoft.calendar.MicrosoftCalendarExporter)1 MicrosoftContactsExporter (org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsExporter)1 TransformerService (org.dataportabilityproject.transfer.microsoft.transformer.TransformerService)1 TransformerServiceImpl (org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl)1