Examples of RobotApi


Examples of org.waveprotocol.box.waveimport.google.RobotApi

    context.setParticipantId(new ParticipantId(participantId));
    OAuthCredentials cred = new OAuthCredentials(refreshToken, accessToken);
    context.setOAuthCredentials(cred);
    OAuthRequestHelper helper = new OAuthRequestHelper(clientId, clientSecret, context);
    OAuthedFetchService oauthService = new OAuthedFetchService(httpClient, helper);
    RobotApi api = new RobotApi(oauthService, WAVE_RPC);
    try {
      List<String> waves = includeList;
      if (waves.isEmpty()) {
        waves = getAllWavesList(api);
      }
      int processedCount = 0;
      int errorCount = 0;
      for (String waveId : waves) {
        try {
          if (excludeList.contains(waveId)) {
            System.out.println("Skipping wave " + waveId + "...");
            continue;
          }
          for (WaveletId waveletId : api.getWaveView(WaveId.deserialise(waveId))) {
            long fromVersion = 0;
            for (int fetchNum = 0;; fetchNum++) {
              System.out.println("Exporting wavelet " + waveId + ":" + waveletId.serialise()
                  + " from version " + fromVersion + " ...");
              JSONObject json = api.fetchWaveWithDeltas(WaveId.deserialise(waveId),
                  waveletId, fromVersion);
              JSONArray rawDeltas = json.getJSONObject("data").getJSONArray("rawDeltas");
              if (rawDeltas.length() == 0) {
                break;
              }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.