svn commit: r1798507 - /tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1798507 - /tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java

violetagg
Author: violetagg
Date: Mon Jun 12 18:39:38 2017
New Revision: 1798507

URL: http://svn.apache.org/viewvc?rev=1798507&view=rev
Log:
Format the code. No functional changes.
In preparation to apply PR https://github.com/apache/tomcat70/pull/3

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java?rev=1798507&r1=1798506&r2=1798507&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java Mon Jun 12 18:39:38 2017
@@ -40,19 +40,14 @@ import org.apache.juli.logging.LogFactor
  * users - regardless of whether or not they provide a session token with their
  * requests.
  */
-public class CrawlerSessionManagerValve extends ValveBase
-        implements HttpSessionBindingListener {
+public class CrawlerSessionManagerValve extends ValveBase implements HttpSessionBindingListener {
 
-    private static final Log log =
-        LogFactory.getLog(CrawlerSessionManagerValve.class);
+    private static final Log log = LogFactory.getLog(CrawlerSessionManagerValve.class);
 
-    private final Map<String,String> clientIpSessionId =
-            new ConcurrentHashMap<>();
-    private final Map<String,String> sessionIdClientIp =
-            new ConcurrentHashMap<>();
+    private final Map<String, String> clientIpSessionId = new ConcurrentHashMap<>();
+    private final Map<String, String> sessionIdClientIp = new ConcurrentHashMap<>();
 
-    private String crawlerUserAgents =
-        ".*[bB]ot.*|.*Yahoo! Slurp.*|.*Feedfetcher-Google.*";
+    private String crawlerUserAgents = ".*[bB]ot.*|.*Yahoo! Slurp.*|.*Feedfetcher-Google.*";
     private Pattern uaPattern = null;
     private int sessionInactiveInterval = 60;
 
@@ -109,7 +104,7 @@ public class CrawlerSessionManagerValve
     }
 
 
-    public Map<String,String> getClientIpSessionId() {
+    public Map<String, String> getClientIpSessionId() {
         return clientIpSessionId;
     }
 
@@ -123,17 +118,15 @@ public class CrawlerSessionManagerValve
 
 
     @Override
-    public void invoke(Request request, Response response) throws IOException,
-            ServletException {
+    public void invoke(Request request, Response response) throws IOException, ServletException {
 
         boolean isBot = false;
         String sessionId = null;
         String clientIp = null;
 
         if (log.isDebugEnabled()) {
-            log.debug(request.hashCode() + ": ClientIp=" +
-                    request.getRemoteAddr() + ", RequestedSessionId=" +
-                    request.getRequestedSessionId());
+            log.debug(request.hashCode() + ": ClientIp=" + request.getRemoteAddr()
+                    + ", RequestedSessionId=" + request.getRequestedSessionId());
         }
 
         // If the incoming request has a valid session ID, no action is required
@@ -157,8 +150,7 @@ public class CrawlerSessionManagerValve
                     isBot = true;
 
                     if (log.isDebugEnabled()) {
-                        log.debug(request.hashCode() +
-                                ": Bot found. UserAgent=" + uaHeader);
+                        log.debug(request.hashCode() + ": Bot found. UserAgent=" + uaHeader);
                     }
                 }
             }
@@ -170,8 +162,7 @@ public class CrawlerSessionManagerValve
                 if (sessionId != null) {
                     request.setRequestedSessionId(sessionId);
                     if (log.isDebugEnabled()) {
-                        log.debug(request.hashCode() + ": SessionID=" +
-                                sessionId);
+                        log.debug(request.hashCode() + ": SessionID=" + sessionId);
                     }
                 }
             }
@@ -191,14 +182,13 @@ public class CrawlerSessionManagerValve
                     s.setMaxInactiveInterval(sessionInactiveInterval);
 
                     if (log.isDebugEnabled()) {
-                        log.debug(request.hashCode() +
-                                ": New bot session. SessionID=" + s.getId());
+                        log.debug(request.hashCode() + ": New bot session. SessionID=" + s.getId());
                     }
                 }
             } else {
                 if (log.isDebugEnabled()) {
-                    log.debug(request.hashCode() +
-                            ": Bot session accessed. SessionID=" + sessionId);
+                    log.debug(
+                            request.hashCode() + ": Bot session accessed. SessionID=" + sessionId);
                 }
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]