Пример #1
0
  /** Internal method: add links without updating the count */
  private boolean addLinksNoCount(String dbid, List<Link> links) throws Exception {
    if (links.size() == 0) return false;

    dbid += "assocs";
    for (Link l : links) {
      AssocVisibility av = AssocVisibility.values()[l.visibility];
      String s = "wormhole...";
      if (getAssocClient()
              .TaoAssocPut(
                  dbid.getBytes(),
                  l.link_type,
                  l.id1,
                  l.id2,
                  l.time,
                  av,
                  false,
                  Long.valueOf(l.version),
                  l.data,
                  s.getBytes(),
                  writeOptions)
          == 1) {
        logger.error("addLinksNoCount failed!");
        throw new RuntimeException("addLinksNoCount failed!");
      }
    }
    return true;
  }
Пример #2
0
  private boolean addLinkImpl(String dbid, Link l, boolean noinverse) throws Exception {

    if (Level.DEBUG.isGreaterOrEqual(debuglevel)) {
      logger.debug("addLink " + l.id1 + "." + l.id2 + "." + l.link_type);
    }
    AssocVisibility av = AssocVisibility.values()[l.visibility];
    String s = "wormhole...";
    dbid += "assocs";
    return getAssocClient()
            .TaoAssocPut(
                dbid.getBytes(),
                l.link_type,
                l.id1,
                l.id2,
                l.time,
                av,
                true,
                Long.valueOf(l.version),
                l.data,
                s.getBytes(),
                writeOptions)
        == 1;
  }