annotate gwt-client/src/main/java/org/dive4elements/river/client/server/auth/AuthenticationFactory.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents ea9eef426962
children 0a5239a1e46e
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.server.auth;
2956
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10
2985
1f64ee424f92 Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2959
diff changeset
11 import org.apache.log4j.Logger;
2956
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
12
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
13 public class AuthenticationFactory {
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
14
2985
1f64ee424f92 Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2959
diff changeset
15 private static final Logger log =
1f64ee424f92 Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2959
diff changeset
16 Logger.getLogger(AuthenticationFactory.class);
1f64ee424f92 Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2959
diff changeset
17
2956
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
18 public static Authenticator getInstance(String name)
3696
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
19 throws IllegalArgumentException
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
20 {
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
21 if (name == null) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
22 throw new IllegalArgumentException(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
23 "Authentication type name is null");
3696
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
24 }
3697
2e12518ff5b4 Removed trailing whitespace. Reverted functional change in parsing plain user file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3696
diff changeset
25
3696
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
26 if (name.equalsIgnoreCase("was") ||
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
27 name.equalsIgnoreCase("ggina")) {
2985
1f64ee424f92 Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2959
diff changeset
28 log.debug("Using GGinA authenticator.");
2959
5ba0a6efdf3b Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2956
diff changeset
29 return
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
30 new org.dive4elements.river.client.server.auth.was
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
31 .Authenticator();
2959
5ba0a6efdf3b Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2956
diff changeset
32 }
3696
a050cb5f303f Cosmetics
Christian Lins <christian.lins@intevation.de>
parents: 2985
diff changeset
33 else if (name.equalsIgnoreCase("plain")) {
2985
1f64ee424f92 Corrected broken web.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2959
diff changeset
34 log.debug("Using plain authenticator.");
2959
5ba0a6efdf3b Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2956
diff changeset
35 return
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
36 new org.dive4elements.river.client.server.auth.plain
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 5993
diff changeset
37 .Authenticator();
2956
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38 }
3697
2e12518ff5b4 Removed trailing whitespace. Reverted functional change in parsing plain user file.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3696
diff changeset
39
2956
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
40 throw new IllegalArgumentException("Unkown Authentication " + name);
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
41 }
d7f76f197d89 Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
42 }

http://dive4elements.wald.intevation.org