Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/SingleInputTransition.java @ 219:f8cb64d5fe4f
Added the Testcase for Horizontal Cross-Sections
gnv-artifacts/trunk@279 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 30 Oct 2009 11:42:58 +0000 |
parents | d87347142702 |
children | ee2d4134d0b3 |
rev | line source |
---|---|
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.transition; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 import java.util.ArrayList; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 import java.util.Collection; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 import org.apache.log4j.Logger; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.gnv.geobackend.base.Result; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.gnv.transition.describedata.DefaultSingleValueDescribeData; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 /** |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 * @author Tim Englich <tim.englich@intevation.de> |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
16 * |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 */ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 public class SingleInputTransition extends TransitionBase { |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 /** |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 * the logger, used to log exceptions and additonaly information |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 */ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 private static Logger log = Logger.getLogger(SingleInputTransition.class); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
24 |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 /** |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 * |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 */ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 private static final long serialVersionUID = -6169497306324917318L; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 /** |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 * Constructor |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 */ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 public SingleInputTransition() { |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 } |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 /** |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 * @see de.intevation.gnv.transition.Transition#validate() |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 */ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 public boolean validate() { |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 return true; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 } |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
43 /** |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
44 * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
45 * java.lang.String) |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
46 */ |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 @Override |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
48 protected void purifyResult(Collection<Result> result, String uuid) { |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 log.debug("SingleInputTransition.purifyResult"); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
50 Collection<Object> describeData = this.getDescibeData(uuid); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
51 if (describeData == null) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
52 describeData = new ArrayList<Object>(); |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 } |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 String value = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
55 if (result != null && result.size() == 1) { |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 Result tmpItem = result.iterator().next(); |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 value = tmpItem.getObject("MAX").toString(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
58 } else { |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 value = ""; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
61 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
62 describeData.add(new DefaultSingleValueDescribeData(this.dataName,value)); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
63 this.setDescibeData(uuid, describeData); |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 } |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 } |