Ejemplo n.º 1
0
  private void testAllNestsLoaded() {
    JwSet<Integer> missingIds = new JwSet<Integer>();
    for (Integer flightId : _flights.keySet()) {
      JwList<Integer> dbIds = _access.getNestDb().getAllIdsByRootFlightId(flightId);
      missingIds.addAll(dbIds);
    }
    removeLoaded(missingIds, _nests.keySet());

    if (missingIds.isNotEmpty()) debug(null, "    MISSING NESTS: " + missingIds);
  }
Ejemplo n.º 2
0
  private void fillActions(JwList<AcAction> actions, boolean skipRevokedActions) {
    enterMonitor("AcActionSnapshotLoader.fillActions");
    try {
      // debug("B", "fillNonRevokedActions");
      JwSet<Integer> itemIds = new JwSet<Integer>();
      JwSet<Integer> nestIds = new JwSet<Integer>();
      JwSet<Integer> aliasIds = new JwSet<Integer>();
      JwSet<Integer> flightIds = new JwSet<Integer>();
      if (hasEntanglement()) {
        itemIds.addAll(_entanglement.getItemIds());
        nestIds.addAll(_entanglement.getNestIds());
        aliasIds.addAll(_entanglement.getAliasIds());
        flightIds.addAll(_entanglement.getFlightIds());
      }

      for (AcAction a : actions) {
        if (skipRevokedActions && a.hasStatusRevoked() && a.hasPendingChangeNone()) continue;
        a.collectItemIdsOn(itemIds);
        a.collectNestIdsOn(nestIds);
        a.collectAliasIdsOn(aliasIds);
        a.collectFlightIdsOn(flightIds);
      }

      fillItems(itemIds);
      AcBatchItem.collectNestIdsOn(_items.values(), nestIds);
      AcBatchItem.collectFlightIdsOn(_items.values(), flightIds);

      // load aliases before nests
      fillAliases(aliasIds);
      AcBatchAlias.collectNestIdsOn(_aliases.values(), nestIds);

      fillNests(nestIds);
      AcBatchNest.collectFlightIdsOn(_nests.values(), flightIds);

      fillFlights(flightIds);
      fillGroups();

      testAllItemsAndNestsLoaded();
    } finally {
      exitMonitor();
    }
  }
Ejemplo n.º 3
0
  private void addMissingBatchGroups(
      JwMap<Integer, JwSet<Integer>> m1, JwMap<Integer, JwSet<Integer>> m2) {
    Iterator<Entry<Integer, JwSet<Integer>>> i = m2.entrySet().iterator();
    while (i.hasNext()) {
      Entry<Integer, JwSet<Integer>> entry = i.next();

      Integer batchId = entry.getKey();
      JwSet<Integer> ms = entry.getValue();

      JwSet<Integer> bs = m1.get(batchId);
      if (bs != null) ms.removeAll(bs);
      else {
        bs = new JwSet<Integer>();
        m1.put(batchId, bs);
      }

      if (ms.isEmpty()) i.remove();
      else bs.addAll(ms);
    }
  }