Package org.waveprotocol.wave.model.operation

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


   */
  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

    int noninsertionIndex = 0;
    while (insertionIndex < insertionOp.size()) {
      insertionOp.applyComponent(insertionIndex++, insertionTarget);
      while (insertionPosition.get() > 0) {
        if (noninsertionIndex >= noninsertionOp.size()) {
          throw new TransformException("Ran out of " + noninsertionOp.size()
              + " noninsertion op components after " + insertionIndex + " of " + insertionOp.size()
              + " insertion op components, with " + insertionPosition.get() + " spare positions");
        }
        noninsertionOp.applyComponent(noninsertionIndex++, noninsertionTarget);
      }
View Full Code Here

   */
  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

      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

      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

    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

TOP

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

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.