Package com.google.walkaround.wave.server.attachment

Examples of com.google.walkaround.wave.server.attachment.AttachmentId


  private Map<String, AttachmentId> buildAttachmentMapping(ImportWaveletTask task) {
    ImmutableMap.Builder<String, AttachmentId> out = ImmutableMap.builder();
    for (ImportedAttachment attachment : task.getAttachment()) {
      if (attachment.hasLocalId()) {
        out.put(attachment.getRemoteId(), new AttachmentId(attachment.getLocalId()));
      }
    }
    return out.build();
  }
View Full Code Here


      for (Map.Entry<String, String> entry : attrs.entrySet()) {
        if (!ATTACHMENT_ID_ATTRIBUTE_NAME.equals(entry.getKey())) {
          newAttrs.put(entry.getKey(), entry.getValue());
        } else {
          String newValue;
          AttachmentId mapped = mapping.get(entry.getValue());
          if (mapped == null) {
            log.warning("Attachment id not found: " + entry);
            // Preserve; not sure this is a good idea but it's probably better
            // than dropping the value.
            newValue = entry.getValue();
          } else {
            log.info("Replacing " + entry + " with value " + mapped);
            newValue = mapped.getId();
          }
          newAttrs.put(entry.getKey(), newValue);
        }
      }
      attrs = AttributesImpl.fromStringMap(newAttrs);
View Full Code Here

    LinkedList<RemoteAttachmentInfo> toImport = Lists.newLinkedList(task.getToImport());
    log.info("Need attachments for " + waveletName + ": " + toImport);
    int infosFetchedThisTask = 0;
    while (!toImport.isEmpty() && infosFetchedThisTask < MAX_FETCHES_PER_TASK) {
      RemoteAttachmentInfo info = toImport.removeFirst();
      AttachmentId localId = fetchAttachment(instance, info);
      log.info("Local id: " + localId);
      ImportedAttachmentInfo imported = new ImportedAttachmentInfoGsonImpl();
      imported.setRemoteInfo(info);
      if (localId != null) {
        imported.setLocalId(localId.getId());
      }
      infosFetchedThisTask++;
      task.addImported(imported);
    }
    if (toImport.isEmpty()) {
View Full Code Here

TOP

Related Classes of com.google.walkaround.wave.server.attachment.AttachmentId

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.