incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r900725 - /sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
Date Tue, 19 Jan 2010 11:16:04 GMT
Author: fmeschbe
Date: Tue Jan 19 11:16:04 2010
New Revision: 900725

URL: http://svn.apache.org/viewvc?rev=900725&view=rev
Log:
JavaDoc and define logger as instance field instead of static field

Modified:
    sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java

Modified: sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java?rev=900725&r1=900724&r2=900725&view=diff
==============================================================================
--- sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
(original)
+++ sling/trunk/bundles/commons/auth/src/main/java/org/apache/sling/commons/auth/impl/SlingAuthenticator.java
Tue Jan 19 11:16:04 2010
@@ -81,13 +81,16 @@
  *
  * @scr.component name="org.apache.sling.engine.impl.auth.SlingAuthenticator"
  *                label="%auth.name" description="%auth.description"
- *                modified="modified" immediate="true" Register for three
- *                services
+ *                modified="modified" immediate="true"
+ *
+ * Register for three services
  * @scr.service interface="org.apache.sling.commons.auth.AuthenticationSupport"
  * @scr.service interface="org.apache.sling.commons.auth.Authenticator"
  * @scr.service interface="javax.servlet.ServletRequestListener"
+ *
  * @scr.property name="service.description" value="Sling Request Authenticator"
  * @scr.property name="service.vendor" value="The Apache Software Foundation"
+ *
  * @scr.reference name="authHandler"
  *                interface="org.apache.sling.commons.auth.spi.AuthenticationHandler"
  *                policy="dynamic" cardinality="0..n" bind="bindAuthHandler"
@@ -100,10 +103,8 @@
 public class SlingAuthenticator implements Authenticator,
         AuthenticationSupport, ServletRequestListener {
 
-    static final String REQUEST_ATTRIBUTE_SESSION = "javax.jcr.Session";
-
     /** default log */
-    private static final Logger log = LoggerFactory.getLogger(SlingAuthenticator.class);
+    private final Logger log = LoggerFactory.getLogger(SlingAuthenticator.class);
 
     /**
      * @scr.property valueRef="DEFAULT_IMPERSONATION_COOKIE"
@@ -134,6 +135,16 @@
     /** The default value for allowing anonymous access */
     private static final boolean DEFAULT_ANONYMOUS_ALLOWED = true;
 
+    /**
+     * The name of the request attribute providing the authenticated JCR
+     * Session. This is only provided for backwards compatibility and will be
+     * removed in a future release.
+     * <p>
+     * <b>DO NOT USE ANY MORE</b>
+     */
+    private static final String REQUEST_ATTRIBUTE_SESSION = "javax.jcr.Session";
+
+
     private static ArrayList<AbstractAuthenticationHandlerHolder> EMPTY_INFO = new
ArrayList<AbstractAuthenticationHandlerHolder>();
 
     /** @scr.reference */
@@ -684,15 +695,15 @@
         }
 
         Cookie cookie = new Cookie(name, value);
-        cookie.setMaxAge(maxAge);
+            cookie.setMaxAge(maxAge);
         cookie.setPath(path);
-        response.addCookie(cookie);
+            response.addCookie(cookie);
 
         // Tell a potential proxy server that this cookie is uncacheable
-        if (this.cacheControl) {
-            response.addHeader("Cache-Control", "no-cache=\"Set-Cookie\"");
+            if (this.cacheControl) {
+                response.addHeader("Cache-Control", "no-cache=\"Set-Cookie\"");
+            }
         }
-    }
 
     /**
      * Handles impersonation based on the request parameter for impersonation



Mime
View raw message