Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/CrossSectionKMServiceImpl.java @ 8203:238fc722f87a
sed 's/logger/log/g' src/**/*.java
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 13:19:22 +0200 |
parents | ea9eef426962 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8202:e4606eae8ea5 | 8203:238fc722f87a |
---|---|
37 */ | 37 */ |
38 public class CrossSectionKMServiceImpl | 38 public class CrossSectionKMServiceImpl |
39 extends RemoteServiceServlet | 39 extends RemoteServiceServlet |
40 implements CrossSectionKMService | 40 implements CrossSectionKMService |
41 { | 41 { |
42 private static final Logger logger = | 42 private static final Logger log = |
43 Logger.getLogger(CrossSectionKMServiceImpl.class); | 43 Logger.getLogger(CrossSectionKMServiceImpl.class); |
44 | 44 |
45 /** XPath that points to the found cross section measurements. */ | 45 /** XPath that points to the found cross section measurements. */ |
46 public static final String XPATH_CROSS_SECTIONS | 46 public static final String XPATH_CROSS_SECTIONS |
47 = "/cross-sections/cross-section"; | 47 = "/cross-sections/cross-section"; |
63 String locale, | 63 String locale, |
64 Map<Integer, Double> data, | 64 Map<Integer, Double> data, |
65 int nNeighbours) | 65 int nNeighbours) |
66 throws ServerException | 66 throws ServerException |
67 { | 67 { |
68 logger.info("CrossSectionKMService.getCrossSectionKMs"); | 68 log.info("CrossSectionKMService.getCrossSectionKMs"); |
69 | 69 |
70 String url = getServletContext().getInitParameter("server-url"); | 70 String url = getServletContext().getInitParameter("server-url"); |
71 | 71 |
72 Document doc = XMLUtils.newDocument(); | 72 Document doc = XMLUtils.newDocument(); |
73 | 73 |
86 cs.setAttribute("n", Integer.valueOf(nNeighbours).toString()); | 86 cs.setAttribute("n", Integer.valueOf(nNeighbours).toString()); |
87 crossSection.appendChild(cs); | 87 crossSection.appendChild(cs); |
88 } | 88 } |
89 | 89 |
90 HttpClient client = new HttpClientImpl(url, locale); | 90 HttpClient client = new HttpClientImpl(url, locale); |
91 logger.debug("Created httpclient"); | 91 log.debug("Created httpclient"); |
92 | 92 |
93 try { | 93 try { |
94 // Document should contain: | 94 // Document should contain: |
95 // crosse-sections: | 95 // crosse-sections: |
96 // attribute(id), attribute(km) attribute(n) | 96 // attribute(id), attribute(km) attribute(n) |
124 kms.toArray(doubles); | 124 kms.toArray(doubles); |
125 result.put(Integer.valueOf(idx), doubles); | 125 result.put(Integer.valueOf(idx), doubles); |
126 } | 126 } |
127 } | 127 } |
128 catch(NumberFormatException nfe) { | 128 catch(NumberFormatException nfe) { |
129 logger.error("Response was not parsable"); | 129 log.error("Response was not parsable"); |
130 } | 130 } |
131 | 131 |
132 return result; | 132 return result; |
133 } | 133 } |
134 catch (ConnectionException ce) { | 134 catch (ConnectionException ce) { |
135 logger.error("ConnectionExsp", ce); | 135 log.error("ConnectionExsp", ce); |
136 } | 136 } |
137 | 137 |
138 logger.warn("CrossSectionKMService.getCrossSectionKMS() - FAILED"); | 138 log.warn("CrossSectionKMService.getCrossSectionKMS() - FAILED"); |
139 throw new ServerException(ERROR_GET_CROSS_SECTION); | 139 throw new ServerException(ERROR_GET_CROSS_SECTION); |
140 } | 140 } |
141 } | 141 } |
142 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 142 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |