Package com.goodow.realtime.store

Examples of com.goodow.realtime.store.Collaborator


    collaborators = collaborators == null ? Json.createArray() : collaborators;
    collaborators.forEach(new ListIterator<JsonObject>() {
      @Override
      public void call(int index, JsonObject obj) {
        boolean isMe = store.getBus().getSessionId().equals(obj.getString("sessionId"));
        Collaborator collaborator = new CollaboratorImpl(obj.set(Key.IS_ME, isMe));
        document.collaborators.set(collaborator.sessionId(), collaborator);
      }
    });

    if (components != null && components.length() > 0) {
      final CollaborativeTransformer transformer = new CollaborativeTransformer();
View Full Code Here


  public String toString() {
    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

      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    Collaborator other = (Collaborator) obj;
    if (sessionId == null) {
      if (other.sessionId() != null) {
        return false;
      }
    } else if (!sessionId.equals(other.sessionId())) {
      return false;
    }
    if (userId == null) {
      if (other.userId() != null) {
        return false;
      }
    } else if (!userId.equals(other.userId())) {
      return false;
    }
    return true;
  }
View Full Code Here

        Constants.Topic.STORE + "/" + internalApi.id + Constants.Topic.PRESENCE
        + Constants.Topic.WATCH, new Handler<Message<JsonObject>>() {
          @Override
          public void handle(Message<JsonObject> message) {
            JsonObject body = message.body().set(Key.IS_ME, false);
            Collaborator collaborator = new CollaboratorImpl(body);
            boolean isJoined = !body.has(Key.IS_JOINED) || body.getBoolean(Key.IS_JOINED);
            String sessionId = collaborator.sessionId();
            if (isJoined) {
              if (!collaborators.has(sessionId)) {
                collaborators.set(sessionId, collaborator);
                model.bridge.store.getBus().publishLocal(
                    Constants.Topic.STORE + "/" + model.bridge.id + "/"
View Full Code Here

  private JsonObject getCollaborator(String sessionId) {
    JsonObject toRtn = collaborators.get(sessionId);
    if (toRtn == null) {
      String displyName = anonymousUsers.getDisplyName();
      Collaborator collaborator =
          new CollaboratorImpl(anonymousUsers.getUserId(), sessionId, displyName,
                                  anonymousUsers.getColor(), false, true,
                                  anonymousUsers.getPhotoUrl(displyName));
      toRtn = new JsonObject(JacksonUtil.<JreJsonObject>convert(collaborator).toNative());
      toRtn.removeField(Key.IS_ME);
View Full Code Here

TOP

Related Classes of com.goodow.realtime.store.Collaborator

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.