Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 71144e25a6c9 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
57 "/art:river-info/art:river"; | 57 "/art:river-info/art:river"; |
58 | 58 |
59 private static final String XPATH_STATIONS = | 59 private static final String XPATH_STATIONS = |
60 "/art:river-info/art:measurement-stations/art:measurement-station"; | 60 "/art:river-info/art:measurement-stations/art:measurement-station"; |
61 | 61 |
62 private static final String XPATH_GAUGES = "/art:river-info/art:gauges/art:gauge"; | 62 private static final String XPATH_GAUGES = |
63 "/art:river-info/art:gauges/art:gauge"; | |
63 | 64 |
64 public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( | 65 public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( |
65 DateFormat.SHORT, Locale.GERMANY); | 66 DateFormat.SHORT, Locale.GERMANY); |
66 | 67 |
67 public RiverInfo getGauges(String river) throws ServerException { | 68 public RiverInfo getGauges(String river) throws ServerException { |
103 | 104 |
104 log.warn("No gauge found"); | 105 log.warn("No gauge found"); |
105 throw new ServerException(ERROR_NO_RIVER_INFO_FOUND); | 106 throw new ServerException(ERROR_NO_RIVER_INFO_FOUND); |
106 } | 107 } |
107 | 108 |
108 public RiverInfo getMeasurementStations(String river) throws ServerException { | 109 public RiverInfo getMeasurementStations(String river) |
110 throws ServerException { | |
109 log.info("RiverInfoServiceImpl.getMeasurementStations"); | 111 log.info("RiverInfoServiceImpl.getMeasurementStations"); |
110 | 112 |
111 String url = getServletContext().getInitParameter("server-url"); | 113 String url = getServletContext().getInitParameter("server-url"); |
112 | 114 |
113 Document doc = XMLUtils.newDocument(); | 115 Document doc = XMLUtils.newDocument(); |
123 doc.appendChild(riverele); | 125 doc.appendChild(riverele); |
124 | 126 |
125 HttpClient client = new HttpClientImpl(url); | 127 HttpClient client = new HttpClientImpl(url); |
126 | 128 |
127 try { | 129 try { |
128 Document result = client.callService(url, "measurementstationinfo", doc); | 130 Document result = client.callService( |
131 url, "measurementstationinfo", doc); | |
129 | 132 |
130 DefaultRiverInfo riverinfo = getRiverInfo(result); | 133 DefaultRiverInfo riverinfo = getRiverInfo(result); |
131 List<MeasurementStation> mstations = createMeasurementStations( | 134 List<MeasurementStation> mstations = createMeasurementStations( |
132 result, riverinfo.getName()); | 135 result, riverinfo.getName()); |
133 | 136 |
209 XPathConstants.NODESET, | 212 XPathConstants.NODESET, |
210 ArtifactNamespaceContext.INSTANCE); | 213 ArtifactNamespaceContext.INSTANCE); |
211 | 214 |
212 int num = stationnodes == null ? 0 : stationnodes.getLength(); | 215 int num = stationnodes == null ? 0 : stationnodes.getLength(); |
213 | 216 |
214 ArrayList<MeasurementStation> mstations = new ArrayList<MeasurementStation>(num); | 217 ArrayList<MeasurementStation> mstations = |
218 new ArrayList<MeasurementStation>(num); | |
215 | 219 |
216 if (num == 0) { | 220 if (num == 0) { |
217 log.warn("No measurement station found."); | 221 log.warn("No measurement station found."); |
218 } | 222 } |
219 else { | 223 else { |