Package org.waveprotocol.wave.model.operation.wave

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperation.apply()


    // We are making an delta which applies to version 1, however the robot only
    // knows about version 0.
    ParticipantId bob = ParticipantId.of("bob@exmaple.com");
    HashedVersion v2 = HashedVersion.unsigned(2);
    WaveletOperation addBob = new AddParticipant(new WaveletOperationContext(ALEX, 0L, 1, v2), bob);
    addBob.apply(waveletData);
    waveletData.setHashedVersion(v2);
    waveletData.setVersion(2);

    TransformedWaveletDelta delta = new TransformedWaveletDelta(ALEX, v2,
        0L, Collections.singletonList(addBob));
View Full Code Here


    }

    long startVersion = wavelet.getVersion();
    int opCount = 0;
    for (WaveletOperation inverseOp : inverseOps) {
      inverseOp.apply(wavelet);
      opCount++;
    }
    if (wavelet.getVersion() != startVersion - opCount) {
      throw new OperationException("Expected end version " + (startVersion - opCount)
          + " doesn't match the version of the wavelet " + wavelet.getVersion());
View Full Code Here

        } catch (OperationException e) {
          throw new ChangeRejected("Invalid initial op: " + op, e);
        }
      } else {
        try {
          op.apply(wavelet);
        } catch (OperationException e) {
          // Operation failed. The wavelet is still intact, however, so just
          // report the failure and continue on.
          throw new ChangeRejected("Invalid op at version " + wavelet.getVersion() + ": " + op, e);
        }
View Full Code Here

    }

    long startVersion = wavelet.getVersion();
    int opCount = 0;
    for (WaveletOperation inverseOp : inverseOps) {
      inverseOp.apply(wavelet);
      opCount++;
    }
    if (wavelet.getVersion() != startVersion - opCount) {
      throw new OperationException("Expected end version " + (startVersion - opCount)
          + " doesn't match the version of the wavelet " + wavelet.getVersion());
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.