Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/GetArtifactServiceImpl.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 | 924da6695800 |
children | bc06a671ef60 |
comparison
equal
deleted
inserted
replaced
1366:d0eb2202ffbe | 1367:ab8eb2f544f2 |
---|---|
1 package de.intevation.flys.client.server; | 1 package de.intevation.flys.client.server; |
2 | 2 |
3 import org.w3c.dom.Document; | 3 import org.w3c.dom.Document; |
4 | |
5 import org.apache.log4j.Logger; | |
4 | 6 |
5 import com.google.gwt.user.server.rpc.RemoteServiceServlet; | 7 import com.google.gwt.user.server.rpc.RemoteServiceServlet; |
6 | 8 |
7 import de.intevation.artifacts.common.ArtifactNamespaceContext; | 9 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
8 import de.intevation.artifacts.common.utils.ClientProtocolUtils; | 10 import de.intevation.artifacts.common.utils.ClientProtocolUtils; |
26 */ | 28 */ |
27 public class GetArtifactServiceImpl | 29 public class GetArtifactServiceImpl |
28 extends RemoteServiceServlet | 30 extends RemoteServiceServlet |
29 implements GetArtifactService | 31 implements GetArtifactService |
30 { | 32 { |
33 private static final Logger logger = | |
34 Logger.getLogger(GetArtifactServiceImpl.class); | |
35 | |
36 | |
31 public static final String ERROR_DESCRIBE_ARTIFACT = | 37 public static final String ERROR_DESCRIBE_ARTIFACT = |
32 "error_describe_artifact"; | 38 "error_describe_artifact"; |
33 | 39 |
34 public static final String XPATH_RESULT = "/art:result/text()"; | 40 public static final String XPATH_RESULT = "/art:result/text()"; |
35 | 41 |
41 String locale, | 47 String locale, |
42 String uuid, | 48 String uuid, |
43 String hash) | 49 String hash) |
44 throws ServerException | 50 throws ServerException |
45 { | 51 { |
46 System.out.println("GetArtifactServiceImpl.getArtifact"); | 52 logger.info("GetArtifactServiceImpl.getArtifact"); |
47 | 53 |
48 Document describe = ClientProtocolUtils.newDescribeDocument( | 54 Document describe = ClientProtocolUtils.newDescribeDocument( |
49 uuid, hash, true); | 55 uuid, hash, true); |
50 | 56 |
51 HttpClient client = new HttpClientImpl(url, locale); | 57 HttpClient client = new HttpClientImpl(url, locale); |
69 if (result == null || !result.equals(OPERATION_FAILURE)) { | 75 if (result == null || !result.equals(OPERATION_FAILURE)) { |
70 return (Artifact) new FLYSArtifactCreator().create(description); | 76 return (Artifact) new FLYSArtifactCreator().create(description); |
71 } | 77 } |
72 } | 78 } |
73 catch (ConnectionException ce) { | 79 catch (ConnectionException ce) { |
74 System.err.println(ce.getLocalizedMessage()); | 80 logger.error(ce, ce); |
75 } | 81 } |
76 | 82 |
77 throw new ServerException(ERROR_DESCRIBE_ARTIFACT); | 83 throw new ServerException(ERROR_DESCRIBE_ARTIFACT); |
78 } | 84 } |
79 } | 85 } |