Package org.waveprotocol.wave.model.operation

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


      Affine undoAndDoOther = serverOp.of(clientOp.inverse());
      return new OperationPair<Affine>(
          new Affine(serverOp.finalState, clientOp.a, clientOp.b),
          clientOp.of(undoAndDoOther, undoAndDoOther.finalState));
    } catch(OperationException e) {
      throw new TransformException(e.getMessage());
    }
  }
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

      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);
        }
      }
      while (deletionIndex < deletionOp.size()) {
        deletionOp.applyComponent(deletionIndex++, deletionTarget);
      }
      preservationOp = preservationTarget.finish();
      transformedDeletionOp = deletionTarget.finish();
    } catch (InternalTransformException e) {
      throw new TransformException(e.getMessage());
    }
    return new Pair<DocOp, Pair<DocOp, DocOp>>(preservationOp,
        transformedDeletionOp);
  }
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

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

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

      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

    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

      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

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

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.