Package org.waveprotocol.box.common.comms

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


   * @return a wavelet snapshot that contains all the information in the
   *         original wavelet.
   */
  public static WaveletSnapshot serializeWavelet(ReadableWaveletData wavelet,
      HashedVersion hashedVersion) {
    WaveletSnapshot builder = WaveletSnapshotJsoImpl.create();

    builder.setWaveletId(ModernIdSerialiser.INSTANCE.serialiseWaveletId(wavelet.getWaveletId()));
    for (ParticipantId participant : wavelet.getParticipants()) {
      builder.addParticipantId(participant.toString());
    }
    for (String id : wavelet.getDocumentIds()) {
      ReadableBlipData data = wavelet.getDocument(id);
      builder.addDocument(serializeDocument(data));
    }

    builder.setVersion(WaveletOperationSerializer.serialize(hashedVersion));
    builder.setLastModifiedTime(wavelet.getLastModifiedTime());
    builder.setCreator(wavelet.getCreator().getAddress());
    builder.setCreationTime(wavelet.getCreationTime());

    return builder;
  }
View Full Code Here


   * @return a wavelet snapshot that contains all the information in the
   *         original wavelet.
   */
  public static WaveletSnapshot serializeWavelet(ReadableWaveletData wavelet,
      HashedVersion hashedVersion) {
    WaveletSnapshot builder = WaveletSnapshotJsoImpl.create();

    builder.setWaveletId(ModernIdSerialiser.INSTANCE.serialiseWaveletId(wavelet.getWaveletId()));
    for (ParticipantId participant : wavelet.getParticipants()) {
      builder.addParticipantId(participant.toString());
    }
    for (String id : wavelet.getDocumentIds()) {
      ReadableBlipData data = wavelet.getDocument(id);
      builder.addDocument(serializeDocument(data));
    }

    builder.setVersion(WaveletOperationSerializer.serialize(hashedVersion));
    builder.setLastModifiedTime(wavelet.getLastModifiedTime());
    builder.setCreator(wavelet.getCreator().getAddress());
    builder.setCreationTime(wavelet.getCreationTime());

    return builder;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.common.comms.WaveletSnapshot

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.