Mercurial > dive4elements > river
changeset 4081:7a7b0f0cb653
Check if AFT gauges are in DIPS, too.
flys-aft/trunk@3456 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 19:25:31 +0000 |
parents | fd6d0bc84117 |
children | d13011e53022 |
files | flys-aft/src/main/java/de/intevation/aft/River.java |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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<Long, DIPSGauge> 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<Long, DIPSGauge> map = indexByNumber(context.getDips()); } public String toString() {