Examples of WaveletOperationContext


Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

    // 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,
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

  protected void setUp() throws Exception {
    waveletData = WaveletDataUtil.createEmptyWavelet(WAVELET_NAME, ALEX, HashedVersion.unsigned(0),
        0L);
    waveletData.addParticipant(ALEX);

    AddParticipant addBobOp = new AddParticipant(new WaveletOperationContext(ALEX, 0L, 1, V1), BOB);

    addBobOp.apply(waveletData);
    TransformedWaveletDelta delta =
        new TransformedWaveletDelta(ALEX, V1, 0L, Arrays.asList(addBobOp));

    wavelet = WaveletAndDeltas.create(waveletData, DeltaSequence.of(delta));
    addCarolOp = new AddParticipant(new WaveletOperationContext(ALEX, 0L, 1, V2), CAROL);
    removeAlexOp = new RemoveParticipant(new WaveletOperationContext(ALEX, 0L, 1, V3), ALEX);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

    wavelet.appendDeltas(waveletData, deltas);
  }

  public void testNonContiguousDeltas() throws Exception {
    TransformedWaveletDelta deltaAdd = new TransformedWaveletDelta(ALEX, V1, 0L,
        Arrays.asList(new NoOp(new WaveletOperationContext(ALEX, 0L, 1, V1))));
    TransformedWaveletDelta deltaRemove = new TransformedWaveletDelta(ALEX, V2, 0L,
        Arrays.asList(new NoOp(new WaveletOperationContext(ALEX, 0L, 1, V2))));

    DeltaSequence deltas = DeltaSequence.of(deltaAdd, deltaRemove);

    try {
      wavelet.appendDeltas(waveletData, deltas);
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

     *
     * @throws TransformException
     */
    public TestConfig clientDoOps(int numOps) throws OperationException, TransformException {
      for (int i = 0; i < numOps; i++) {
        clientMock.addClientOperation(new NoOp(new WaveletOperationContext(
            clientMock.getParticipantId(), 0L, 1L)));
      }
      clientMock.flush();
      return this;
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

      clientMock.flush();
      return this;
    }

    private WaveletOperation noOpDocOp(String blipId) {
      WaveletOperationContext context = new WaveletOperationContext(
          clientMock.getParticipantId(), 0L, 1L);
      BlipContentOperation blipOp = new BlipContentOperation(context, (new DocOpBuilder()).build());

      return new WaveletBlipOperation(blipId, blipOp);
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

    assertEquals(2, fakeUnsavedDataListener.closeCalls);
  }

  private AddParticipant createAddParticipantOp(String participantName) {
    AddParticipant addPart = new AddParticipant(new WaveletOperationContext(
        USER_NAME, -1L, 0L), new ParticipantId(participantName));
    return addPart;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

    MergingSequence delta = new MergingSequence();
    ParticipantId jim = new ParticipantId("jim");
    delta.addAll(Arrays.asList(
        makeBlipContentOp("a", 1),
        makeBlipContentOp("a", 2),
        new AddParticipant(new WaveletOperationContext(jim, 5L, 1L), jim)
    ));

    delta.optimise();

    assertEquals(2, delta.size());
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

    MergingSequence delta = new MergingSequence();
    ParticipantId jim = new ParticipantId("jim");
    delta.addAll(Arrays.asList(
        makeBlipContentOp("a", 1),
        makeBlipContentOp("a", 2),
        new AddParticipant(new WaveletOperationContext(jim, 5L, 1L), jim),
        makeBlipContentOp("a", 4),
        makeBlipContentOp("a", 5)
    ));

    delta.optimise();
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

    MergingSequence delta = new MergingSequence();
    ParticipantId jim = new ParticipantId("jim");
    delta.addAll(Arrays.asList(
        makeBlipContentOp("a", 1),
        makeBlipContentOp("a", 2),
        new AddParticipant(new WaveletOperationContext(jim, 5L, 1L), jim),
        makeBlipContentOp("b", 4),
        makeBlipContentOp("b", 5)
    ));

    delta.optimise();
View Full Code Here

Examples of org.waveprotocol.wave.model.operation.wave.WaveletOperationContext

  private WaveletOperation makeOtherBlipOp(String id, long timestamp) {
    return new WaveletBlipOperation(id, new SubmitBlip(getContext(timestamp)));
  }

  private WaveletOperationContext getContext(long timestamp) {
    return new WaveletOperationContext(new ParticipantId("blah"), timestamp, 1L);
  }
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.