Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java @ 1050:eccf966fb677
State engine: Removed CallContext from state validation.
flys-artifacts/trunk@2512 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 19 Aug 2011 14:10:18 +0000 |
parents | 90ee95945684 |
children | 61c051e53f9b |
comparison
equal
deleted
inserted
replaced
1049:433559e25b50 | 1050:eccf966fb677 |
---|---|
269 return "wq_panel_adapted"; | 269 return "wq_panel_adapted"; |
270 } | 270 } |
271 | 271 |
272 | 272 |
273 @Override | 273 @Override |
274 public boolean validate(Artifact artifact, CallContext context) | 274 public boolean validate(Artifact artifact) |
275 throws IllegalArgumentException | 275 throws IllegalArgumentException |
276 { | 276 { |
277 logger.debug("WQAdapted.validate"); | 277 logger.debug("WQAdapted.validate"); |
278 | 278 |
279 FLYSArtifact flys = (FLYSArtifact) artifact; | 279 FLYSArtifact flys = (FLYSArtifact) artifact; |
280 StateData data = getData(flys, FIELD_WQ_MODE); | 280 StateData data = getData(flys, FIELD_WQ_MODE); |
281 | 281 |
282 String mode = data != null ? (String) data.getValue() : null; | 282 String mode = data != null ? (String) data.getValue() : null; |
283 | 283 |
284 if (mode != null && mode.equals("W")) { | 284 if (mode != null && mode.equals("W")) { |
285 return validateW(artifact, context); | 285 return validateW(artifact); |
286 } | 286 } |
287 else if (mode != null && mode.equals("Q")) { | 287 else if (mode != null && mode.equals("Q")) { |
288 return validateQ(artifact, context); | 288 return validateQ(artifact); |
289 } | 289 } |
290 else { | 290 else { |
291 throw new IllegalArgumentException("error_feed_no_wq_mode_selected"); | 291 throw new IllegalArgumentException("error_feed_no_wq_mode_selected"); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 | 295 |
296 protected boolean validateW(Artifact artifact, CallContext context) | 296 protected boolean validateW(Artifact artifact) |
297 throws IllegalArgumentException | 297 throws IllegalArgumentException |
298 { | 298 { |
299 logger.debug("WQAdapted.validateW"); | 299 logger.debug("WQAdapted.validateW"); |
300 FLYSArtifact flys = (FLYSArtifact) artifact; | 300 FLYSArtifact flys = (FLYSArtifact) artifact; |
301 | 301 |
321 | 321 |
322 return true; | 322 return true; |
323 } | 323 } |
324 | 324 |
325 | 325 |
326 protected boolean validateQ(Artifact artifact, CallContext context) | 326 protected boolean validateQ(Artifact artifact) |
327 throws IllegalArgumentException | 327 throws IllegalArgumentException |
328 { | 328 { |
329 logger.debug("WQAdapted.validateQ"); | 329 logger.debug("WQAdapted.validateQ"); |
330 FLYSArtifact flys = (FLYSArtifact) artifact; | 330 FLYSArtifact flys = (FLYSArtifact) artifact; |
331 | 331 |