Examples of BlipData


Examples of org.waveprotocol.wave.model.wave.data.BlipData

   * @throws OperationException if the blip does not exist and is not a data
   *         document
   * @return blip targeted by this operation, never null
   */
  private BlipData getTargetBlip(WaveletData target) throws OperationException {
    BlipData blip = target.getDocument(blipId);
    if (blip == null) {
      // Implicitly create blips.
      blip = target.createDocument(blipId, context.getCreator(),
          Collections.singleton(context.getCreator()), EmptyDocument.EMPTY_DOCUMENT,
          context.getTimestamp(), target.getVersion() + context.getVersionIncrement());
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  private VersionUpdateOp doInternalApply(WaveletData wavelet) {
    HashedVersion oldHashedVersion = wavelet.getHashedVersion();
    if (docId != null) {
      // Update blip version.
      BlipData blip = wavelet.getDocument(docId);
      long newWaveletVersion = wavelet.getVersion() + context.getVersionIncrement();
      long newDocVersion = useFixedDocInfo ? docVersion : newWaveletVersion;
      long oldDocVersion = blip.setLastModifiedVersion(newDocVersion);

      return new VersionUpdateOp(context.getCreator(), -context.getVersionIncrement(),
          oldHashedVersion, docId, oldDocVersion, true);
    } else {
      return new VersionUpdateOp(context.getCreator(), -context.getVersionIncrement(),
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    for (String docId : wavelet.getDocumentIds()) {
      // We currently have no way to deserialize a document. Instead, we'll
      // serialize the expected document and compare with what we get from the
      // fetch servlet.
      StringWriter writer = new StringWriter();
      BlipData expectedDoc = wavelet.getDocument(docId);
      writer.append("" + protoSerializer.toJson(SnapshotSerializer.serializeDocument(expectedDoc)));
      String expectedResult = writer.toString();

      WaveRef waveref = WaveRef.of(wavelet.getWaveId(), wavelet.getWaveletId(), docId);
      String actualResult = fetchWaveRef(waveref);
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    return blips;
  }

  @Override
  public OpBasedBlip getBlip(String blipId) {
    BlipData blipData = wavelet.getDocument(blipId);
    if (blipData != null) {
      return adapt(blipData);
    } else {
      return null;
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  @Override
  public OpBasedBlip createBlip(String id) {
    // Optimistically create the blip assuming this author submits the
    // first operation.
    WaveletOperationContext context = createContext();
    BlipData newBlip = wavelet.createDocument(id, context.getCreator(),
        Collections.singleton(context.getCreator()), EmptyDocument.EMPTY_DOCUMENT,
        Constants.NO_TIMESTAMP, Constants.NO_VERSION);
    return adapt(newBlip);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  private VersionUpdateOp doInternalApply(WaveletData wavelet) {
    HashedVersion oldHashedVersion = wavelet.getHashedVersion();
    if (docId != null) {
      // Update blip version.
      BlipData blip = wavelet.getDocument(docId);
      long newWaveletVersion = wavelet.getVersion() + context.getVersionIncrement();
      long newDocVersion = useFixedDocInfo ? docVersion : newWaveletVersion;
      long oldDocVersion = blip.setLastModifiedVersion(newDocVersion);

      return new VersionUpdateOp(context.getCreator(), -context.getVersionIncrement(),
          oldHashedVersion, docId, oldDocVersion, true);
    } else {
      return new VersionUpdateOp(context.getCreator(), -context.getVersionIncrement(),
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

   * Applies this operation to a wavelet by applying its contained blip operation to the
   * identified blip.
   */
  @Override
  protected void doApply(WaveletData target) throws OperationException {
    BlipData blip = getTargetBlip(target);
    blipOp.apply(blip);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  }

  @Override
  public List<WaveletBlipOperation> applyAndReturnReverse(
      WaveletData target) throws OperationException {
    BlipData blip = getTargetBlip(target);
    List<? extends BlipOperation> operations = blipOp.applyAndReturnReverse(blip);
    List<WaveletBlipOperation> ret = new ArrayList<WaveletBlipOperation>();
    for (BlipOperation op : operations) {
      ret.add(new WaveletBlipOperation(blipId, op));
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

   * @throws OperationException if the blip does not exist and is not a data
   *         document
   * @return blip targeted by this operation, never null
   */
  private BlipData getTargetBlip(WaveletData target) throws OperationException {
    BlipData blip = target.getDocument(blipId);
    if (blip == null) {
      // Implicitly create blips.
      blip = target.createDocument(blipId, context.getCreator(),
          Collections.singleton(context.getCreator()), EmptyDocument.EMPTY_DOCUMENT,
          context.getTimestamp(), target.getVersion() + context.getVersionIncrement());
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.