Permalink
Browse files

add support for specifying a default HttpClientFactory at the TDServe…

…r level

this will be used by TDRouter when setting up any new replications
  • Loading branch information...
1 parent d6be09b commit 9f376c65ece6e0d34428e93a562a91de14994b9b @mschoch mschoch committed Jun 28, 2012
@@ -30,6 +30,8 @@
import org.codehaus.jackson.map.ObjectMapper;
+import com.couchbase.touchdb.support.HttpClientFactory;
+
/**
* Manages a directory containing TDDatabases.
*/
@@ -43,6 +45,8 @@
private File directory;
private Map<String, TDDatabase> databases;
+ private HttpClientFactory defaultHttpClientFactory;
+
public static ObjectMapper getObjectMapper() {
return mapper;
}
@@ -140,4 +144,13 @@ public void close() {
databases.clear();
}
+ public HttpClientFactory getDefaultHttpClientFactory() {
+ return defaultHttpClientFactory;
+ }
+
+ public void setDefaultHttpClientFactory(
+ HttpClientFactory defaultHttpClientFactory) {
+ this.defaultHttpClientFactory = defaultHttpClientFactory;
+ }
+
}
@@ -521,7 +521,7 @@ public TDStatus do_POST_replicate(TDDatabase _db, String _docID, String _attachm
if(!cancel) {
// Start replication:
- TDReplicator repl = db.getReplicator(remote, push, continuous);
+ TDReplicator repl = db.getReplicator(remote, server.getDefaultHttpClientFactory(), push, continuous);
if(repl == null) {
return new TDStatus(TDStatus.INTERNAL_SERVER_ERROR);
}

0 comments on commit 9f376c6

Please sign in to comment.