Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java @ 1025:2996395e44c9
Improved the logging of incoming mapviewer call data.
gnv/trunk@1279 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 29 Nov 2010 09:20:01 +0000 |
parents | b45faa9315ce |
children | 12c3863b2d8a |
comparison
equal
deleted
inserted
replaced
1024:b45faa9315ce | 1025:2996395e44c9 |
---|---|
29 import de.intevation.gnv.action.sessionmodel.SessionModel; | 29 import de.intevation.gnv.action.sessionmodel.SessionModel; |
30 import de.intevation.gnv.action.sessionmodel.SessionModelFactory; | 30 import de.intevation.gnv.action.sessionmodel.SessionModelFactory; |
31 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; | 31 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; |
32 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; | 32 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; |
33 import de.intevation.gnv.artifactdatabase.objects.map.MapService; | 33 import de.intevation.gnv.artifactdatabase.objects.map.MapService; |
34 import de.intevation.gnv.util.CaptureInputStream; | |
34 | 35 |
35 /** | 36 /** |
36 * This class provides the businesslogic for handling an | 37 * This class provides the businesslogic for handling an |
37 * MV-GNV-Interface-call. | 38 * MV-GNV-Interface-call. |
38 * This call can be done in two ways. | 39 * This call can be done in two ways. |
71 }else{ | 72 }else{ |
72 inputStream = request.getInputStream(); | 73 inputStream = request.getInputStream(); |
73 } | 74 } |
74 | 75 |
75 if (inputStream != null){ | 76 if (inputStream != null){ |
76 | 77 CaptureInputStream capture = log.isDebugEnabled() |
77 ByteArrayOutputStream out = new ByteArrayOutputStream(); | 78 ? new CaptureInputStream(inputStream) |
78 byte[] b = new byte[4096]; | 79 : null; |
79 int i = -1; | |
80 while ((i = inputStream.read(b)) > 0) { | |
81 out.write(b, 0, i); | |
82 } | |
83 out.close(); | |
84 inputStream.reset(); | |
85 | |
86 log.debug("REQUEST DOCUMENT: " + out.toString()); | |
87 | 80 |
88 try { | 81 try { |
89 ExternalCallParser ecp = new XMLExternalCallParser(inputStream); | 82 ExternalCallParser ecp = new XMLExternalCallParser(capture); |
90 ecp.parse(); | 83 ecp.parse(); |
84 | |
85 // print incoming data to log | |
86 if (capture != null) { | |
87 log.debug("REQUEST DOCUMENT: " + capture.copyToString()); | |
88 } | |
89 | |
91 String geometry = ecp.getGeometry(); | 90 String geometry = ecp.getGeometry(); |
92 String srs = ecp.getSRS(); | 91 String srs = ecp.getSRS(); |
93 Collection<MapService> mapServices = ecp.getMapServices(); | 92 Collection<MapService> mapServices = ecp.getMapServices(); |
94 | 93 |
95 Collection<ArtifactObject> availableFactories = | 94 Collection<ArtifactObject> availableFactories = |