Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Added CouchReplication.options property
Browse files Browse the repository at this point in the history
Change-Id: I02116a5d173d8b0d725a7dea3c3c830c76b5f8d3
  • Loading branch information
snej committed May 15, 2012
1 parent c01fef5 commit 0fab3ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Couch/CouchReplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ typedef enum {
bool _pull, _createTarget, _continuous;
NSString* _filter;
NSDictionary* _filterParams;
NSDictionary* _options;
BOOL _running;
NSString* _taskID;
NSString* _status;
Expand All @@ -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. */
Expand Down
6 changes: 5 additions & 1 deletion Couch/CouchReplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ - (void)dealloc {
[_error release];
[_filter release];
[_filterParams release];
[_options release];
[super dealloc];
}

Expand All @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 0fab3ee

Please sign in to comment.