Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java @ 778:9a828e5a2390
Removed trailing whitespace
gnv-artifacts/trunk@851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 29 Mar 2010 07:58:51 +0000 |
parents | 9efc1c256dbb |
children | b1f5f2a8840f |
comparison
equal
deleted
inserted
replaced
777:8009961db1cb | 778:9a828e5a2390 |
---|---|
47 /** | 47 /** |
48 * the logger, used to log exceptions and additionally information | 48 * the logger, used to log exceptions and additionally information |
49 */ | 49 */ |
50 private static Logger log = Logger.getLogger(MetaDataService.class); | 50 private static Logger log = Logger.getLogger(MetaDataService.class); |
51 | 51 |
52 | 52 |
53 private final static String FIS_REGION_QUERY_ID = | 53 private final static String FIS_REGION_QUERY_ID = |
54 "mapviewer_interface_fis_region"; | 54 "mapviewer_interface_fis_region"; |
55 private final static String MAPSERVICES_HAS_FIS_QUERY_ID = | 55 private final static String MAPSERVICES_HAS_FIS_QUERY_ID = |
56 "mapviewer_interface_mapservices_has_fis"; | 56 "mapviewer_interface_mapservices_has_fis"; |
57 private final static String MAPSERVICES_HAS_PARAMETER_QUERY_ID = | 57 private final static String MAPSERVICES_HAS_PARAMETER_QUERY_ID = |
58 "mapviewer_interface_mapservices_has_parameter"; | 58 "mapviewer_interface_mapservices_has_parameter"; |
59 | 59 |
60 private final static String MAPSERVICES_HAS_PARAMETER_USING_LAYER_QUERY_ID = | 60 private final static String MAPSERVICES_HAS_PARAMETER_USING_LAYER_QUERY_ID = |
61 "mapviewer_interface_mapservices_has_parameter_using_layer"; | 61 "mapviewer_interface_mapservices_has_parameter_using_layer"; |
62 | 62 |
63 private static String ATTRIBUTE_ID = "id"; | 63 private static String ATTRIBUTE_ID = "id"; |
64 private static String ATTRIBUTE_NAME = "name"; | 64 private static String ATTRIBUTE_NAME = "name"; |
65 private static String ATTRIBUTE_TYPE = "type"; | 65 private static String ATTRIBUTE_TYPE = "type"; |
66 private static String ATTRIBUTE_URL = "url"; | 66 private static String ATTRIBUTE_URL = "url"; |
67 private static String ATTRIBUTE_GROUPLAYER = "isgrouplayer"; | 67 private static String ATTRIBUTE_GROUPLAYER = "isgrouplayer"; |
68 private static String ATTRIBUTE_PARENTID = "parentid"; | 68 private static String ATTRIBUTE_PARENTID = "parentid"; |
69 private static String ATTRIBUTE_SRS = "srs"; | 69 private static String ATTRIBUTE_SRS = "srs"; |
70 | 70 |
71 | 71 |
72 private static String XPATH_LOACTION_NODE = "art:GetMetaData/art:location"; | 72 private static String XPATH_LOACTION_NODE = "art:GetMetaData/art:location"; |
73 private static String XPATH_MAPSERVICES_NODESET = "art:GetMetaData/" + | 73 private static String XPATH_MAPSERVICES_NODESET = "art:GetMetaData/" + |
74 "art:mapservices/" + | 74 "art:mapservices/" + |
75 "art:mapservice"; | 75 "art:mapservice"; |
76 private static String XPATH_LAYER_NODESET = "art:layer"; | 76 private static String XPATH_LAYER_NODESET = "art:layer"; |
77 | 77 |
78 /** | 78 /** |
79 * The UID of this Class. | 79 * The UID of this Class. |
80 */ | 80 */ |
81 private static final long serialVersionUID = -8446483887497236372L; | 81 private static final long serialVersionUID = -8446483887497236372L; |
82 | 82 |
96 log.debug("MetaDataService.process"); | 96 log.debug("MetaDataService.process"); |
97 Document document = null; | 97 Document document = null; |
98 try { | 98 try { |
99 Geometry g = this.parseGeometry(data); | 99 Geometry g = this.parseGeometry(data); |
100 Collection<MapService> mapServices = this.parseMapServices(data); | 100 Collection<MapService> mapServices = this.parseMapServices(data); |
101 Collection<FIS> resultFIS = this.unionFIS(this.getFIS(g), | 101 Collection<FIS> resultFIS = this.unionFIS(this.getFIS(g), |
102 this.getFIS(mapServices)); | 102 this.getFIS(mapServices)); |
103 document = XMLUtils.newDocument(); | 103 document = XMLUtils.newDocument(); |
104 this.writeFIS2Document(document, resultFIS); | 104 this.writeFIS2Document(document, resultFIS); |
105 log.debug(new ArtifactXMLUtilities().writeDocument2String(document)); | 105 log.debug(new ArtifactXMLUtilities().writeDocument2String(document)); |
106 } catch (MetaDataServiceException e) { | 106 } catch (MetaDataServiceException e) { |
108 document = new ArtifactXMLUtilities() | 108 document = new ArtifactXMLUtilities() |
109 .createExceptionReport(e.getMessage(), document); | 109 .createExceptionReport(e.getMessage(), document); |
110 } | 110 } |
111 return document; | 111 return document; |
112 } | 112 } |
113 | 113 |
114 private Geometry parseGeometry(Document data) | 114 private Geometry parseGeometry(Document data) |
115 throws MetaDataServiceException{ | 115 throws MetaDataServiceException{ |
116 log.debug("MetaDataService.parseGeometry"); | 116 log.debug("MetaDataService.parseGeometry"); |
117 | 117 |
118 Element locationNode = (Element) XMLUtils.xpath( | 118 Element locationNode = (Element) XMLUtils.xpath( |
119 data, | 119 data, |
120 XPATH_LOACTION_NODE, | 120 XPATH_LOACTION_NODE, |
121 XPathConstants.NODE, | 121 XPathConstants.NODE, |
122 ArtifactNamespaceContext.INSTANCE | 122 ArtifactNamespaceContext.INSTANCE |
137 } | 137 } |
138 } | 138 } |
139 } | 139 } |
140 return returnValue; | 140 return returnValue; |
141 } | 141 } |
142 | 142 |
143 private Collection<MapService> parseMapServices(Document data){ | 143 private Collection<MapService> parseMapServices(Document data){ |
144 log.debug("MetaDataService.parseMapServices"); | 144 log.debug("MetaDataService.parseMapServices"); |
145 | 145 |
146 NodeList mapServices = (NodeList) XMLUtils.xpath(data, | 146 NodeList mapServices = (NodeList) XMLUtils.xpath(data, |
147 XPATH_MAPSERVICES_NODESET, | 147 XPATH_MAPSERVICES_NODESET, |
148 XPathConstants.NODESET, | 148 XPathConstants.NODESET, |
149 ArtifactNamespaceContext.INSTANCE); | 149 ArtifactNamespaceContext.INSTANCE); |
150 Collection<MapService> returnValue = null; | 150 Collection<MapService> returnValue = null; |
151 if (mapServices != null){ | 151 if (mapServices != null){ |
154 Element mapServiceNode = (Element)mapServices.item(i); | 154 Element mapServiceNode = (Element)mapServices.item(i); |
155 String id = mapServiceNode.getAttribute(ATTRIBUTE_ID); | 155 String id = mapServiceNode.getAttribute(ATTRIBUTE_ID); |
156 String type = mapServiceNode.getAttribute(ATTRIBUTE_TYPE); | 156 String type = mapServiceNode.getAttribute(ATTRIBUTE_TYPE); |
157 String url = mapServiceNode.getAttribute(ATTRIBUTE_URL); | 157 String url = mapServiceNode.getAttribute(ATTRIBUTE_URL); |
158 Collection<Layer> layer = null; | 158 Collection<Layer> layer = null; |
159 | 159 |
160 NodeList layerNodes = (NodeList) XMLUtils.xpath(mapServiceNode, | 160 NodeList layerNodes = (NodeList) XMLUtils.xpath(mapServiceNode, |
161 XPATH_LAYER_NODESET, | 161 XPATH_LAYER_NODESET, |
162 XPathConstants.NODESET, | 162 XPathConstants.NODESET, |
163 ArtifactNamespaceContext.INSTANCE); | 163 ArtifactNamespaceContext.INSTANCE); |
164 if (layerNodes != null){ | 164 if (layerNodes != null){ |
165 layer = new ArrayList<Layer>(layerNodes.getLength()); | 165 layer = new ArrayList<Layer>(layerNodes.getLength()); |
166 for (int j = 0; j < layerNodes.getLength(); j++){ | 166 for (int j = 0; j < layerNodes.getLength(); j++){ |
167 Element layerNode = (Element)layerNodes.item(j); | 167 Element layerNode = (Element)layerNodes.item(j); |
168 String layerId = layerNode.getAttribute(ATTRIBUTE_ID); | 168 String layerId = layerNode.getAttribute(ATTRIBUTE_ID); |
169 String layerName = layerNode.getAttribute(ATTRIBUTE_NAME); | 169 String layerName = layerNode.getAttribute(ATTRIBUTE_NAME); |
170 boolean isGroupLayer = | 170 boolean isGroupLayer = |
171 Boolean.parseBoolean(layerNode | 171 Boolean.parseBoolean(layerNode |
172 .getAttribute( | 172 .getAttribute( |
173 ATTRIBUTE_GROUPLAYER)); | 173 ATTRIBUTE_GROUPLAYER)); |
174 String parentId = layerNode | 174 String parentId = layerNode |
175 .getAttribute(ATTRIBUTE_PARENTID); | 175 .getAttribute(ATTRIBUTE_PARENTID); |
176 | 176 |
177 layer.add(new DefaultLayer(layerId, | 177 layer.add(new DefaultLayer(layerId, |
178 layerName, | 178 layerName, |
179 isGroupLayer, | 179 isGroupLayer, |
180 parentId)); | 180 parentId)); |
181 } | 181 } |
182 } | 182 } |
183 MapService mapService = new DefaultMapService(id, layer, | 183 MapService mapService = new DefaultMapService(id, layer, |
184 type, url); | 184 type, url); |
185 returnValue.add(mapService); | 185 returnValue.add(mapService); |
186 | 186 |
187 } | 187 } |
188 } | 188 } |
189 return returnValue; | 189 return returnValue; |
190 } | 190 } |
191 | 191 |
192 private Collection<FIS> unionFIS(Collection<FIS> fromGeometry, | 192 private Collection<FIS> unionFIS(Collection<FIS> fromGeometry, |
193 Collection<FIS> fromMapservices){ | 193 Collection<FIS> fromMapservices){ |
194 log.debug("MetaDataService.unionFIS"); | 194 log.debug("MetaDataService.unionFIS"); |
195 Collection<FIS> returnValue = null; | 195 Collection<FIS> returnValue = null; |
196 if (fromGeometry == null || fromGeometry.isEmpty()){ | 196 if (fromGeometry == null || fromGeometry.isEmpty()){ |
197 returnValue = fromMapservices; | 197 returnValue = fromMapservices; |
198 }else if (fromMapservices == null || fromMapservices.isEmpty()){ | 198 }else if (fromMapservices == null || fromMapservices.isEmpty()){ |
199 returnValue = fromGeometry; | 199 returnValue = fromGeometry; |
200 }else{ | 200 }else{ |
201 | 201 |
202 returnValue = new ArrayList<FIS>(); | 202 returnValue = new ArrayList<FIS>(); |
203 Iterator<FIS> it = fromMapservices.iterator(); | 203 Iterator<FIS> it = fromMapservices.iterator(); |
204 while (it.hasNext()){ | 204 while (it.hasNext()){ |
205 FIS fis = it.next(); | 205 FIS fis = it.next(); |
206 if (fromGeometry.contains(fis)){ | 206 if (fromGeometry.contains(fis)){ |
208 } | 208 } |
209 } | 209 } |
210 } | 210 } |
211 return returnValue; | 211 return returnValue; |
212 } | 212 } |
213 | 213 |
214 /** | 214 /** |
215 * Puts the retrieved FIS into the given XML-Document. | 215 * Puts the retrieved FIS into the given XML-Document. |
216 * @param document the Document where the FIS should be put in. | 216 * @param document the Document where the FIS should be put in. |
217 * @param fis the retrieved FIS which should be written into | 217 * @param fis the retrieved FIS which should be written into |
218 * the XML-Document. | 218 * the XML-Document. |
219 */ | 219 */ |
220 private void writeFIS2Document(Document document, Collection<FIS> fis){ | 220 private void writeFIS2Document(Document document, Collection<FIS> fis){ |
221 | 221 |
222 if (fis != null){ | 222 if (fis != null){ |
223 Iterator<FIS> it = fis.iterator(); | 223 Iterator<FIS> it = fis.iterator(); |
224 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( | 224 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
225 document, | 225 document, |
226 ArtifactNamespaceContext.NAMESPACE_URI, | 226 ArtifactNamespaceContext.NAMESPACE_URI, |
227 ArtifactNamespaceContext.NAMESPACE_PREFIX | 227 ArtifactNamespaceContext.NAMESPACE_PREFIX |
228 ); | 228 ); |
229 Node rootNode = creator.create("result"); | 229 Node rootNode = creator.create("result"); |
230 document.appendChild(rootNode); | 230 document.appendChild(rootNode); |
231 | 231 |
232 Node factoriesNode = creator.create("factories"); | 232 Node factoriesNode = creator.create("factories"); |
233 rootNode.appendChild(factoriesNode); | 233 rootNode.appendChild(factoriesNode); |
234 while (it.hasNext()){ | 234 while (it.hasNext()){ |
235 FIS tmpFIS = it.next(); | 235 FIS tmpFIS = it.next(); |
236 Element fisNode = creator.create("factory"); | 236 Element fisNode = creator.create("factory"); |
237 fisNode.setAttribute("art:name",tmpFIS.getID()); | 237 fisNode.setAttribute("art:name",tmpFIS.getID()); |
238 | 238 |
239 Collection<Parameter> parameter = tmpFIS.getParameter(); | 239 Collection<Parameter> parameter = tmpFIS.getParameter(); |
240 | 240 |
241 if(parameter != null){ | 241 if(parameter != null){ |
242 Iterator<Parameter> pit = parameter.iterator(); | 242 Iterator<Parameter> pit = parameter.iterator(); |
243 while (pit.hasNext()){ | 243 while (pit.hasNext()){ |
244 Parameter p = pit.next(); | 244 Parameter p = pit.next(); |
245 Element parameterNode = creator.create("parameter"); | 245 Element parameterNode = creator.create("parameter"); |
250 } | 250 } |
251 factoriesNode.appendChild(fisNode); | 251 factoriesNode.appendChild(fisNode); |
252 } | 252 } |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 /** | 256 /** |
257 * Returns all FIS which Areas is intersected by this given Geometry | 257 * Returns all FIS which Areas is intersected by this given Geometry |
258 * @param g the Geometry which should be used to determine the FIS. | 258 * @param g the Geometry which should be used to determine the FIS. |
259 * @return all FIS which Areas is intersected by this given Geometry | 259 * @return all FIS which Areas is intersected by this given Geometry |
260 */ | 260 */ |
261 protected Collection<FIS> getFIS(Geometry g) | 261 protected Collection<FIS> getFIS(Geometry g) |
262 throws MetaDataServiceException{ | 262 throws MetaDataServiceException{ |
263 log.debug("MetaDataService.getFIS ==> Geometry"); | 263 log.debug("MetaDataService.getFIS ==> Geometry"); |
264 Collection<FIS> resultValue = null; | 264 Collection<FIS> resultValue = null; |
265 if (g != null){ | 265 if (g != null){ |
266 try { | 266 try { |
267 QueryExecutor queryExecutor = QueryExecutorFactory | 267 QueryExecutor queryExecutor = QueryExecutorFactory |
268 .getInstance() | 268 .getInstance() |
269 .getQueryExecutor(); | 269 .getQueryExecutor(); |
270 Collection<Result> result = queryExecutor.executeQuery(FIS_REGION_QUERY_ID, | 270 Collection<Result> result = queryExecutor.executeQuery(FIS_REGION_QUERY_ID, |
271 new String[]{g.toString()}); | 271 new String[]{g.toString()}); |
272 | 272 |
273 if (result != null){ | 273 if (result != null){ |
274 resultValue = new ArrayList<FIS>(result.size()); | 274 resultValue = new ArrayList<FIS>(result.size()); |
275 Iterator<Result> it = result.iterator(); | 275 Iterator<Result> it = result.iterator(); |
276 while (it.hasNext()){ | 276 while (it.hasNext()){ |
277 Result value = it.next(); | 277 Result value = it.next(); |
284 throw new MetaDataServiceException("Cannot Query FIS from DB."); | 284 throw new MetaDataServiceException("Cannot Query FIS from DB."); |
285 } | 285 } |
286 } | 286 } |
287 return resultValue; | 287 return resultValue; |
288 } | 288 } |
289 | 289 |
290 /** | 290 /** |
291 * Returns all FIS which were represented by the given Mapservices | 291 * Returns all FIS which were represented by the given Mapservices |
292 * @param mapServices the Mapservices which should determine the FIS. | 292 * @param mapServices the Mapservices which should determine the FIS. |
293 * @return all FIS which where represented my the given Mapservices. | 293 * @return all FIS which where represented my the given Mapservices. |
294 */ | 294 */ |
296 throws MetaDataServiceException{ | 296 throws MetaDataServiceException{ |
297 log.debug("MetaDataService.getFIS ==> MapServices"); | 297 log.debug("MetaDataService.getFIS ==> MapServices"); |
298 Collection<FIS> resultValue = null; | 298 Collection<FIS> resultValue = null; |
299 if (mapServices != null && !mapServices.isEmpty()){ | 299 if (mapServices != null && !mapServices.isEmpty()){ |
300 try { | 300 try { |
301 | 301 |
302 String mapServiceNames = ""; | 302 String mapServiceNames = ""; |
303 Iterator<MapService> mit = mapServices.iterator(); | 303 Iterator<MapService> mit = mapServices.iterator(); |
304 while(mit.hasNext()){ | 304 while(mit.hasNext()){ |
305 if (mapServiceNames.length() > 0){ | 305 if (mapServiceNames.length() > 0){ |
306 mapServiceNames += " , "; | 306 mapServiceNames += " , "; |
307 } | 307 } |
308 mapServiceNames += "'"+mit.next().getID()+"'"; | 308 mapServiceNames += "'"+mit.next().getID()+"'"; |
309 } | 309 } |
310 | 310 |
311 QueryExecutor queryExecutor = QueryExecutorFactory | 311 QueryExecutor queryExecutor = QueryExecutorFactory |
312 .getInstance() | 312 .getInstance() |
313 .getQueryExecutor(); | 313 .getQueryExecutor(); |
314 Collection<Result> result = queryExecutor.executeQuery( | 314 Collection<Result> result = queryExecutor.executeQuery( |
315 MAPSERVICES_HAS_FIS_QUERY_ID, | 315 MAPSERVICES_HAS_FIS_QUERY_ID, |
319 Iterator<Result> it = result.iterator(); | 319 Iterator<Result> it = result.iterator(); |
320 while (it.hasNext()){ | 320 while (it.hasNext()){ |
321 Result value = it.next(); | 321 Result value = it.next(); |
322 String fisId = value.getString(0).trim(); | 322 String fisId = value.getString(0).trim(); |
323 String mapServiceID = value.getString(1).trim(); | 323 String mapServiceID = value.getString(1).trim(); |
324 | 324 |
325 // FIRST LOOK IF ONE MAPSERVICE REPRESENTS ONLY ONE PARAM | 325 // FIRST LOOK IF ONE MAPSERVICE REPRESENTS ONLY ONE PARAM |
326 Collection<Result> result2 = queryExecutor.executeQuery( | 326 Collection<Result> result2 = queryExecutor.executeQuery( |
327 MAPSERVICES_HAS_PARAMETER_QUERY_ID, | 327 MAPSERVICES_HAS_PARAMETER_QUERY_ID, |
328 new String[]{"'"+mapServiceID+"'"}); | 328 new String[]{"'"+mapServiceID+"'"}); |
329 Collection<Parameter> parameter = null; | 329 Collection<Parameter> parameter = null; |
332 parameter = new ArrayList<Parameter>(1); | 332 parameter = new ArrayList<Parameter>(1); |
333 while (it2.hasNext()){ | 333 while (it2.hasNext()){ |
334 Result parameterValue = it2.next(); | 334 Result parameterValue = it2.next(); |
335 String parameterID = parameterValue.getString(0) | 335 String parameterID = parameterValue.getString(0) |
336 .trim(); | 336 .trim(); |
337 parameter.add(new DefaultParameter(parameterID, | 337 parameter.add(new DefaultParameter(parameterID, |
338 parameterID)); | 338 parameterID)); |
339 } | 339 } |
340 }else{ | 340 }else{ |
341 // IF FALSE LOOK IF THE GIVEN LAYERs TO AN MAPSERVICE | 341 // IF FALSE LOOK IF THE GIVEN LAYERs TO AN MAPSERVICE |
342 // REPRESENTS DIFFERENT PARAMS | 342 // REPRESENTS DIFFERENT PARAMS |
343 MapService service = this.getMapService(mapServices, | 343 MapService service = this.getMapService(mapServices, |
344 mapServiceID); | 344 mapServiceID); |
345 Collection<Layer> layer = service.getLayer(); | 345 Collection<Layer> layer = service.getLayer(); |
346 if (layer != null && !layer.isEmpty()){ | 346 if (layer != null && !layer.isEmpty()){ |
347 String layerQueryString = | 347 String layerQueryString = |
348 this.createLayerQueryString(layer); | 348 this.createLayerQueryString(layer); |
349 Collection<Result> parameterResult = | 349 Collection<Result> parameterResult = |
350 queryExecutor.executeQuery( | 350 queryExecutor.executeQuery( |
351 MAPSERVICES_HAS_PARAMETER_USING_LAYER_QUERY_ID, | 351 MAPSERVICES_HAS_PARAMETER_USING_LAYER_QUERY_ID, |
352 new String[]{"'"+mapServiceID+"'", | 352 new String[]{"'"+mapServiceID+"'", |
353 layerQueryString}); | 353 layerQueryString}); |
354 if (parameterResult != null && | 354 if (parameterResult != null && |
355 !parameterResult.isEmpty()){ | 355 !parameterResult.isEmpty()){ |
356 Iterator<Result> it2 = parameterResult.iterator(); | 356 Iterator<Result> it2 = parameterResult.iterator(); |
357 parameter = new ArrayList<Parameter>(parameterResult.size()); | 357 parameter = new ArrayList<Parameter>(parameterResult.size()); |
358 while (it2.hasNext()){ | 358 while (it2.hasNext()){ |
359 Result parameterValue = it2.next(); | 359 Result parameterValue = it2.next(); |
360 String parameterID = parameterValue.getString(0) | 360 String parameterID = parameterValue.getString(0) |
361 .trim(); | 361 .trim(); |
362 parameter.add(new DefaultParameter(parameterID, | 362 parameter.add(new DefaultParameter(parameterID, |
363 parameterID)); | 363 parameterID)); |
364 } | 364 } |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 } | 368 } |
369 | 369 |
370 FIS fis = this.getFIS(resultValue, fisId); | 370 FIS fis = this.getFIS(resultValue, fisId); |
371 if (fis != null){ | 371 if (fis != null){ |
372 if (parameter != null){ | 372 if (parameter != null){ |
373 fis.addParameter(parameter); | 373 fis.addParameter(parameter); |
374 } | 374 } |
379 } | 379 } |
380 } catch (QueryException e) { | 380 } catch (QueryException e) { |
381 log.error(e,e); | 381 log.error(e,e); |
382 throw new MetaDataServiceException("Cannot Query FIS from DB."); | 382 throw new MetaDataServiceException("Cannot Query FIS from DB."); |
383 } | 383 } |
384 | 384 |
385 } | 385 } |
386 return resultValue; | 386 return resultValue; |
387 } | 387 } |
388 | 388 |
389 | 389 |
390 private FIS getFIS (Collection<FIS> fis, String fisId){ | 390 private FIS getFIS (Collection<FIS> fis, String fisId){ |
391 | 391 |
392 Iterator<FIS> it = fis.iterator(); | 392 Iterator<FIS> it = fis.iterator(); |
393 while(it.hasNext()){ | 393 while(it.hasNext()){ |
394 FIS tmpFIS = it.next(); | 394 FIS tmpFIS = it.next(); |
395 if (tmpFIS.getID().equals(fisId)){ | 395 if (tmpFIS.getID().equals(fisId)){ |
396 return tmpFIS; | 396 return tmpFIS; |
397 } | 397 } |
398 } | 398 } |
399 return null; | 399 return null; |
400 } | 400 } |
401 | 401 |
402 private MapService getMapService(Collection<MapService> mapServices, | 402 private MapService getMapService(Collection<MapService> mapServices, |
403 String mapServiceID){ | 403 String mapServiceID){ |
404 log.debug("MetaDataService.getMapService"); | 404 log.debug("MetaDataService.getMapService"); |
405 Iterator<MapService> it = mapServices.iterator(); | 405 Iterator<MapService> it = mapServices.iterator(); |
406 while (it.hasNext()){ | 406 while (it.hasNext()){ |
409 return service; | 409 return service; |
410 } | 410 } |
411 } | 411 } |
412 return null; | 412 return null; |
413 } | 413 } |
414 | 414 |
415 private String createLayerQueryString(Collection<Layer> layer){ | 415 private String createLayerQueryString(Collection<Layer> layer){ |
416 log.debug("MetaDataService.createLayerQueryString"); | 416 log.debug("MetaDataService.createLayerQueryString"); |
417 StringBuffer sb = new StringBuffer();; | 417 StringBuffer sb = new StringBuffer();; |
418 Iterator<Layer> it = layer.iterator(); | 418 Iterator<Layer> it = layer.iterator(); |
419 synchronized (sb) { | 419 synchronized (sb) { |
423 sb.append(l.getID()); | 423 sb.append(l.getID()); |
424 if (it.hasNext()){ | 424 if (it.hasNext()){ |
425 sb.append(" , "); | 425 sb.append(" , "); |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 } | 429 } |
430 } | 430 } |
431 String returnValue = sb.toString(); | 431 String returnValue = sb.toString(); |
432 if (returnValue.endsWith(" , ")){ | 432 if (returnValue.endsWith(" , ")){ |
433 returnValue = returnValue.substring(0,returnValue | 433 returnValue = returnValue.substring(0,returnValue |