comparison flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java @ 3860:b32e8353c30e

Donate own error message when no users were found. flys-client/trunk@5625 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 27 Sep 2012 17:50:18 +0000
parents 8e69aca69074
children e39ac9767a69
comparison
equal deleted inserted replaced
3859:62332fa199bf 3860:b32e8353c30e
19 */ 19 */
20 public class UserServiceImpl 20 public class UserServiceImpl
21 extends RemoteServiceServlet 21 extends RemoteServiceServlet
22 implements UserService 22 implements UserService
23 { 23 {
24 /** Private logger. */
24 private static final Logger logger = Logger.getLogger(UserServiceImpl.class); 25 private static final Logger logger = Logger.getLogger(UserServiceImpl.class);
25 26
26 public static final String ERROR_NO_SUCH_USER = "error_no_such_user"; 27 public static final String ERROR_NO_SUCH_USER = "error_no_such_user";
28
29 public static final String ERROR_NO_USERS = "error_no_users";
27 30
28 public User getCurrentUser(String locale) 31 public User getCurrentUser(String locale)
29 throws AuthenticationException 32 throws AuthenticationException
30 { 33 {
31 String url = getServletContext().getInitParameter("server-url"); 34 String url = getServletContext().getInitParameter("server-url");
53 catch (ConnectionException ce) { 56 catch (ConnectionException ce) {
54 logger.error(ce, ce); 57 logger.error(ce, ce);
55 } 58 }
56 59
57 logger.error("No users existing in the server."); 60 logger.error("No users existing in the server.");
58 throw new AuthenticationException(ERROR_NO_SUCH_USER); 61 throw new AuthenticationException(ERROR_NO_USERS);
59 } 62 }
60 } 63 }
61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 64 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org