Examples of HashedVersion


Examples of org.waveprotocol.wave.model.version.HashedVersion

    return delta;
  }

  private static KnownWavelet createKnownWavelet(ObservableWaveletData snapshot, long version,
      byte[] signature, Accessibility accessibility) {
    HashedVersion commitVersion = HashedVersion.of(version, signature);
    return new KnownWavelet(snapshot, commitVersion, accessibility);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

  private static void reconnectChannel(ViewChannel.Listener viewListener, WaveletId waveletId,
      long connectVersion, byte[] connectSignature, long currentVersion, byte[] currentSignature)
      throws ChannelException {
    TransformedWaveletDelta reconnect = createReconnect(null, connectVersion, connectSignature);
    HashedVersion distinctVersion = HashedVersion.of(currentVersion, currentSignature);
    viewListener.onUpdate(waveletId, Collections.singletonList(reconnect),
        distinctVersion, distinctVersion);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

  /**
   * Truncate to the given version.
   */
  public void truncateAt(long version) {
    HashedVersion signature = getSignatureAt(version);
    setCurrentSignature(signature);

    TransformedWaveletDelta currentDelta = getDeltaStartingAt(version);
    while(currentDelta != null) {
      removeDelta(currentDelta);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

      int initialClientOpsSize = cache.delta.size();

      // Assume that they are working only on 1 wave.
      WaveletDelta transformedClientDelta = ccCore.onClientDelta(cache.delta);
      HashedVersion endVersion = generateSignature(transformedClientDelta);
      TransformedWaveletDelta serverDelta =
          TransformedWaveletDelta.cloneOperations(endVersion, 0L, transformedClientDelta);

      // Update the version of the wave
      history.addDelta(serverDelta);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

      List<HashedVersion> clientKnownDeltas) throws ChannelException,
      TransformException, OperationException {
    ReOpenInfo toClient = ccCore.reopen(clientKnownDeltas);
    // We have none of the client's signature. Then return the most recent.
    if (toClient == null) {
      HashedVersion startSignature = history.getCurrentSignature();
      clientConnection.triggerOnOpen(startSignature, startSignature);
    } else {
      List<TransformedWaveletDelta> deltas = toClient.getDeltas();
      HashedVersion startSignature = toClient.getStartSignature();
      HashedVersion endSignature =
          deltas.size() > 0 ? deltas.get(deltas.size() - 1).getResultingVersion() : startSignature;
      clientConnection.triggerOnOpen(startSignature, endSignature);
      clientConnection.triggerServerDeltas(deltas);
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

    OpenListener listener = openWave(INDEX_WAVE_ID, IdFilters.ALL_IDS);
    verifyChannelId(listener);
    verifyMarker(listener, INDEX_WAVE_ID);

    HashedVersion v1 = HashedVersion.unsigned(1L);
    TransformedWaveletDelta delta = makeDelta(USER, v1, 0L, UTIL.noOp());
    DeltaSequence deltas = DeltaSequence.of(delta);

    WaveletData wavelet = WaveletDataUtil.createEmptyWavelet(WN1, USER, V0, 1234567890L);
    clientFrontend.waveletUpdate(wavelet, deltas);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

  public void testConnectReceivesCommittedVersion() throws ChannelException {
    final long currentVersion = 57;
    final byte[] signature = sig(1);
    final long committedVersion = 50;
    final byte[] committedSignature = sig(2);
    final HashedVersion signedVersion = HashedVersion.of(currentVersion, signature);
    final ObservableWaveletData wavelet = buildSnapshot(currentVersion, signature);

    receiver.expectConnection(signedVersion, signedVersion);
    receiver.expectCommit(committedVersion);
    connectChannel(wavelet, committedVersion, committedSignature);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

  public void testReconnectReceivesCommittedVersion() throws ChannelException {
    final long currentVersion = 57;
    final byte[] signature = sig(1);
    final long committedVersion = 50;
    final byte[] committedSignature = sig(2);
    final HashedVersion signedVersion = HashedVersion.of(currentVersion, signature);
    final List<TransformedWaveletDelta> reconnect = buildReconnect(currentVersion, signature);

    // Expect connection.
    receiver.expectConnection(signedVersion, signedVersion);
    receiver.expectCommit(committedVersion);
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

   * @param committed last committed version at connection (or -1)
   * @param commitSignature last committed signature at connection
   */
  private void connectChannel(ObservableWaveletData snapshot,
      long committed, byte[] commitSignature) throws ChannelException {
    HashedVersion commitVersion = HashedVersion.of(committed, commitSignature);
    deltaChannel.onWaveletSnapshot(snapshot, commitVersion, null);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.version.HashedVersion

   * @param reconnect reconnection message
   * @param committed last committed version at reconnection
   */
  private void reconnectChannel(List<TransformedWaveletDelta> reconnect, long committed,
      byte[] commitSignature) throws ChannelException {
    HashedVersion commitVersion = HashedVersion.of(committed, commitSignature);
    deltaChannel.onWaveletUpdate(reconnect, commitVersion, null);
  }
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.