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

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


    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


    }
    return ops;
  }

  private WaveletOperation makeOp() {
    return new NoOp(contextFactory.createContext());
  }
View Full Code Here

     *
     * @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

    inverse = new AddParticipant(reverseContext, op.getParticipantId());
  }

  @Override
  public void visitNoOp(NoOp op) {
    inverse = new NoOp(reverseContext);
  }
View Full Code Here

  /**
   * Creates and consumes a {@link NoOp} (empty) operation.
   */
  public void touch() {
    authoriseApplyAndSend(new NoOp(createContext()));
  }
View Full Code Here

        serialized.getHashedVersion().getHistoryHash().toByteArray()));
    assertDeepEquals(delta, deserialized);
  }

  public void testNoOp() {
    assertReversible(new NoOp(OP_CONTEXT));
  }
View Full Code Here

   * @return deserialized wavelet operation
   */
  public static WaveletOperation deserialize(ProtocolWaveletOperation protobufOp,
      WaveletOperationContext ctx) {
    if (protobufOp.hasNoOp()) {
      return new NoOp(ctx);
    } else if (protobufOp.hasAddParticipant()) {
      return new AddParticipant(ctx, new ParticipantId(protobufOp.getAddParticipant()));
    } else if (protobufOp.hasRemoveParticipant()) {
      return new RemoveParticipant(ctx, new ParticipantId(protobufOp.getRemoveParticipant()));
    } else if (protobufOp.hasMutateDocument()) {
View Full Code Here

    return makeTransformedDelta(0L, HashedVersion.unsigned(initialVersion + 1), 1);
  }

  /** Create a NoOp operation. */
  public NoOp noOp() {
    return new NoOp(new WaveletOperationContext(author, 0L, 1L));
  }
View Full Code Here

  public WaveletDelta makeNoOpDelta(HashedVersion targetVersion, long timestamp, int numOps) {
    List<WaveletOperation> ops = CollectionUtils.newArrayList();
    WaveletOperationContext context =
        new WaveletOperationContext(author, Constants.NO_TIMESTAMP, 1);
    for (int i = 0; i < numOps; ++i) {
      ops.add(new NoOp(context));
    }
    return new WaveletDelta(author, targetVersion, ops);
  }
View Full Code Here

  public static WaveletOperation deserializeWaveletOperation(DBObject dbObject,
      WaveletOperationContext context) throws PersistenceException {
    String type = (String) dbObject.get(FIELD_TYPE);
    if (type.equals(WAVELET_OP_NOOP)) {
      return new NoOp(context);
    } else if (type.equals(WAVELET_OP_ADD_PARTICIPANT)) {
      return new AddParticipant(context,
          deserializeParicipantId((DBObject) dbObject.get(FIELD_PARTICIPANT)));
    } else if (type.equals(WAVELET_OP_REMOVE_PARTICIPANT)) {
      return new RemoveParticipant(context,
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.operation.wave.NoOp

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.