Permalink
Browse files

Merged with original ektorp master branch

  • Loading branch information...
2 parents 5c2514d + 1deb4eb commit 84c67439f3a5a18abec65ee56312185b41c47254 @INLHELL INLHELL committed Sep 24, 2012
Showing with 1,063 additions and 170 deletions.
  1. +45 −0 changelog.md
  2. +5 −5 doc/src/docbkx/reference_doc.xml
  3. +2 −2 org.ektorp.android/pom.xml
  4. +13 −0 org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidHttpClient.java
  5. +14 −2 org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidHttpResponse.java
  6. +2 −2 org.ektorp.spring/pom.xml
  7. +2 −2 org.ektorp/pom.xml
  8. +7 −0 org.ektorp/src/main/java/org/ektorp/CouchDbInstance.java
  9. +140 −80 org.ektorp/src/main/java/org/ektorp/PageRequest.java
  10. +221 −0 org.ektorp/src/main/java/org/ektorp/ReplicatorDocument.java
  11. +36 −1 org.ektorp/src/main/java/org/ektorp/ViewQuery.java
  12. +7 −5 org.ektorp/src/main/java/org/ektorp/http/HttpClient.java
  13. +1 −0 org.ektorp/src/main/java/org/ektorp/http/HttpResponse.java
  14. +16 −3 org.ektorp/src/main/java/org/ektorp/http/StdHttpClient.java
  15. +15 −4 org.ektorp/src/main/java/org/ektorp/http/StdHttpResponse.java
  16. +3 −1 org.ektorp/src/main/java/org/ektorp/impl/BulkOperationResponseHandler.java
  17. +32 −10 org.ektorp/src/main/java/org/ektorp/impl/PageResponseHandler.java
  18. +24 −15 org.ektorp/src/main/java/org/ektorp/impl/QueryResultParser.java
  19. +7 −1 org.ektorp/src/main/java/org/ektorp/impl/StdCouchDbInstance.java
  20. +89 −0 org.ektorp/src/main/java/org/ektorp/support/AttachmentsInOrderParser.java
  21. +6 −4 org.ektorp/src/main/java/org/ektorp/support/CouchDbDocument.java
  22. +4 −17 org.ektorp/src/test/java/org/ektorp/PageRequestTest.java
  23. +53 −0 org.ektorp/src/test/java/org/ektorp/ReplicatorDocumentTest.java
  24. +53 −0 org.ektorp/src/test/java/org/ektorp/ReplicatorDocument_UserContextTest.java
  25. +50 −0 org.ektorp/src/test/java/org/ektorp/http/StdHttpResponseTest.java
  26. +5 −0 org.ektorp/src/test/java/org/ektorp/impl/HttpResponseStub.java
  27. +4 −3 org.ektorp/src/test/java/org/ektorp/impl/PageResponseHandlerTest.java
  28. +5 −0 org.ektorp/src/test/java/org/ektorp/impl/ResponseOnFileStub.java
  29. +31 −8 org.ektorp/src/test/java/org/ektorp/impl/StdCouchDbConnectorTest.java
  30. +54 −0 org.ektorp/src/test/java/org/ektorp/support/AttachmentsInOrderParserTest.java
  31. +8 −0 org.ektorp/src/test/java/org/ektorp/support/DesignDocumentTest.java
  32. +6 −1 org.ektorp/src/test/java/org/ektorp/support/SimpleViewGeneratorTest.java
  33. +3 −2 org.ektorp/src/test/resources/org/ektorp/impl/view_result_with_ignored_docs.json
  34. +96 −0 org.ektorp/src/test/resources/org/ektorp/support/attachments.json
  35. +4 −2 pom.xml
