comparison gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.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 2ca1f3991e17
children 22169da49f9b
comparison
equal deleted inserted replaced
8202:e4606eae8ea5 8203:238fc722f87a
44 */ 44 */
45 public class WQInfoServiceImpl 45 public class WQInfoServiceImpl
46 extends RemoteServiceServlet 46 extends RemoteServiceServlet
47 implements WQInfoService 47 implements WQInfoService
48 { 48 {
49 private static final Logger logger = 49 private static final Logger log =
50 Logger.getLogger(WQInfoServiceImpl.class); 50 Logger.getLogger(WQInfoServiceImpl.class);
51 51
52 public static final String ERROR_NO_WQINFO_FOUND = 52 public static final String ERROR_NO_WQINFO_FOUND =
53 "error_no_wqinfo_found"; 53 "error_no_wqinfo_found";
54 54
60 String river, 60 String river,
61 double from, 61 double from,
62 double to) 62 double to)
63 throws ServerException 63 throws ServerException
64 { 64 {
65 logger.info("WQInfoServiceImpl.getWQInfo"); 65 log.info("WQInfoServiceImpl.getWQInfo");
66 66
67 String url = getServletContext().getInitParameter("server-url"); 67 String url = getServletContext().getInitParameter("server-url");
68 68
69 Document doc = XMLUtils.newDocument(); 69 Document doc = XMLUtils.newDocument();
70 70
91 HttpClient client = new HttpClientImpl(url, locale); 91 HttpClient client = new HttpClientImpl(url, locale);
92 92
93 try { 93 try {
94 Document result = client.callService(url, "mainvalues", doc); 94 Document result = client.callService(url, "mainvalues", doc);
95 95
96 logger.debug("Extract wq info objects now."); 96 log.debug("Extract wq info objects now.");
97 WQInfoObject[] objects = extractWQInfoObjects(result); 97 WQInfoObject[] objects = extractWQInfoObjects(result);
98 98
99 if (objects.length > 0) { 99 if (objects.length > 0) {
100 return objects; 100 return objects;
101 } 101 }
102 } 102 }
103 catch (ConnectionException ce) { 103 catch (ConnectionException ce) {
104 logger.error(ce, ce); 104 log.error(ce, ce);
105 } 105 }
106 106
107 throw new ServerException(ERROR_NO_WQINFO_FOUND); 107 throw new ServerException(ERROR_NO_WQINFO_FOUND);
108 } 108 }
109 109
123 XPATH_WQS, 123 XPATH_WQS,
124 XPathConstants.NODESET, 124 XPathConstants.NODESET,
125 ArtifactNamespaceContext.INSTANCE); 125 ArtifactNamespaceContext.INSTANCE);
126 126
127 if (list == null || list.getLength() == 0) { 127 if (list == null || list.getLength() == 0) {
128 logger.warn("No wq info found."); 128 log.warn("No wq info found.");
129 129
130 throw new ServerException(ERROR_NO_WQINFO_FOUND); 130 throw new ServerException(ERROR_NO_WQINFO_FOUND);
131 } 131 }
132 132
133 boolean debug = logger.isDebugEnabled(); 133 boolean debug = log.isDebugEnabled();
134 134
135 int num = list.getLength(); 135 int num = list.getLength();
136 if (debug) { 136 if (debug) {
137 logger.debug("Response contains " + num + " objects."); 137 log.debug("Response contains " + num + " objects.");
138 } 138 }
139 139
140 List<WQInfoObject> objects = 140 List<WQInfoObject> objects =
141 new ArrayList<WQInfoObject>(num); 141 new ArrayList<WQInfoObject>(num);
142 142
147 objects.add(obj); 147 objects.add(obj);
148 } 148 }
149 } 149 }
150 150
151 if (debug) { 151 if (debug) {
152 logger.debug("Retrieved " + objects.size() + " wq values"); 152 log.debug("Retrieved " + objects.size() + " wq values");
153 } 153 }
154 154
155 WQInfoObject [] array = (WQInfoObject[]) 155 WQInfoObject [] array = (WQInfoObject[])
156 objects.toArray(new WQInfoObject[objects.size()]); 156 objects.toArray(new WQInfoObject[objects.size()]);
157 157
226 official != null && official.equalsIgnoreCase("true"), 226 official != null && official.equalsIgnoreCase("true"),
227 start, 227 start,
228 stop); 228 stop);
229 } 229 }
230 catch (NumberFormatException nfe) { 230 catch (NumberFormatException nfe) {
231 logger.warn(nfe.getLocalizedMessage()); 231 log.warn(nfe.getLocalizedMessage());
232 } 232 }
233 } 233 }
234 234
235 logger.warn("Invalid wq info object found."); 235 log.warn("Invalid wq info object found.");
236 236
237 return null; 237 return null;
238 } 238 }
239 } 239 }
240 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 240 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org