Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java @ 3696:a050cb5f303f
Cosmetics
flys-client/trunk@5395 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sat, 08 Sep 2012 11:26:30 +0000 |
parents | 1f64ee424f92 |
children | 2e12518ff5b4 |
comparison
equal
deleted
inserted
replaced
3695:5e4d91304484 | 3696:a050cb5f303f |
---|---|
6 | 6 |
7 private static final Logger log = | 7 private static final Logger log = |
8 Logger.getLogger(AuthenticationFactory.class); | 8 Logger.getLogger(AuthenticationFactory.class); |
9 | 9 |
10 public static Authenticator getInstance(String name) | 10 public static Authenticator getInstance(String name) |
11 throws IllegalArgumentException { | 11 throws IllegalArgumentException |
12 if (name == null | 12 { |
13 || name.equalsIgnoreCase("was") | 13 if (name == null) { |
14 || name.equalsIgnoreCase("ggina")) { | 14 throw new IllegalArgumentException("Authentication type name is null"); |
15 } | |
16 | |
17 if (name.equalsIgnoreCase("was") || | |
18 name.equalsIgnoreCase("ggina")) { | |
15 log.debug("Using GGinA authenticator."); | 19 log.debug("Using GGinA authenticator."); |
16 return | 20 return |
17 new de.intevation.flys.client.server.auth.was.Authenticator(); | 21 new de.intevation.flys.client.server.auth.was.Authenticator(); |
18 } | 22 } |
19 if (name.equalsIgnoreCase("plain")) { | 23 else if (name.equalsIgnoreCase("plain")) { |
20 log.debug("Using plain authenticator."); | 24 log.debug("Using plain authenticator."); |
21 return | 25 return |
22 new de.intevation.flys.client.server.auth.plain.Authenticator(); | 26 new de.intevation.flys.client.server.auth.plain.Authenticator(); |
23 } | 27 } |
28 | |
24 throw new IllegalArgumentException("Unkown Authentication " + name); | 29 throw new IllegalArgumentException("Unkown Authentication " + name); |
25 } | 30 } |
26 } | 31 } |