Mercurial > dive4elements > river
annotate 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 |
rev | line source |
---|---|
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
1 package org.dive4elements.river.client.server.auth; |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
2 |
2985
1f64ee424f92
Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2959
diff
changeset
|
3 import org.apache.log4j.Logger; |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
4 |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
5 public class AuthenticationFactory { |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
6 |
2985
1f64ee424f92
Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2959
diff
changeset
|
7 private static final Logger log = |
1f64ee424f92
Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2959
diff
changeset
|
8 Logger.getLogger(AuthenticationFactory.class); |
1f64ee424f92
Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2959
diff
changeset
|
9 |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
10 public static Authenticator getInstance(String name) |
3696 | 11 throws IllegalArgumentException |
12 { | |
13 if (name == null) { | |
14 throw new IllegalArgumentException("Authentication type name is null"); | |
15 } | |
3697
2e12518ff5b4
Removed trailing whitespace. Reverted functional change in parsing plain user file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3696
diff
changeset
|
16 |
3696 | 17 if (name.equalsIgnoreCase("was") || |
18 name.equalsIgnoreCase("ggina")) { | |
2985
1f64ee424f92
Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2959
diff
changeset
|
19 log.debug("Using GGinA authenticator."); |
2959
5ba0a6efdf3b
Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2956
diff
changeset
|
20 return |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
21 new org.dive4elements.river.client.server.auth.was.Authenticator(); |
2959
5ba0a6efdf3b
Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2956
diff
changeset
|
22 } |
3696 | 23 else if (name.equalsIgnoreCase("plain")) { |
2985
1f64ee424f92
Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2959
diff
changeset
|
24 log.debug("Using plain authenticator."); |
2959
5ba0a6efdf3b
Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2956
diff
changeset
|
25 return |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 new org.dive4elements.river.client.server.auth.plain.Authenticator(); |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
27 } |
3697
2e12518ff5b4
Removed trailing whitespace. Reverted functional change in parsing plain user file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3696
diff
changeset
|
28 |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
29 throw new IllegalArgumentException("Unkown Authentication " + name); |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
30 } |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
31 } |