chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1204539 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java
Date Mon, 21 Nov 2011 15:21:39 GMT
Author: fmui
Date: Mon Nov 21 15:21:38 2011
New Revision: 1204539

URL: http://svn.apache.org/viewvc?rev=1204539&view=rev
Log:
added debug messages to Cookie Manager

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java?rev=1204539&r1=1204538&r2=1204539&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieManager.java
Mon Nov 21 15:21:38 2011
@@ -34,6 +34,8 @@ import java.util.Map;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Cookie Manager.
@@ -43,6 +45,8 @@ import org.apache.chemistry.opencmis.com
 public class CmisCookieManager implements Serializable {
     private static final long serialVersionUID = 1L;
 
+    private static final Log LOG = LogFactory.getLog(CmisCookieManager.class.getName());
+
     private static final String VERSION_ZERO_HEADER = "Set-cookie";
     private static final String VERSION_ONE_HEADER = "Set-cookie2";
 
@@ -92,7 +96,15 @@ public class CmisCookieManager implement
                 }
             }
 
-            return getCookieMap(cookies, requestHeaders);
+            Map<String, List<String>> map = getCookieMap(cookies, requestHeaders);
+
+            if (LOG.isDebugEnabled()) {
+                if (map != null && !map.isEmpty()) {
+                    LOG.debug("Setting cookies for URL " + url + ": " + map.get("Cookie"));
+                }
+            }
+
+            return map;
         } finally {
             lock.writeLock().unlock();
         }
@@ -161,6 +173,12 @@ public class CmisCookieManager implement
                 }
                 store.add(uri, cookie);
             }
+
+            if (LOG.isDebugEnabled()) {
+                if (!cookies.isEmpty()) {
+                    LOG.debug("Retrieved cookies for URL " + url + ": " + cookies);
+                }
+            }
         } finally {
             lock.writeLock().unlock();
         }



Mime
View raw message