Examples of WaveletBlipOperation


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

    WaveletOperationContext lastOperationContext = null;
    this.clear();

    for (WaveletOperation waveletOp : oldOperations) {
      if (waveletOp instanceof WaveletBlipOperation) {
        WaveletBlipOperation waveletBlipOp = ((WaveletBlipOperation) waveletOp);
        String id = waveletBlipOp.getBlipId();
        BlipOperation blipOp = waveletBlipOp.getBlipOp();
        if (blipOp instanceof BlipContentOperation) {
          if (!docOps.isEmpty() && !id.equals(currentId)) {
            composeDocOps(this, currentId, lastOperationContext, docOps);
          }
          docOps.add(((BlipContentOperation) blipOp).getContentOp());
View Full Code Here

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

    }
  }

  private static void composeDocOps(List<WaveletOperation> operations, String id,
      WaveletOperationContext context, List<DocOp> docOps) {
    operations.add(new WaveletBlipOperation(id,
        new BlipContentOperation(context, Composer.compose(docOps))));
    docOps.clear();
  }
View Full Code Here

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

    @Override
    public boolean flush(WaveletOperation operation, Runnable resume) {
      Preconditions.checkState(!failed, "CcBasedWavelet operation applier flushed after failure");
      if (operation instanceof WaveletBlipOperation) {
        WaveletBlipOperation waveBlipOp = (WaveletBlipOperation) operation;
        CcDocument doc = docFactory.get(waveletId, waveBlipOp.getBlipId());
        if (doc != null) {
          return doc.flush(resume);
        }
      }
      return true;
View Full Code Here

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

  private void consume(DocOp op) {
    // Box as blip op, and update local blip
    BlipContentOperation blipOp = new BlipContentOperation(wavelet.createContext(), op);
    blipOp.update(OpBasedBlip.this.blip);
    // Box as wavelet op, and pass to wavelet adapter
    outputSink.consume(new WaveletBlipOperation(getId(), blipOp));
  }
View Full Code Here

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

    } catch (OperationException e) {
      wavelet.handleException(e);
      return;
    }
    // Pass to wave
    outputSink.consume(new WaveletBlipOperation(blip.getId(), op));
  }
View Full Code Here

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

  /**
   * Returns a {@link WaveletDelta} for the list of operations performed by
   * the author set in the constants.
   */
  private WaveletDelta createDelta(String docId, DocOp docOp, HashedVersion version) {
    return new WaveletDelta(author, version, Arrays.asList(new WaveletBlipOperation(
        docId, new BlipContentOperation(CONTEXT, docOp))));
  }
View Full Code Here

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

  private WaveletOperation addParticipant(ParticipantId user, long time, HashedVersion version) {
    return new AddParticipant(opContext(time, version), user);
  }

  private WaveletOperation addBlip(String id, long time, HashedVersion version) {
    return new WaveletBlipOperation(id,
        new BlipContentOperation(opContext(time, version), new DocOpBuilder().build()));
  }
View Full Code Here

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

    assertReversible(makeBlipOp("emptyUpdateAttributes", m.build()));
  }

  private static WaveletBlipOperation makeBlipOp(String blipId, DocOp mutation) {
    return new WaveletBlipOperation(blipId, new BlipContentOperation(OP_CONTEXT, mutation));
  }
View Full Code Here

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

    } 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()) {
      return new WaveletBlipOperation(protobufOp.getMutateDocument().getDocumentId(),
          new BlipContentOperation(ctx, deserialize(protobufOp.getMutateDocument()
              .getDocumentOperation())));
    } else {
      throw new IllegalArgumentException("Unsupported operation: " + protobufOp);
    }
View Full Code Here

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

        .deleteCharacters(characters)
        .retain(remaining)
        .build();
    BlipContentOperation blipOp = new BlipContentOperation(
        new WaveletOperationContext(author, 0L, 1), op);
    WaveletBlipOperation waveOp = new WaveletBlipOperation("blip id", blipOp);
    return waveOp;
  }
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.