Search in sources :

Example 1 with RememberTheMilkTasksExporter

use of org.datatransferproject.transfer.rememberthemilk.tasks.RememberTheMilkTasksExporter in project data-transfer-project by google.

the class RememberTheMilkTransferExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    if (initialized)
        return;
    AppCredentials credentials;
    try {
        credentials = context.getService(AppCredentialStore.class).getAppCredentials(RTM_KEY, RTM_SECRET);
    } catch (IOException e) {
        Monitor monitor = context.getMonitor();
        monitor.info(() -> format("Unable to retrieve RememberTheMilk AppCredentials. Did you set %s and %s?", RTM_KEY, RTM_SECRET), e);
        return;
    }
    Monitor monitor = context.getMonitor();
    exporter = new RememberTheMilkTasksExporter(credentials);
    importer = new RememberTheMilkTasksImporter(credentials, monitor);
    initialized = true;
}
Also used : Monitor(org.datatransferproject.api.launcher.Monitor) RememberTheMilkTasksExporter(org.datatransferproject.transfer.rememberthemilk.tasks.RememberTheMilkTasksExporter) RememberTheMilkTasksImporter(org.datatransferproject.transfer.rememberthemilk.tasks.RememberTheMilkTasksImporter) AppCredentials(org.datatransferproject.types.transfer.auth.AppCredentials) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Monitor (org.datatransferproject.api.launcher.Monitor)1 RememberTheMilkTasksExporter (org.datatransferproject.transfer.rememberthemilk.tasks.RememberTheMilkTasksExporter)1 RememberTheMilkTasksImporter (org.datatransferproject.transfer.rememberthemilk.tasks.RememberTheMilkTasksImporter)1 AppCredentials (org.datatransferproject.types.transfer.auth.AppCredentials)1