Package org.jboss.errai.otec.client.operation

Examples of org.jboss.errai.otec.client.operation.OpPair


  public void setMutations(final List<Mutation> mutations) {
    this.mutations = mutations;
  }

  public OTOperation otOperation(final OTEngine engine) {
    OpPair opPair = null;
    if (this.opPairDto != null) {
      opPair = this.opPairDto.toOpPair(engine);
    }

    return OTOperationImpl.createOperation(engine, engine.getId(), mutations, entityId, revisionId, hash, opPair, lastRevisionTx);
View Full Code Here


  }

  private OTOperation translateFrom(final OTOperation remoteOp,
                                    final OTOperation basedOn) {

    OpPair transformedFrom = basedOn.getTransformedFrom();
    if (transformedFrom == null) {
      return remoteOp;
    }
    else {
      final List<OpPair> translationVector = new ArrayList<OpPair>();
      OTOperation last = basedOn;
      OTOperation op = basedOn;
      while ((transformedFrom = op.getTransformedFrom()) != null) {
        OTOperation root = transformedFrom.getLocalOp();
        int baseRev;
        do {
          baseRev = root.getRevision();
        } while (root.getTransformedFrom() != null && (root = root.getTransformedFrom().getRemoteOp()) != null);
       
        if (remoteOp.getTransformedFrom() == null || baseRev > remoteOp.getLastRevisionTx()) {
          translationVector.add(transformedFrom);
        }
       
        op = transformedFrom.getRemoteOp();

        if (last.equals(op)) {
          continue;
        }
View Full Code Here

        transformedMutations.add(adjustMutationToIndex(rmIdx + offset, rm));
      }
    }

    final OpPair of = OpPair.of(remoteOp, localOp);

    transformedOp =
        createLocalOnlyOperation(engine, remoteOp.getAgentId(), transformedMutations, entity,
            of);
View Full Code Here

TOP

Related Classes of org.jboss.errai.otec.client.operation.OpPair

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.