comparison flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java @ 1367:ab8eb2f544f2

Replaced stdout and stderr logging with log4j loggers in server classes. flys-client/trunk@3069 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 12:31:15 +0000
parents 4c65c5b60a86
children ec0c81f2c7a4
comparison
equal deleted inserted replaced
1366:d0eb2202ffbe 1367:ab8eb2f544f2
2 2
3 import java.io.InputStream; 3 import java.io.InputStream;
4 import java.io.IOException; 4 import java.io.IOException;
5 5
6 import org.w3c.dom.Document; 6 import org.w3c.dom.Document;
7
8 import org.apache.log4j.Logger;
7 9
8 import com.google.gwt.user.server.rpc.RemoteServiceServlet; 10 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
9 11
10 import de.intevation.artifacts.common.utils.ClientProtocolUtils; 12 import de.intevation.artifacts.common.utils.ClientProtocolUtils;
11 import de.intevation.artifacts.common.utils.XMLUtils; 13 import de.intevation.artifacts.common.utils.XMLUtils;
23 public class MapOutputServiceImpl 25 public class MapOutputServiceImpl
24 extends RemoteServiceServlet 26 extends RemoteServiceServlet
25 implements MapOutputService 27 implements MapOutputService
26 { 28 {
27 29
30 private static final Logger logger =
31 Logger.getLogger(MapOutputServiceImpl.class);
32
33
28 public void doOut(Collection collection, String serverUrl) 34 public void doOut(Collection collection, String serverUrl)
29 throws ServerException 35 throws ServerException
30 { 36 {
31 System.out.println("MapOutputServiceImpl.doGet"); 37 logger.info("MapOutputServiceImpl.doOut");
32 38
33 String uuid = collection.identifier(); 39 String uuid = collection.identifier();
34 40
35 try { 41 try {
36 Document request = ClientProtocolUtils.newOutCollectionDocument( 42 Document request = ClientProtocolUtils.newOutCollectionDocument(
39 HttpClient client = new HttpClientImpl(serverUrl); 45 HttpClient client = new HttpClientImpl(serverUrl);
40 InputStream is = client.collectionOut(request, uuid, "floodmap"); 46 InputStream is = client.collectionOut(request, uuid, "floodmap");
41 47
42 Document response = XMLUtils.parseDocument(is); 48 Document response = XMLUtils.parseDocument(is);
43 49
50 logger.debug(XMLUtils.toString(response));
51
44 // TODO parse response document and return a MapConfig object 52 // TODO parse response document and return a MapConfig object
45 } 53 }
46 catch (ConnectionException e) { 54 catch (ConnectionException e) {
47 e.printStackTrace(); 55 logger.error(e, e);
48 System.err.println(e.getMessage());
49 } 56 }
50 catch (IOException ioe) { 57 catch (IOException ioe) {
51 ioe.printStackTrace(); 58 logger.error(ioe, ioe);
52 System.err.println(ioe.getMessage());
53 } 59 }
54 } 60 }
55 } 61 }
56 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 62 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org