View
@@ -1,5 +1,50 @@
Change log
==========
+Changes in version 1.3.0
+------------------------
+Ektorp 1.3.0 brings support for CouchDB 1.2 and Jackson 1.9
+### Fixes
+ * #78: Fix bug in Options with includeRevisions.
+ * #71: Fix bug where enableSSL=true and relaxedSSLSettings=false doesn't initialize SSLContext
+ * #71: Fix bug where configuration using StdHttpClient.Builder.url() without port doesn't work
+ * #70: Fixed bug where rows where ignored after first non-existent row was found
+ * #67: Issues with paging backwards
+ * #65: Wrong use of total_rows field in QueryResultParser
+ * #62: Sequence id type
+### Improvements
+ * Allow username and password to be included in StdHttpClient.Builder.url()
+ * #85: Replicator Documents and Connector
+ * #83: Support for Multipart Requests
+ * #77: Change needed to support LuceneDesignDocument
+ * #75: Common-js modules support for Views
+ * #63: Add abort method to streamingviewresult
+ * #58: ContentLength isn't long enough
+ * #29: Support Document Copy
+### Other Changes
+* Jackson Version changed to 1.9.7
+### Contributors
+Andreas Litt
+
+David Venable
+
+esromneb
+
+fireflyrox
+
+Geir Ove Grønmo
+
+Jake Goulding
+
+Henrik Lundgren
+
+Mark van Cuijk
+
+Millau Julien
+
+seanadkinson
+
+thesverre
+
Changes in version 1.2.2
------------------------
1.2.2 is a bug fix release.
@@ -9,7 +9,7 @@
<info>
<title>Ektorp Reference Documentation</title>
- <releaseinfo>Version: 1.2.2</releaseinfo>
+ <releaseinfo>Version: 1.3.0</releaseinfo>
<author>
<personname><firstname>Henrik</firstname><surname>Lundgren</surname></personname>
@@ -92,15 +92,15 @@
<programlisting language="xml">&lt;dependency&gt;
&lt;groupId&gt;org.ektorp&lt;/groupId&gt;
&lt;artifactId&gt;org.ektorp&lt;/artifactId&gt;
- &lt;version&gt;1.2.2&lt;/version&gt;
+ &lt;version&gt;1.3.0&lt;/version&gt;
&lt;/dependency&gt;</programlisting>
<para>Spring support module:</para>
<programlisting language="xml">&lt;dependency&gt;
&lt;groupId&gt;org.ektorp&lt;/groupId&gt;
&lt;artifactId&gt;org.ektorp.spring&lt;/artifactId&gt;
- &lt;version&gt;1.2.2&lt;/version&gt;
+ &lt;version&gt;1.3.0&lt;/version&gt;
&lt;/dependency&gt;</programlisting>
</section>
@@ -112,14 +112,14 @@
<programlisting language="xml">&lt;dependency&gt;
&lt;groupId&gt;org.ektorp&lt;/groupId&gt;
&lt;artifactId&gt;org.ektorp&lt;/artifactId&gt;
- &lt;version&gt;1.3.0-SNAPSHOT&lt;/version&gt;
+ &lt;version&gt;1.3.1-SNAPSHOT&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.ektorp&lt;/groupId&gt;
&lt;artifactId&gt;org.ektorp.spring&lt;/artifactId&gt;
- &lt;version&gt;1.3.0-SNAPSHOT&lt;/version&gt;
+ &lt;version&gt;1.3.1-SNAPSHOT&lt;/version&gt;
&lt;/dependency&gt;</programlisting>
<para>You can find the snapshots at
@@ -4,12 +4,12 @@
<artifactId>org.ektorp.android</artifactId>
<packaging>jar</packaging>
<name>Ektorp Android</name>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<description>Provides Android support to Ektorp</description>
<parent>
<groupId>org.ektorp</groupId>
<artifactId>org.ektorp.parent</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
</parent>
<dependencies>
@@ -4,6 +4,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.security.KeyStore;
+import java.util.Map;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
@@ -66,6 +67,11 @@ public HttpResponse get(String uri) {
}
@Override
+ public HttpResponse get(String uri, Map<String, String> headers) {
+ return executeRequest(new HttpGet(uri), headers);
+ }
+
+ @Override
public HttpResponse getUncached(String uri) {
return executeRequest(new HttpGet(uri), true);
}
@@ -135,6 +141,13 @@ private HttpResponse executePutPost(HttpEntityEnclosingRequestBase request,
}
}
+ private HttpResponse executeRequest(HttpRequestBase request, Map<String, String> headers) {
+ for(Map.Entry<String, String> header : headers.entrySet()) {
+ request.setHeader(header.getKey(), header.getValue());
+ }
+ return executeRequest(request);
+ }
+
private HttpResponse executeRequest(HttpRequestBase request, boolean useBackend) {
try {
org.apache.http.HttpResponse rsp;
@@ -25,16 +25,23 @@
private final StatusLine status;
private final String requestURI;
private final HttpRequestBase httpRequest;
+ private final String revision;
public static AndroidHttpResponse of(org.apache.http.HttpResponse rsp, HttpRequestBase httpRequest) {
- return new AndroidHttpResponse(rsp.getEntity(), rsp.getStatusLine(), httpRequest);
+ return new AndroidHttpResponse(rsp.getEntity(), rsp.getStatusLine(), httpRequest, rsp.getFirstHeader("ETag"));
}
- private AndroidHttpResponse(HttpEntity e, StatusLine status, HttpRequestBase httpRequest) {
+ private AndroidHttpResponse(HttpEntity e, StatusLine status, HttpRequestBase httpRequest, Header eTagHeader) {
this.httpRequest = httpRequest;
this.entity = e != null ? e : NULL_ENTITY;
this.status = status;
this.requestURI = httpRequest.getURI().toString();
+ if(eTagHeader != null) {
+ revision = eTagHeader.getValue().replace("\"", "");
+ }
+ else {
+ revision = null;
+ }
}
@Override
@@ -57,6 +64,11 @@ public InputStream getContent() {
}
@Override
+ public String getETag() {
+ return revision;
+ }
+
+ @Override
public long getContentLength() {
return entity.getContentLength();
}
@@ -4,12 +4,12 @@
<artifactId>org.ektorp.spring</artifactId>
<packaging>jar</packaging>
<name>Ektorp Spring</name>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<description>Provides Spring support to Ektorp</description>
<parent>
<groupId>org.ektorp</groupId>
<artifactId>org.ektorp.parent</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
</parent>
<dependencies>
View
@@ -4,12 +4,12 @@
<artifactId>org.ektorp</artifactId>
<packaging>jar</packaging>
<name>Ektorp</name>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<description>a Java CouchDB persistence library</description>
<parent>
<artifactId>org.ektorp.parent</artifactId>
<groupId>org.ektorp</groupId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
</parent>
<dependencies>
@@ -35,6 +35,13 @@
* @return
*/
CouchDbConnector createConnector(String path, boolean createIfNotExists);
+
+ /**
+ * Returns the Couch _replicator database
+ * @return CouchDbConnector a connector to the replicator database
+ */
+ CouchDbConnector getReplicatorConnector();
+
/**
* Convenience method for accessing the underlying HttpClient.
* Preferably used wrapped in a org.ektorp.http.RestTemplate.
Oops, something went wrong.

0 comments on commit 84c6743

Please sign in to comment.