changeset 2889:6c613c9f3a51

Stub for A&A Servlet Filter. flys-client/trunk@4572 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Sun, 03 Jun 2012 15:11:55 +0000
parents 55ea5474e11e
children fba76f4afca9
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/server/GGInAFilter.java
diffstat 2 files changed, 77 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Jun 01 12:47:03 2012 +0000
+++ b/flys-client/ChangeLog	Sun Jun 03 15:11:55 2012 +0000
@@ -1,7 +1,13 @@
+2012-06-03	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/server/GGinAFilter.java:
+	  New. Stub for upcoming authentication and authorization servlet
+	  filter.
+
 2012-06-01	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
-    * src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java:
-      Fixed descriptions of Q sectors.
+	* src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java:
+	  Fixed descriptions of Q sectors.
 
 2012-06-01  Raimund Renkert <raimund.renkert@intevation.de>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/GGInAFilter.java	Sun Jun 03 15:11:55 2012 +0000
@@ -0,0 +1,69 @@
+package de.intevation.flys.client.server;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+
+
+/** ServletFilter used for GGInA authentification and certain authorisation. */
+public class GGInAFilter implements Filter {
+
+    /** Private logger. */
+    private static Logger logger = Logger.getLogger(GGInAFilter.class);
+
+    public static final String LOG4J_PROPERTIES = "FLYS_CLIENT_LOG4J_PROPERIES";
+
+
+    /**
+     * Initialize.
+     */
+    @Override
+    public void init(FilterConfig config)
+    throws ServletException
+    {
+        System.out.println("GGInAFilter.init");
+    }
+
+
+    /**
+     * Called when filter in chain invoked.
+     * @param req request to servlet
+     * @param resp response of servlet
+     * @param chain the filter chain
+     */
+    @Override
+    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
+    throws IOException, ServletException
+    {
+        /*
+        String userAgent = ((HttpServletRequest) req).getHeader("User-Agent");
+        // Redirect
+        ((HttpServletResponse) resp).sendRedirect(this.geh,gina);
+        */
+        System.out.println("GGInAFilter.doFilter");
+        logger.debug("GGInAFilter.doFilter");
+        chain.doFilter(req, resp);
+        return;
+    }
+
+
+    /**
+     * Do nothing at destruction.
+     */
+    @Override
+    public void destroy() {
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org