abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r429427 - in /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client: CommonsClient.java RequestOptions.java
Date Mon, 07 Aug 2006 18:35:29 GMT
Author: jmsnell
Date: Mon Aug  7 11:35:28 2006
New Revision: 429427

URL: http://svn.apache.org/viewvc?rev=429427&view=rev
Log:
Add an option for disabling the local cache independently of the Cache-Control header

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java?rev=429427&r1=429426&r2=429427&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
Mon Aug  7 11:35:28 2006
@@ -72,7 +72,10 @@
         CachedResponse cached_response = null;
         Cache cache = getCache();
         CacheDisposition disp = CacheDisposition.TRANSPARENT;
-        if (cache != null && options.getNoCache() == false && options.getNoStore()
== false) {
+        if (cache != null && 
+            options.getNoCache() == false && 
+            options.getNoStore() == false &&
+            options.getUseLocalCache()) {
           disp = cache.getDisposition(uri,options);
           cached_response = cache.get(uri, options);
           switch(disp) {

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java?rev=429427&r1=429426&r2=429427&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
Mon Aug  7 11:35:28 2006
@@ -40,6 +40,7 @@
   private long max_age = -1;
   private long max_stale = -1;
   private long min_fresh = -1;
+  private boolean noLocalCache = false;
   
   private Map<String,List<String>> headers = null;  
   
@@ -58,6 +59,19 @@
     return v;
   }
     
+  /**
+   * The difference between this and getNoCache is that this
+   * only disables the local cache without affecting the 
+   * Cache-Control header.
+   */
+  public boolean getUseLocalCache() {
+    return !noLocalCache;
+  }
+  
+  public void setUseLocalCache(boolean use_cache) {
+    this.noLocalCache = !use_cache;
+  }
+  
   public void setContentType(String value) {
     setHeader("Content-Type", value);
   }



Mime
View raw message