Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/auth/AuthenticationFactory.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-client/src/main/java/org/dive4elements/river/client/server/auth/AuthenticationFactory.java@821a02bbfb4e |
children | 172338b1407f |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.client.server.auth; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 public class AuthenticationFactory { | |
6 | |
7 private static final Logger log = | |
8 Logger.getLogger(AuthenticationFactory.class); | |
9 | |
10 public static Authenticator getInstance(String name) | |
11 throws IllegalArgumentException | |
12 { | |
13 if (name == null) { | |
14 throw new IllegalArgumentException("Authentication type name is null"); | |
15 } | |
16 | |
17 if (name.equalsIgnoreCase("was") || | |
18 name.equalsIgnoreCase("ggina")) { | |
19 log.debug("Using GGinA authenticator."); | |
20 return | |
21 new org.dive4elements.river.client.server.auth.was.Authenticator(); | |
22 } | |
23 else if (name.equalsIgnoreCase("plain")) { | |
24 log.debug("Using plain authenticator."); | |
25 return | |
26 new org.dive4elements.river.client.server.auth.plain.Authenticator(); | |
27 } | |
28 | |
29 throw new IllegalArgumentException("Unkown Authentication " + name); | |
30 } | |
31 } |