Package org.waveprotocol.wave.model.operation

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


      return new Affine(finalState, a.reciprocal(), Rational.MINUS_ONE.times(b.dividedBy(a)));
    }

    public Affine of(Affine other, Rational newInitialState) throws OperationException {
      if (!other.finalState.equals(newInitialState)) {
        throw new OperationException("Op " + this + " cannot compose with op " + other);
      }
      return new Affine(other.initialState, a.times(other.a), a.times(other.b).plus(b));
    }
View Full Code Here


      return new Affine(other.initialState, a.times(other.a), a.times(other.b).plus(b));
    }

    public Affine of(Affine other) throws OperationException {
      if (!other.finalState.equals(initialState)) {
        throw new OperationException("Op " + this + " cannot compose with op " + other);
      }
      return new Affine(other.initialState, a.times(other.a), a.times(other.b).plus(b));
    }
View Full Code Here

      return new Affine(other.initialState, a.times(other.a), a.times(other.b).plus(b));
    }

    public void apply(Data state) throws OperationException {
      if (!state.value.equals(initialState)) {
        throw new OperationException("Op " + this + " does not apply to state " + state);
      }
      state.value = a.times(state.value).plus(b);
    }
View Full Code Here

      }

      @Override
      int apply(int location, Data d) throws OperationException {
        if (location >= d.value.length()) {
          throw new OperationException("Delete at end");
        }
        d.value.deleteCharAt(location);
        return 0;
      }
View Full Code Here

      static final Skip INSTANCE = new Skip();

      @Override
      int apply(int location, Data d) throws OperationException {
        if (location >= d.value.length()) {
          throw new OperationException("Skip past end");
        }
        return 1;
      }
View Full Code Here

   * Adds a participant from the given wavelet.
   */
  @Override
  public void doApply(CoreWaveletData target) throws OperationException {
    if (!target.addParticipant(participant)) {
      throw new OperationException("Attempt to add a duplicate participant.");
    }
  }
View Full Code Here

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

  @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

    // Sanity check
    long latestVersion = inferredServerPath.size() > 0 ?
        inferredServerPath.getLast().ack.ackedVersion.getVersion() :
        startSignature.getVersion();
    if (serverDelta.getAppliedAtVersion() < latestVersion) {
      throw new OperationException("Server sent a delta containing a version that is older than " +
          "the version at end of inferred server path. [Received serverDelta" + serverDelta +
          "] " + this);
    }

    if (detectEchoBack(serverDelta)) {
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

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.