예제 #1
0
  private void fillNests(JwSet<Integer> nestIds) {
    enterMonitor("AcActionSnapshotLoader.fillNest");
    try {
      if (nestIds.isEmpty()) return;

      // we need to continue loading nests until all parent and
      // top nests have been loaded into the snapshot.
      // also load all any aliases for nests newly loaded nests.
      JwSet<Integer> aliasIds = new JwSet<Integer>();
      while (nestIds.isNotEmpty()) {
        fillDatabaseNests(nestIds);
        fillMissingNests(nestIds);

        // determine missing nest ids
        JwSet<Integer> allNestIds = AcBatchNest.collectNestIds(_nests.values());
        JwSet<Integer> loadedNestIds = AcBatchNest.collectIds(_nests.values());
        nestIds = allNestIds;
        nestIds.removeAll(loadedNestIds);

        // determine missing alias ids
        JwSet<Integer> allAliasIds = AcBatchNest.collectAliasIds(_nests.values());
        JwSet<Integer> loadedAliasIds = AcBatchAlias.collectIds(_aliases.values());
        aliasIds = allAliasIds;
        aliasIds.removeAll(loadedAliasIds);
        fillAliases(aliasIds);
      }
    } finally {
      exitMonitor();
    }
  }
예제 #2
0
 private void fillAliases(JwSet<Integer> aliasIds) {
   enterMonitor("AcActionSnapshotLoader.fillAlias");
   try {
     if (aliasIds.isEmpty()) return;
     fillDatabaseAliases(aliasIds);
     fillMissingAliases(aliasIds);
   } finally {
     exitMonitor();
   }
 }
예제 #3
0
 private void fillItems(JwSet<Integer> itemIds) {
   enterMonitor("AcActionSnapshotLoader.fillItem");
   try {
     if (itemIds.isEmpty()) return;
     fillDatabaseItems(itemIds);
     fillMissingItems(itemIds);
   } finally {
     exitMonitor();
   }
 }
예제 #4
0
  private void fillFlights(JwSet<Integer> flightIds) {
    enterMonitor("AcActionSnapshotLoader.fillFlight");
    try {
      if (flightIds.isEmpty()) return;

      fillDatabaseFlights(flightIds);
      fillMissingFlights(flightIds);
    } finally {
      exitMonitor();
    }
  }
예제 #5
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);
    }
  }