Package org.waveprotocol.wave.model.operation

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


  @Override
  public void doApply(WaveletData target) throws OperationException {
    if (!(position == END_POSITION
          ? target.addParticipant(participant)
          : target.addParticipant(participant, position))) {
      throw new OperationException("Attempt to add a duplicate 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

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

          try {
            WaveletDeltaRecord applicationResult = transformAndApplyRemoteDelta(appliedDelta);
            long opsApplied = applicationResult.getResultingVersion().getVersion()
                    - expectedVersion.getVersion();
            if (opsApplied != appliedDelta.getMessage().getOperationsApplied()) {
              throw new OperationException("Operations applied here do not match the authoritative"
                  + " server claim (got " + opsApplied + ", expected "
                  + appliedDelta.getMessage().getOperationsApplied() + ".");
            }
            // Add transformed result to return list.
            resultingDeltas.add(applicationResult);
View Full Code Here

          extraHandler.consume(waveOp);
        }
        // attachmentsManager.getServerOperationListener().consume(waveOp);
      } catch (OperationException e) {
        // Fail this wavelet permanently
        fail(new OperationException("Operation failed; no recovery possible: " + e.getMessage()
                + "\n[debugLastSuccessfulOp:" + debugLastSuccessfulOp + "]"
                + "\n[waveOp:" + waveOp + "]"
                + "\n[target:" + target + "]", e));
      } finally {
        fireOnOpEnd();
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

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.