Skip to content
This repository
tree: 8f48fe873b
Fetching contributors…

Cannot retrieve contributors at this time

file 42 lines (33 sloc) 1.466 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
//
// TDReplicatorManager.h
// TouchDB
//
// Created by Jens Alfke on 2/15/12.
// Copyright (c) 2012 Couchbase, Inc. All rights reserved.
//

#import <TouchDB/TDDatabase.h>
@class TDDatabaseManager;
@protocol TDAuthorizer;


extern NSString* const kTDReplicatorDatabaseName;


/** Manages the _replicator database for persistent replications.
It doesn't really have an API; it works on its own by monitoring the '_replicator' database, and docs in it, for changes. Applications use the regular document APIs to manage replications.
A TDServer owns an instance of this class. */
@interface TDReplicatorManager : NSObject
{
    TDDatabaseManager* _dbManager;
    TDDatabase* _replicatorDB;
    NSMutableDictionary* _replicatorsByDocID;
    BOOL _updateInProgress;
}

- (id) initWithDatabaseManager: (TDDatabaseManager*)dbManager;

- (void) start;
- (void) stop;

/** Examines the JSON object describing a replication and determines the local database and remote URL, and some of the other parameters. */
- (TDStatus) parseReplicatorProperties: (NSDictionary*)body
                            toDatabase: (TDDatabase**)outDatabase
                                remote: (NSURL**)outRemote
                                isPush: (BOOL*)outIsPush
                          createTarget: (BOOL*)outCreateTarget
                               headers: (NSDictionary**)outHeaders
                            authorizer: (id<TDAuthorizer>*)outAuthorizer;

@end
Something went wrong with that request. Please try again.