Example #1
0
  /**
   * Passes the information of what property, in what anchor, the user has selected, and optionally
   * what value he/she has added.
   *
   * @param user User ID
   * @param anchor Unique ID of Anchor
   * @param property Property name
   * @param value Value added by user
   * @param type Session type (edit, query, browse)
   * @param key browsing session id (null if session type is EDIT)
   * @return AnchorInfo[] with serialisable version of feedback text, empty if the user's session is
   *     expired or null if an error occurred
   */
  public AnchorInfo[] update(
      String user, String anchor, String property, String value, int type, String key) {
    if (!userMap.containsKey(user)) return new AnchorInfo[0];

    LiberSession session = userMap.get(user);
    synchronized (session) {
      session.setLastUpdated();
      return session.update(anchor, property, value, type, key);
    }
  }