Package org.waveprotocol.box.common.comms.WaveClientRpc

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


    } catch (InvalidIdException ex) {
      throw new InvalidRequestException("Invalid id", operation, ex);
    }
    WaveletName waveletName = WaveletName.of(waveId, waveletId);
    CommittedWaveletSnapshot snapshot = context.getWaveletSnapshot(waveletName, participant);
    WaveletSnapshot protoSnapshot = SnapshotSerializer.serializeWavelet(snapshot.snapshot, snapshot.snapshot.getHashedVersion());
    WaveletSnapshotProtoImpl protoSnapshotImpl = new WaveletSnapshotProtoImpl(protoSnapshot);
    String jsonSnapshot = gson.toJson(protoSnapshotImpl.toGson(null, gson));
    Map<ParamsProperty, Object> data =
      ImmutableMap.<ParamsProperty, Object> of(ParamsProperty.RAW_SNAPSHOT, jsonSnapshot);
    context.constructResponse(operation, data);
View Full Code Here


  public void testWaveletRoundtrip() throws Exception {
    WaveletData expected = TestDataUtil.createSimpleWaveletData();
    WaveletName name = WaveletName.of(expected.getWaveId(), expected.getWaveletId());
    HashedVersion version = HASH_FACTORY.createVersionZero(name);

    WaveletSnapshot snapshot = SnapshotSerializer.serializeWavelet(expected, version);
    WaveletData actual = SnapshotSerializer.deserializeWavelet(snapshot, expected.getWaveId());

    TestDataUtil.checkSerializedWavelet(expected, actual);
  }
View Full Code Here

   */
  public void testGetWavelet() throws Exception {
    WaveletData wavelet = waveletProvider.getHostedWavelet();

    WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId());
    WaveletSnapshot snapshot = fetchWaverRefAndParse(waveref, WaveletSnapshot.class);
    WaveletData roundtripped = SnapshotSerializer.deserializeWavelet(snapshot, waveref.getWaveId());

    // We have just round-tripped wavelet through the servlet. wavelet and
    // roundtripped should be identical in all the fields that get serialized.
    TestDataUtil.checkSerializedWavelet(wavelet, roundtripped);
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.common.comms.WaveClientRpc.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.