Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/CreateCollectionServiceImpl.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 | ec5c75da5c7a |
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; |
27 */ | 29 */ |
28 public class CreateCollectionServiceImpl | 30 public class CreateCollectionServiceImpl |
29 extends RemoteServiceServlet | 31 extends RemoteServiceServlet |
30 implements CreateCollectionService | 32 implements CreateCollectionService |
31 { | 33 { |
34 private static final Logger logger = | |
35 Logger.getLogger(CreateCollectionServiceImpl.class); | |
36 | |
37 | |
32 /** XPath to figure out the uuid of the created collection.*/ | 38 /** XPath to figure out the uuid of the created collection.*/ |
33 public static final String XPATH_COLLECTION_UUID = | 39 public static final String XPATH_COLLECTION_UUID = |
34 "/art:result/art:artifact-collection/@art:uuid"; | 40 "/art:result/art:artifact-collection/@art:uuid"; |
35 | 41 |
36 /** XPath to figure out the ttl of the created collection.*/ | 42 /** XPath to figure out the ttl of the created collection.*/ |
44 | 50 |
45 | 51 |
46 public Collection create(String serverUrl, String locale, String ownerId) | 52 public Collection create(String serverUrl, String locale, String ownerId) |
47 throws ServerException | 53 throws ServerException |
48 { | 54 { |
49 System.out.println("Start creating a new collection."); | 55 logger.info("Start creating a new collection."); |
50 | 56 |
51 Document create = | 57 Document create = |
52 ClientProtocolUtils.newCreateCollectionDocument(null); | 58 ClientProtocolUtils.newCreateCollectionDocument(null); |
53 HttpClient client = new HttpClientImpl(serverUrl, locale); | 59 HttpClient client = new HttpClientImpl(serverUrl, locale); |
54 | 60 |
67 } | 73 } |
68 | 74 |
69 return new DefaultCollection(uuid, Long.valueOf(ttlStr), uuid); | 75 return new DefaultCollection(uuid, Long.valueOf(ttlStr), uuid); |
70 } | 76 } |
71 catch (ConnectionException ce) { | 77 catch (ConnectionException ce) { |
72 System.err.println(ce.getLocalizedMessage()); | 78 logger.error(ce, ce); |
73 } | 79 } |
74 | 80 |
75 throw new ServerException(ERROR_CREATE_COLLECTION); | 81 throw new ServerException(ERROR_CREATE_COLLECTION); |
76 } | 82 } |
77 } | 83 } |