Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/importer/laf/LafObjectMapper.java @ 1339:3f6a77c9efc9
Stop probe import if probe is a duplicate and set better error code.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 07 Apr 2017 09:05:00 +0200 |
parents | ffbf9cff4aa6 |
children |
comparison
equal
deleted
inserted
replaced
1338:ffbf9cff4aa6 | 1339:3f6a77c9efc9 |
---|---|
164 newProbe = old; | 164 newProbe = old; |
165 } | 165 } |
166 // Probe was found but some data does not match | 166 // Probe was found but some data does not match |
167 else if(i == Identified.REJECT){ | 167 else if(i == Identified.REJECT){ |
168 ReportItem err = new ReportItem(); | 168 ReportItem err = new ReportItem(); |
169 err.setCode(631); | 169 err.setCode(671); |
170 err.setKey("duplicate"); | 170 err.setKey("duplicate"); |
171 err.setValue(""); | 171 err.setValue(""); |
172 currentErrors.add(err); | 172 currentErrors.add(err); |
173 if (currentErrors.size() > 0) { | 173 if (currentErrors.size() > 0) { |
174 errors.put(object.getIdentifier(), | 174 errors.put(object.getIdentifier(), |
176 } | 176 } |
177 if (currentWarnings.size() > 0) { | 177 if (currentWarnings.size() > 0) { |
178 warnings.put(object.getIdentifier(), | 178 warnings.put(object.getIdentifier(), |
179 new ArrayList<ReportItem>(currentWarnings)); | 179 new ArrayList<ReportItem>(currentWarnings)); |
180 } | 180 } |
181 return; | |
181 } | 182 } |
182 // It is a brand new probe! | 183 // It is a brand new probe! |
183 else if(i == Identified.NEW){ | 184 else if(i == Identified.NEW){ |
184 Violation violation = probeValidator.validate(probe); | 185 Violation violation = probeValidator.validate(probe); |
185 if (!violation.hasErrors()) { | 186 if (!violation.hasErrors()) { |