Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/server/DischargeInfoServiceImpl.java @ 4740:fb135e1dfa35
Added 'type' attribute to <dc:variable/> element. If an optional 'type' attribute is given
the result of the XPATH expression is interpreted as this type.
Valid values are 'number', 'bool', 'node' and 'nodeset'. All other defaults
to 'string' which also is the default if nor type is given.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 02 Jan 2013 15:31:53 +0100 |
parents | 67468c90ca68 |
children |
rev | line source |
---|---|
1600
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.server; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 import org.w3c.dom.Document; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 import org.w3c.dom.Element; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.NodeList; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 import org.apache.log4j.Logger; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import com.google.gwt.user.server.rpc.RemoteServiceServlet; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.common.utils.XMLUtils; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifacts.httpclient.exceptions.ConnectionException; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifacts.httpclient.http.HttpClient; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.artifacts.httpclient.http.HttpClientImpl; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.client.shared.exceptions.ServerException; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.client.client.services.DischargeInfoService; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.client.shared.model.DischargeInfoObject; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.flys.client.shared.model.DischargeInfoObjectImpl; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 /** |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 */ |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 public class DischargeInfoServiceImpl |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 extends RemoteServiceServlet |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 implements DischargeInfoService |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 private static final Logger logger = |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 Logger.getLogger(DischargeInfoServiceImpl.class); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 public static final String ERROR_NO_DISCHARGEINFO_FOUND = |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 "error_no_dischargeinfo_found"; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 public static final String XPATH_DISTANCES = "art:discharges/art:discharge"; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 public DischargeInfoObject[] getDischargeInfo( |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 String locale, |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 long gauge) |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 throws ServerException |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 logger.info("DichargeInfoServiceImpl.getDischargeInfo"); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 String url = getServletContext().getInitParameter("server-url"); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 Document doc = XMLUtils.newDocument(); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 doc, |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 ArtifactNamespaceContext.NAMESPACE_URI, |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 Element gaugeEl = ec.create("gauge"); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 gaugeEl.setTextContent(String.valueOf(gauge)); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 doc.appendChild(gaugeEl); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 HttpClient client = new HttpClientImpl(url, locale); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 try { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 Document result = client.callService(url, "dischargeinfo", doc); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 logger.debug("Extract discharge info objects now."); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 DischargeInfoObject[] objects = extractDischargeInfoObjects(result); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 if (objects != null && objects.length > 0) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 return objects; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 catch (ConnectionException ce) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 logger.error(ce, ce); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 throw new ServerException(ERROR_NO_DISCHARGEINFO_FOUND); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 protected DischargeInfoObject[] extractDischargeInfoObjects( |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 Document result |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 ) |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 throws ServerException { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 NodeList list = result.getElementsByTagName("discharge"); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 if (list == null || list.getLength() == 0) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 logger.warn("No discharge info found."); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 throw new ServerException(ERROR_NO_DISCHARGEINFO_FOUND); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 int num = list.getLength(); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 logger.debug("Response contains " + num + " objects."); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 List<DischargeInfoObject> objects = |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 new ArrayList<DischargeInfoObject>(num); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 for (int i = 0; i < num; i++) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 DischargeInfoObject obj = buildDischargeInfoObject( |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 (Element)list.item(i)); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 if (obj != null) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 objects.add(obj); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 logger.debug("Retrieved " + objects.size() + " discharges."); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 return (DischargeInfoObject[]) |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
112 objects.toArray(new DischargeInfoObject[num]); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
115 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
116 protected DischargeInfoObject buildDischargeInfoObject(Element node) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
117 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 String desc = node.getAttribute("description").trim(); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 String start = node.getAttribute("start").trim(); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 String end = node.getAttribute("end").trim(); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 if (start.length() > 0 && end.length() > 0) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 try { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 Integer startYear = new Integer(start); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 Integer endYear = new Integer(end); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 return new DischargeInfoObjectImpl(desc, startYear, endYear); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 catch (NumberFormatException nfe) { |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 logger.warn(nfe.getLocalizedMessage()); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 logger.warn("Invalid distance info object found."); |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 return null; |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 } |
67468c90ca68
Added service to request discharge infos at a specific gauge.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |