Examples of TransformException


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

      serverCollector.add(sd);
      return new OperationPair<DocOp>(
          clientCollector.composeAll(), serverCollector.composeAll());
    // We're catching runtime exceptions here, but checked exceptions may be better.
    } catch (RuntimeException e) {
      throw new TransformException(e);
    }
  }
View Full Code Here

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

    int deletionIndex = 0;
    while (preservationIndex < preservationOp.size()) {
      preservationOp.applyComponent(preservationIndex++, preservationTarget);
      while (preservationPosition.get() > 0) {
        if (deletionIndex >= deletionOp.size()) {
          throw new TransformException("Ran out of " + deletionOp.size()
              + " deletion op components after " + preservationIndex + " of "
              + preservationOp.size() + " preservation op components, with "
              + preservationPosition.get() + " spare positions");
        }
        deletionOp.applyComponent(deletionIndex++, deletionTarget);
View Full Code Here

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

      int serverIndex = 0;
      while (clientIndex < clientOp.size()) {
        clientOp.applyComponent(clientIndex++, clientTarget);
        while (clientPosition.get() > 0) {
          if (serverIndex >= serverOp.size()) {
            throw new TransformException("Ran out of " + serverOp.size()
                + " server op components after " + clientIndex + " of " + clientOp.size()
                + " client op components, with " + clientPosition.get() + " spare positions");
          }
          serverOp.applyComponent(serverIndex++, serverTarget);
        }
      }
      while (serverIndex < serverOp.size()) {
        serverOp.applyComponent(serverIndex++, serverTarget);
      }
      clientOp = clientTarget.finish();
      serverOp = serverTarget.finish();
    } catch (InternalTransformException e) {
      throw new TransformException(e.getMessage());
    }
    return new OperationPair<DocOp>(clientOp, serverOp);
  }
View Full Code Here

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

   */
  private static void checkParticipantRemovalAndAddition(CoreRemoveParticipant removeParticipant,
      CoreAddParticipant addParticipant) throws TransformException {
    ParticipantId participantId = removeParticipant.getParticipantId();
    if (participantId.equals(addParticipant.getParticipantId())) {
      throw new TransformException("Transform error involving participant: " +
          participantId.getAddress());
    }
  }
View Full Code Here

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

   * @return The transformed client operation and it starts off from the latest version.
   * @throws TransformException
   */
  public WaveletDelta onClientDelta(WaveletDelta delta) throws TransformException {
    if (delta.getTargetVersion().getVersion() > deltaHistory.getCurrentVersion()) {
      throw new TransformException("Client has a newer version than server knows. client: "
                                   + delta.getTargetVersion() + ", server: "
                                   + deltaHistory.getCurrentVersion());
    }
    WaveletDelta result = delta;
    while (result.getTargetVersion().getVersion() < deltaHistory.getCurrentVersion()) {
View Full Code Here

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

   */
  private static void checkParticipantRemovalAndAddition(RemoveParticipant removeParticipant,
      AddParticipant addParticipant) throws TransformException {
    ParticipantId participantId = removeParticipant.getParticipantId();
    if (participantId.equals(addParticipant.getParticipantId())) {
      throw new TransformException("Transform error involving participant: " +
          participantId.getAddress());
    }
  }
View Full Code Here

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

    // Transform against any unacknowledged ops.
    List<WaveletOperation> transformedServerDelta = serverDelta;

    if (unacknowledged != null) {
      if (serverDelta.getAppliedAtVersion() != unacknowledged.getTargetVersion().getVersion()) {
        throw new TransformException(
            "Cannot accept server version newer than unacknowledged. server version:"
                + serverDelta.getAppliedAtVersion() + " unacknowledged version:"
                + unacknowledged.getTargetVersion() + ". [Received serverDelta:" + serverDelta
                + "] " + this);
      }
View Full Code Here

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

  @Override
  public void onSuccess(int opsApplied, HashedVersion signature) throws TransformException {

    if (unacknowledged == null) {
      // Note: An ACK will only occur before echoBack delta.
      throw new TransformException("Got ACK from server, but we had not sent anything. " + this);
    }

    if (unacknowledged.getResultingVersion() != signature.getVersion()) {
      throw new TransformException("Got ACK from server, but we don't have the same version. " +
          "Client expects new version " + unacknowledged.getResultingVersion() +
          " and " + unacknowledged.size() + " acked ops, " +
          " Server acked " + opsApplied + ", new version " + signature.getVersion()  + ". " +
          "[Received signature:" + signature + "] [Received opsApplied:" + opsApplied + "] " +
          this);
    }

    if (opsApplied != unacknowledged.size()) {
      throw new TransformException("Unable to accept ACK of different number of operations than "
          + "client issued. Client sent = " + unacknowledged.size() + " Server acked = "
          + opsApplied + ". " + this);
    }

    if (!acks.isEmpty()) {
View Full Code Here

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

    int serverIndex = 0;
    while (clientIndex < clientOp.size()) {
      clientOp.applyComponent(clientIndex++, clientTarget);
      while (clientPosition.get() > 0) {
        if (serverIndex >= serverOp.size()) {
          throw new TransformException("Ran out of " + serverOp.size()
              + " server op components after " + clientIndex + " of " + clientOp.size()
              + " client op components, with " + clientPosition.get() + " spare positions");
        }
        serverOp.applyComponent(serverIndex++, serverTarget);
      }
View Full Code Here

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

      DocOp sn2 = r4.serverOp();
      return new OperationPair<DocOp>(
          Composer.compose(ci2, cn2),
          Composer.compose(si2, sn2));
    } catch (OperationException e) {
      throw new TransformException(e);
    }
  }
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.