Skip to content
Browse files

Added CouchReplication.options property

Change-Id: I02116a5d173d8b0d725a7dea3c3c830c76b5f8d3
  • Loading branch information...
1 parent c01fef5 commit 0fab3eecf29768ac974e94746b4eac31b0de0284 @snej snej committed
Showing with 10 additions and 1 deletion.
  1. +5 −0 Couch/CouchReplication.h
  2. +5 −1 Couch/CouchReplication.m
View
5 Couch/CouchReplication.h
@@ -34,6 +34,7 @@ typedef enum {
bool _pull, _createTarget, _continuous;
NSString* _filter;
NSDictionary* _filterParams;
+ NSDictionary* _options;
BOOL _running;
NSString* _taskID;
NSString* _status;
@@ -57,6 +58,10 @@ typedef enum {
Should be a JSON-compatible dictionary. */
@property (nonatomic, copy) NSDictionary* filterParams;
+/** Other options to be provided to the replicator.
+ These will be added to the JSON body of the POST to /_replicate. */
+@property (nonatomic, copy) NSDictionary* options;
+
/** Starts the replication, asynchronously.
@return The operation to start replication, or nil if replication is already started. */
View
6 Couch/CouchReplication.m
@@ -61,6 +61,7 @@ - (void)dealloc {
[_error release];
[_filter release];
[_filterParams release];
+ [_options release];
[super dealloc];
}
@@ -72,7 +73,7 @@ - (NSString*) description {
@synthesize pull=_pull, createTarget=_createTarget, continuous=_continuous,
- filter=_filter, filterParams=_filterParams;
+ filter=_filter, filterParams=_filterParams, options=_options;
- (RESTOperation*) operationToStart: (BOOL)start {
@@ -91,6 +92,9 @@ - (RESTOperation*) operationToStart: (BOOL)start {
if (_filterParams)
[body setObject: _filterParams forKey: @"query_params"];
}
+ if (_options)
+ [body addEntriesFromDictionary: _options];
+
if (!start)
[body setObject: (id)kCFBooleanTrue forKey: @"cancel"];
RESTResource* replicate = [[[RESTResource alloc] initWithParent: _database.server

0 comments on commit 0fab3ee

Please sign in to comment.
Something went wrong with that request. Please try again.