abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r429583 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
Date Tue, 08 Aug 2006 05:16:50 GMT
Author: jmsnell
Date: Mon Aug  7 22:16:49 2006
New Revision: 429583

URL: http://svn.apache.org/viewvc?rev=429583&view=rev
Log:
Some use case optimizatations...

useful constructors that allow us to optimize for common usage patterns... 

examples: 

// no-cache request
client.get("foo", new RequestOptions(true));

// if-modified since
client.get("foo", new RequestOptions(new Date()));

// if-none-match
client.get("foo", new RequestOptions("entity-tag"));


Modified:
    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/RequestOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java?rev=429583&r1=429582&r2=429583&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 22:16:49 2006
@@ -44,6 +44,34 @@
   
   private Map<String,List<String>> headers = null;  
   
+  public RequestOptions() {}
+
+  public RequestOptions(Date ifModifiedSince) {
+    setIfModifiedSince(ifModifiedSince);
+  }
+  
+  public RequestOptions(String ifNoneMatch) {
+    setIfNoneMatch(ifNoneMatch);
+  }
+  
+  public RequestOptions(String... ifNoneMatch) {
+    setIfNoneMatch(ifNoneMatch);
+  }
+  
+  public RequestOptions(Date ifModifiedSince, String ifNoneMatch) {
+    setIfModifiedSince(ifModifiedSince);
+    setIfNoneMatch(ifNoneMatch);
+  }
+  
+  public RequestOptions(Date ifModifiedSince, String... ifNoneMatch) {
+    setIfModifiedSince(ifModifiedSince);
+    setIfNoneMatch(ifNoneMatch);
+  }
+  
+  public RequestOptions(boolean no_cache) {
+    setNoCache(no_cache);
+  }
+  
   private Map<String,List<String>> getHeaders() {
     if (headers == null)
       headers = new HashMap<String,List<String>>();



Mime
View raw message