Package org.waveprotocol.wave.model.operation

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


    beginChange();

    try {
      op.apply(invertibleCursor);
    } catch (OpCursorException e) {
      throw new OperationException(e.getMessage(), e);
    }

    endChange();
  }
View Full Code Here


    if (!DocOpValidator.validate(null, schemaConstraints, autoDoc, op).isValid()) {
      // Validate again to collect diagnostics (more expensive)
      ViolationCollector vc = new ViolationCollector();
      DocOpValidator.validate(vc, schemaConstraints, autoDoc, op);

      throw new OperationException(vc);
    }
  }
View Full Code Here

    nindoCursor.begin2();

    try {
      op.apply(nindoCursor);
    } catch (OpCursorException e) {
      throw new OperationException(e.getMessage(), e);
    }

    return nindoCursor.finish2();
  }
View Full Code Here

  @Override
  public void maybeThrowOperationExceptionFor(Nindo op) throws OperationException {
    ViolationCollector vc = NindoValidator.validate(this, op, schemaConstraints);
    if (!vc.isValid()) {
      // TODO(danilatos): reconcile the two validation methods
      throw new OperationException(vc);
    }
  }
View Full Code Here

    annotations.begin();
  }

  private void endChange() throws OperationException {
    if (currentLocation != size()) {
      throw new OperationException("Operation size does not match document size " +
          "[operation size:" + currentLocation + "] [doc size:" + size() + "]");
    }

    annotations.finish();
    checkSizeConsistency("finish");
View Full Code Here

    for (WaveletOperation inverseOp : inverseOps) {
      inverseOp.apply(wavelet);
      opCount++;
    }
    if (wavelet.getVersion() != startVersion - opCount) {
      throw new OperationException("Expected end version " + (startVersion - opCount)
          + " doesn't match the version of the wavelet " + wavelet.getVersion());
    }
  }
View Full Code Here

   * Removes a participant from the given wavelet.
   */
  @Override
  public void doApply(WaveletData target) throws OperationException {
    if (!target.removeParticipant(participant)) {
      throw new OperationException("Attempt to remove non-existent participant " + participant);
    }
  }
View Full Code Here

      if (participant.equals(next)) {
        return position;
      }
      position++;
    }
    throw new OperationException("Attempt to remove non-existent participant " + participant);
  }
View Full Code Here

    int op2Index = 0;
    while (op1Index < op1.size()) {
      op1.applyComponent(op1Index++, target);
      while (target.isPostTarget()) {
        if (op2Index >= op2.size()) {
          throw new OperationException("Document size mismatch: "
              + "op1 resulting length=" + DocOpUtil.resultingDocumentLength(op1)
              + ", op2 initial length=" + DocOpUtil.initialDocumentLength(op2));
        }
        op2.applyComponent(op2Index++, target);
      }
View Full Code Here

  public static DocOp compose(DocOp op1, DocOp op2)
      throws OperationException {
    try {
      return new Composer(new DocOpBuffer()).composeOperations(op1, op2);
    } catch (ComposeException e) {
      throw new OperationException(e.getMessage());
    }
  }
View Full Code Here

TOP

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

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.