Package com.goodow.realtime.operation.impl

Examples of com.goodow.realtime.operation.impl.CollaborativeOperation


      }
    });

    if (components != null && components.length() > 0) {
      final CollaborativeTransformer transformer = new CollaborativeTransformer();
      CollaborativeOperation operation =
          transformer.createOperation(Json.createObject().set("op", components));
      applyLocally(operation);
    }
  }
View Full Code Here


    return toJson().toJsonString();
  }

  void consumeAndSubmit(OperationComponent<?> component) {
    Collaborator me = document.collaborators.get(store.getBus().getSessionId());
    CollaborativeOperation operation =
        new CollaborativeOperation(me == null ? null : me.userId(), store.getBus().getSessionId(),
                                   Json.createArray().push(component));
    applyLocally(operation);
    undoManager.checkpoint();
    undoManager.undoableOp(operation);
    mayUndoRedoStateChanged();
View Full Code Here

          Transformer<CollaborativeOperation> transformer = new CollaborativeTransformer();

          @Override
          public void handle(Message<JsonObject> message) {
            JsonObject body = message.body();
            CollaborativeOperation op = transformer.createOperation(body);
            bridge.consume(op);
          }
        });
    bridge.setOutputSink(new OutputSink() {
      @Override
View Full Code Here

            if (opV != snapshotV) {
              callback.handle(new DefaultFutureResult<JsonObject>(new ReplyException(
                  ReplyFailure.RECIPIENT_FAILURE, "Invalid opData version")));
              return;
            }
            CollaborativeOperation transformed = operation;
            if (applyAt != null && ops.size() > 0
                && applyAt <= ops.<JsonObject>get(ops.size() - 1).getLong(Key.VERSION)) {
              try {
                CollaborativeOperation applied =
                    transformer.compose(createOperations(ops, (int) (applyAt - ops
                        .<JsonObject>get(0).getLong(Key.VERSION)), ops.size()));
                transformed = operation.transform(applied, false);
              } catch (Exception e) {
                log.log(Level.WARNING, "Failed to transform operation", e);
View Full Code Here

TOP

Related Classes of com.goodow.realtime.operation.impl.CollaborativeOperation

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.