Package com.google.walkaround.proto

Examples of com.google.walkaround.proto.FindRemoteWavesTask


    }
  }

  public String describeTask(ImportTask task) {
    if (task.getPayload().hasFindWavesTask()) {
      FindRemoteWavesTask t = task.getPayload().getFindWavesTask();
      return taskAgePrefix(task)
          + (t.hasAutoImportSettings() ? "Find and import" : "Find") + " waves on "
          + sourceInstanceFactory.parseUnchecked(t.getInstance()).getShortName()
          + " between " + DaysSinceEpoch.toLocalDate(t.getOnOrAfterDays())
          + " and " + DaysSinceEpoch.toLocalDate(t.getBeforeDays());
    } else if (task.getPayload().hasFindWaveletsTask()) {
        FindWaveletsForRemoteWaveTask t = task.getPayload().getFindWaveletsTask();
        return taskAgePrefix(task)
            + (t.hasAutoImportSettings() ? "Find and import" : "Find")
            + " wavelets in wave " + t.getWaveDigest().getWaveId() + " on "
            + sourceInstanceFactory.parseUnchecked(t.getInstance()).getShortName();
    } else if (task.getPayload().hasImportWaveletTask()) {
      ImportWaveletTask t = task.getPayload().getImportWaveletTask();
      String sharingMode;
      switch (t.getSettings().getSharingMode()) {
        case PRIVATE:
          sharingMode = "Private";
          break;
        case SHARED:
          sharingMode = "Shared";
          break;
        case PRIVATE_UNLESS_PARTICIPANT:
          sharingMode = "Shared (if participant)";
          break;
        default:
          throw new AssertionError("Unexpected SharingMode: " + t.getSettings().getSharingMode());
      }
      return taskAgePrefix(task)
          + sharingMode + " import of wavelet " + t.getWaveId() + " " + t.getWaveletId()
          + " from " + sourceInstanceFactory.parseUnchecked(t.getInstance()).getShortName();
    } else if (task.getPayload().hasFetchAttachmentsTask()) {
      FetchAttachmentsAndImportWaveletTask t = task.getPayload().getFetchAttachmentsTask();
      return taskAgePrefix(task)
          + " Fetch attachments for wavelet "
          + t.getOriginalImportTask().getWaveId() + " " + t.getOriginalImportTask().getWaveletId()
          + " from " + sourceInstanceFactory.parseUnchecked(
              t.getOriginalImportTask().getInstance()).getShortName()
          + " (" + t.getImportedSize() + "/" + (t.getImportedSize() + t.getToImportSize()) + ")";
    } else {
      throw new AssertionError("Unknown task payload type: " + task);
    }
  }
View Full Code Here


      SourceInstance instance, List<Pair<Long, Long>> intervals,
      @Nullable ImportSettings autoImportSettings) {
    log.info("intervals=" + intervals + ", settings=" + autoImportSettings);
    ImmutableList.Builder<ImportTaskPayload> accu = ImmutableList.builder();
    for (Pair<Long, Long> interval : intervals) {
      FindRemoteWavesTask task = new FindRemoteWavesTaskGsonImpl();
      task.setInstance(instance.serialize());
      task.setOnOrAfterDays(interval.getFirst());
      task.setBeforeDays(interval.getSecond());
      if (autoImportSettings != null) {
        task.setAutoImportSettings(autoImportSettings);
      }
      ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
      payload.setFindWavesTask(task);
      accu.add(payload);
    }
View Full Code Here

TOP

Related Classes of com.google.walkaround.proto.FindRemoteWavesTask

Copyright © 2018 www.massapicom. 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.