comparison gwt-client/src/main/java/org/dive4elements/river/client/server/UserCollectionsServiceImpl.java @ 8203:238fc722f87a

sed 's/logger/log/g' src/**/*.java
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 13:19:22 +0200
parents ea9eef426962
children 0a5239a1e46e
comparison
equal deleted inserted replaced
8202:e4606eae8ea5 8203:238fc722f87a
44 */ 44 */
45 public class UserCollectionsServiceImpl 45 public class UserCollectionsServiceImpl
46 extends RemoteServiceServlet 46 extends RemoteServiceServlet
47 implements UserCollectionsService 47 implements UserCollectionsService
48 { 48 {
49 private static final Logger logger = Logger.getLogger( 49 private static final Logger log = Logger.getLogger(
50 UserCollectionsServiceImpl.class); 50 UserCollectionsServiceImpl.class);
51 51
52 52
53 public Collection[] getUserCollections(String locale, String userid) { 53 public Collection[] getUserCollections(String locale, String userid) {
54 logger.info("UserCollectionsServiceImpl.getUserCollections"); 54 log.info("UserCollectionsServiceImpl.getUserCollections");
55 55
56 String serverUrl = getServletContext().getInitParameter("server-url"); 56 String serverUrl = getServletContext().getInitParameter("server-url");
57 HttpClient client = new HttpClientImpl(serverUrl, locale); 57 HttpClient client = new HttpClientImpl(serverUrl, locale);
58 58
59 try { 59 try {
64 "/art:artifact-collections/art:artifact-collection", 64 "/art:artifact-collections/art:artifact-collection",
65 XPathConstants.NODESET, 65 XPathConstants.NODESET,
66 ArtifactNamespaceContext.INSTANCE); 66 ArtifactNamespaceContext.INSTANCE);
67 67
68 if (list == null || list.getLength() == 0) { 68 if (list == null || list.getLength() == 0) {
69 logger.debug("No collection found for user: " + userid); 69 log.debug("No collection found for user: " + userid);
70 return null; 70 return null;
71 } 71 }
72 72
73 int num = list.getLength(); 73 int num = list.getLength();
74 74
80 if (c != null) { 80 if (c != null) {
81 all.add(c); 81 all.add(c);
82 } 82 }
83 } 83 }
84 84
85 logger.debug("User has " + all.size() + " collections."); 85 log.debug("User has " + all.size() + " collections.");
86 86
87 return all.toArray(new Collection[all.size()]); 87 return all.toArray(new Collection[all.size()]);
88 } 88 }
89 catch (ConnectionException ce) { 89 catch (ConnectionException ce) {
90 logger.error(ce, ce); 90 log.error(ce, ce);
91 } 91 }
92 92
93 logger.debug("No user collections found."); 93 log.debug("No user collections found.");
94 return null; 94 return null;
95 } 95 }
96 96
97 97
98 /** 98 /**
115 long time = Long.parseLong(creationStr); 115 long time = Long.parseLong(creationStr);
116 long ttl = Long.parseLong(ttlStr); 116 long ttl = Long.parseLong(ttlStr);
117 return new DefaultCollection(uuid, ttl, name, new Date(time)); 117 return new DefaultCollection(uuid, ttl, name, new Date(time));
118 } 118 }
119 catch (NumberFormatException nfe) { 119 catch (NumberFormatException nfe) {
120 logger.warn("Error while parsing collection attributes."); 120 log.warn("Error while parsing collection attributes.");
121 return null; 121 return null;
122 } 122 }
123 } 123 }
124 124
125 logger.warn("Found an invalid Collection."); 125 log.warn("Found an invalid Collection.");
126 return null; 126 return null;
127 } 127 }
128 } 128 }
129 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 129 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org