# HG changeset patch # User Sascha L. Teichmann # Date 1324063531 0 # Node ID 7a7b0f0cb653667e682635f1a1707dae8579a9e9 # Parent fd6d0bc84117bcc3bb54e7620662c24a9da15c40 Check if AFT gauges are in DIPS, too. flys-aft/trunk@3456 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r fd6d0bc84117 -r 7a7b0f0cb653 flys-aft/src/main/java/de/intevation/aft/River.java --- a/flys-aft/src/main/java/de/intevation/aft/River.java Fri Dec 16 18:51:26 2011 +0000 +++ b/flys-aft/src/main/java/de/intevation/aft/River.java Fri Dec 16 19:25:31 2011 +0000 @@ -61,6 +61,8 @@ public void sync(SyncContext context) throws SQLException { log.info("sync river: " + this); + Map dipsGauges = indexByNumber(context.getDips()); + ConnectedStatements flysStatements = context.getFlysStatements(); ConnectedStatements aftStatements = context.getAftStatements(); @@ -72,7 +74,16 @@ while (messstellenRs.next()) { String name = messstellenRs.getString("NAME"); String num = messstellenRs.getString("MESSSTELLE_NR"); - System.err.println(name + ": " + num); + Long number = numberToLong(num); + if (number == null) { + log.warn("Invalid MESSSTELLE_NR for MESSSTELLE '"+name+"'"); + continue; + } + DIPSGauge dipsGauge = dipsGauges.get(number); + if (dipsGauges == null) { + log.warn("MESSSTELLE '" + name + "' not found in DIPS."); + continue; + } } messstellenRs.close(); @@ -90,7 +101,6 @@ gaugesRs.close(); - Map map = indexByNumber(context.getDips()); } public String toString() {