Examples of DocumentSnapshot


Examples of com.google.enterprise.connector.util.diffing.DocumentSnapshot

    LOG.log(Level.FINE, "Building document snapshots for {0} rows.",
        rows.size());
    List<DocumentSnapshot> docList = Lists.newArrayList();
    for (Map<String, Object> row : rows) {
      try {
        DocumentSnapshot snapshot = docBuilder.getDocumentSnapshot(row);
        if (snapshot != null) {
          if (LOG.isLoggable(Level.FINER)) {
            LOG.finer("DBSnapshotRepository returns document with docID "
                + snapshot.getDocumentId());
          }
          docList.add(snapshot);
        }
      } catch (DBException e) {
        // See the similar log message in DBSnapshot.getDocumentHandle.
View Full Code Here

Examples of com.google.enterprise.connector.util.diffing.DocumentSnapshot

    writeAndClose(writer, before);

    SnapshotReader reader =
        new SnapshotReader(new BufferedReader(new StringReader(sw.toString())),
            "test", 8, new MockDocumentSnapshotFactory());
    DocumentSnapshot after = reader.read();
    assertEquals(before, after);
    assertNull(reader.read());
  }
View Full Code Here

Examples of com.google.enterprise.connector.util.diffing.DocumentSnapshot

    SnapshotReader reader =
        new SnapshotReader(new BufferedReader(new StringReader(sw.toString())),
            "test", 2, new MockDocumentSnapshotFactory());
    for (int k = 0; k < 100; ++k) {
      DocumentSnapshot dss = reader.read();
      assertEquals(before[k], dss);
    }
  }
View Full Code Here

Examples of com.google.enterprise.connector.util.diffing.DocumentSnapshot

  }

  public void testCount() throws SnapshotStoreException {
    try {
      for (int k = 0; k < 100; ++k) {
        DocumentSnapshot dss = new MockDocumentSnapshot(Integer.toString(k),
            "extra." + k);
        assertEquals(k, writer.getRecordCount());
        writer.write(dss);
        assertEquals(k + 1, writer.getRecordCount());
      }
View Full Code Here

Examples of org.waveprotocol.box.common.comms.DocumentSnapshot

   *
   * @param document The document to serialize
   * @return A snapshot of the given document
   */
  public static DocumentSnapshot serializeDocument(ReadableBlipData document) {
    DocumentSnapshot builder = DocumentSnapshotJsoImpl.create();

    builder.setDocumentId(document.getId());
    builder.setDocumentOperation(WaveletOperationSerializer.serialize(
        document.getContent().asOperation()));

    builder.setAuthor(document.getAuthor().getAddress());
    for (ParticipantId participant : document.getContributors()) {
      builder.addContributor(participant.getAddress());
    }
    builder.setLastModifiedVersion(document.getLastModifiedVersion());
    builder.setLastModifiedTime(document.getLastModifiedTime());

    return builder;
  }
View Full Code Here

Examples of org.waveprotocol.box.common.comms.DocumentSnapshot

   *
   * @param document The document to serialize
   * @return A snapshot of the given document
   */
  public static DocumentSnapshot serializeDocument(ReadableBlipData document) {
    DocumentSnapshot builder = DocumentSnapshotJsoImpl.create();

    builder.setDocumentId(document.getId());
    builder.setDocumentOperation(WaveletOperationSerializer.serialize(
        document.getContent().asOperation()));

    builder.setAuthor(document.getAuthor().getAddress());
    for (ParticipantId participant : document.getContributors()) {
      builder.addContributor(participant.getAddress());
    }
    builder.setLastModifiedVersion(document.getLastModifiedVersion());
    builder.setLastModifiedTime(document.getLastModifiedTime());

    return builder;
  }
View Full Code Here

Examples of org.waveprotocol.box.common.comms.WaveClientRpc.DocumentSnapshot

    if (committedSnapshot != null) {
      ReadableWaveletData snapshot = committedSnapshot.snapshot;
      if (waveref.hasDocumentId()) {
        // We have a wavelet id and document id. Find the document in the
        // snapshot and return it.
        DocumentSnapshot docSnapshot = null;
        for (String docId : snapshot.getDocumentIds()) {
          if (docId.equals(waveref.getDocumentId())) {
            docSnapshot = SnapshotSerializer.serializeDocument(snapshot.getDocument(docId));
            break;
          }
View Full Code Here

Examples of org.waveprotocol.box.common.comms.WaveClientRpc.DocumentSnapshot

    if (committedSnapshot != null) {
      ReadableWaveletData snapshot = committedSnapshot.snapshot;
      if (waveref.hasDocumentId()) {
        // We have a wavelet id and document id. Find the document in the
        // snapshot and return it.
        DocumentSnapshot docSnapshot = null;
        for (String docId : snapshot.getDocumentIds()) {
          if (docId.equals(waveref.getDocumentId())) {
            docSnapshot = SnapshotSerializer.serializeDocument(snapshot.getDocument(docId));
            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.