Mercurial > dive4elements > river
annotate 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 |
rev | line source |
---|---|
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.server.auth; |
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 } | |
16 | |
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 |
5ba0a6efdf3b
Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2956
diff
changeset
|
21 new de.intevation.flys.client.server.auth.was.Authenticator(); |
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 |
5ba0a6efdf3b
Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2956
diff
changeset
|
26 new de.intevation.flys.client.server.auth.plain.Authenticator(); |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
27 } |
3696 | 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 } |