Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/AdvanceServiceImpl.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; |
25 */ | 27 */ |
26 public class AdvanceServiceImpl | 28 public class AdvanceServiceImpl |
27 extends RemoteServiceServlet | 29 extends RemoteServiceServlet |
28 implements AdvanceService | 30 implements AdvanceService |
29 { | 31 { |
32 private static final Logger logger = Logger.getLogger(AdvanceService.class); | |
33 | |
34 | |
30 public static final String XPATH_RESULT = "/art:result/text()"; | 35 public static final String XPATH_RESULT = "/art:result/text()"; |
31 | 36 |
32 public static final String OPERATION_FAILURE = "FAILED"; | 37 public static final String OPERATION_FAILURE = "FAILED"; |
33 | 38 |
34 public static final String ERROR_ADVANCE_ARTIFACT = "error_advance_artifact"; | 39 public static final String ERROR_ADVANCE_ARTIFACT = "error_advance_artifact"; |
39 String locale, | 44 String locale, |
40 Artifact artifact, | 45 Artifact artifact, |
41 String target) | 46 String target) |
42 throws ServerException | 47 throws ServerException |
43 { | 48 { |
44 System.out.println("AdvanceServiceImpl.advance"); | 49 logger.info("AdvanceServiceImpl.advance"); |
45 | 50 |
46 Document advance = ClientProtocolUtils.newAdvanceDocument( | 51 Document advance = ClientProtocolUtils.newAdvanceDocument( |
47 artifact.getUuid(), | 52 artifact.getUuid(), |
48 artifact.getHash(), | 53 artifact.getHash(), |
49 target); | 54 target); |
70 if (result == null || !result.equals(OPERATION_FAILURE)) { | 75 if (result == null || !result.equals(OPERATION_FAILURE)) { |
71 return (Artifact) new FLYSArtifactCreator().create(description); | 76 return (Artifact) new FLYSArtifactCreator().create(description); |
72 } | 77 } |
73 } | 78 } |
74 catch (ConnectionException ce) { | 79 catch (ConnectionException ce) { |
75 System.err.println(ce.getLocalizedMessage()); | 80 logger.error(ce, ce); |
76 } | 81 } |
77 | 82 |
78 throw new ServerException(ERROR_ADVANCE_ARTIFACT); | 83 throw new ServerException(ERROR_ADVANCE_ARTIFACT); |
79 } | 84 } |
80 } | 85 } |