Package com.google.walkaround.proto.gson

Examples of com.google.walkaround.proto.gson.ImportTaskPayloadGsonImpl


      task.setSettings(settings);
      @Nullable String existingSlobIdToIgnore = optionalParameter(req, "ignoreexisting", null);
      if (existingSlobIdToIgnore != null) {
        task.setExistingSlobIdToIgnore(existingSlobIdToIgnore);
      }
      final ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
      payload.setImportWaveletTask(task);
      log.info("Enqueueing import task for " + waveId
          + "; synthesizeHistory=" + task.getSettings().getSynthesizeHistory());
      enqueueTasks(ImmutableList.of(payload));
    } else if ("canceltasks".equals(action)) {
      log.info("Cancelling all tasks for " + userId);
View Full Code Here


    long taskId = entity.getKey().getId();
    StableUserId userId = new StableUserId(entity.getParent().getName());
    try {
      return new ImportTask(userId, taskId,
          DatastoreUtil.getExistingProperty(entity, TASK_CREATION_TIME_MILLIS_PROPERTY, Long.class),
          GsonProto.fromGson(new ImportTaskPayloadGsonImpl(),
              DatastoreUtil.getExistingProperty(entity, TASK_PAYLOAD_PROPERTY, Text.class)
                  .getValue()));
    } catch (MessageException e) {
      throw new RuntimeException("Failed to parse task entity: " + entity, e);
    }
View Full Code Here

      task.setOnOrAfterDays(interval.getFirst());
      task.setBeforeDays(interval.getSecond());
      if (autoImportSettings != null) {
        task.setAutoImportSettings(autoImportSettings);
      }
      ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
      payload.setFindWavesTask(task);
      accu.add(payload);
    }
    return accu.build();
  }
View Full Code Here

                  task.setInstance(instance.serialize());
                  task.setWaveDigest(result);
                  if (autoImportSettings != null) {
                    task.setAutoImportSettings(autoImportSettings);
                  }
                  ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
                  payload.setFindWaveletsTask(task);
                  perUserTable.addTask(tx, userId, payload);
                }
                tx.commit();
              } finally {
                tx.close();
View Full Code Here

                  ImportWaveletTask task = new ImportWaveletTaskGsonImpl();
                  task.setInstance(wavelet.getSourceInstance().serialize());
                  task.setWaveId(wavelet.getDigest().getWaveId());
                  task.setWaveletId(wavelet.getWaveletId().serialise());
                  task.setSettings(autoImportSettings);
                  ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
                  payload.setImportWaveletTask(task);
                  perUserTable.addTask(tx, userId, payload);
                }
                tx.commit();
              } finally {
                tx.close();
View Full Code Here

    public static TaskCompleted withFollowup(ImportTaskPayload... followupTasks) {
      return new TaskCompleted(ImmutableList.copyOf(followupTasks));
    }

    public static TaskCompleted withFollowup(ImportWaveletTask followupTask) {
      ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
      payload.setImportWaveletTask(followupTask);
      return TaskCompleted.withFollowup(payload);
    }
View Full Code Here

        if (info.hasLocalId()) {
          attachment.setLocalId(info.getLocalId());
        }
        waveletTask.addAttachment(attachment);
      }
      ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
      payload.setImportWaveletTask(waveletTask);
      return ImmutableList.of(payload);
    } else {
      log.info("Will fetch remaining attachments in new task");
      task.clearToImport();
      task.addAllToImport(toImport);
      ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
      payload.setFetchAttachmentsTask(task);
      return ImmutableList.of(payload);
    }
  }
View Full Code Here

        populateAttachmentInfo(newTask, documents, attachmentDocs);
        if (newTask.getToImportSize() == 0) {
          log.info("There are attachments but none can be imported");
          return ImmutableMap.of();
        }
        ImportTaskPayload payload = new ImportTaskPayloadGsonImpl();
        payload.setFetchAttachmentsTask(newTask);
        throw TaskCompleted.withFollowup(payload);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.walkaround.proto.gson.ImportTaskPayloadGsonImpl

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.