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

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


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


  private static WaveletOperationContext getContext(String author, long timestampMillis) {
    return new WaveletOperationContext(ParticipantId.ofUnsafe(author), timestampMillis, 1);
  }

  private static WaveletOperation newNoOp(String author, long timestampMillis) {
    return new NoOp(getContext(author, timestampMillis));
  }
View Full Code Here

              "%s: More than one result: %s, %s", op, result[0], x);
          result[0] = x;
        }

        @Override public void visitNoOp(NoOp op) {
          setResult(new NoOp(newContext));
        }

        @Override public void visitVersionUpdateOp(VersionUpdateOp op) {
          throw new AssertionError("Unexpected visitVersionUpdateOp(" + op + ")");
        }
View Full Code Here

      ProtocolWaveletOperation message, boolean checkWellFormed)
      throws InvalidInputException {

    try {
      if (message.hasNoOp() && message.getNoOp()) {
        return new NoOp(context);
      } else if (message.getAddParticipant() != null && !message.getAddParticipant().isEmpty()) {
        return new AddParticipant(context, ParticipantId.of(message.getAddParticipant()));
      } else if (message.getRemoveParticipant() != null
          && !message.getRemoveParticipant().isEmpty()) {
        return new RemoveParticipant(context, ParticipantId.of(message.getRemoveParticipant()));
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

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

   * @return deserialized wavelet operation
   */
  public static WaveletOperation deserialize(ProtocolWaveletOperation protobufOp,
      WaveletOperationContext context) {
    if (protobufOp.hasNoOp()) {
      return new NoOp(context);
    } else if (protobufOp.hasAddParticipant()) {
      return new AddParticipant(context, new ParticipantId(protobufOp.getAddParticipant()));
    } else if (protobufOp.hasRemoveParticipant()) {
      return new RemoveParticipant(context, new ParticipantId(protobufOp.getRemoveParticipant()));
    } else if (protobufOp.hasMutateDocument()) {
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

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

  @Override
  public void visitNoOp(NoOp op) {
    inverse = new NoOp(reverseContext);
  }
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.