Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java @ 2956:d7f76f197d89
Refactor GGInA authentication
Move authentication related classes to de.intevation.fly.client.server.auth
package. Abstract the authentication classes to allow other authentications
beside WAS/GGInA.
flys-client/trunk@4936 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Wed, 11 Jul 2012 13:31:56 +0000 |
parents | |
children | 5ba0a6efdf3b |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/auth/AuthenticationFactory.java Wed Jul 11 13:31:56 2012 +0000 @@ -0,0 +1,15 @@ +package de.intevation.flys.client.server.auth; + +import java.lang.IllegalArgumentException; + +public class AuthenticationFactory { + + public static Authenticator getInstance(String name) + throws IllegalArgumentException { + if (name == null || name.equalsIgnoreCase("was") || + name.equalsIgnoreCase("ggina")) { + return new de.intevation.flys.client.server.auth.was.Authenticator(); + } + throw new IllegalArgumentException("Unkown Authentication " + name); + } +}