CBLReplicatorConfiguration
@interface CBLReplicatorConfiguration: NSObject
/** The local database to replicate with the target endpoint. */
@property (nonatomic, readonly) CBLDatabase* database;
/**
The replication endpoint to replicate with.
*/
@property (nonatomic, readonly) id<CBLEndpoint> target;
/**
Replication type indicating the direction of the replication. The default value is
.pushAndPull which is bidrectional.
*/
@property (nonatomic) CBLReplicatorType replicatorType;
/**
Should the replicator stay active indefinitely, and push/pull changed documents?. The
default value is NO.
*/
@property (nonatomic) BOOL continuous;
/**
An Authenticator to authenticate with a remote server. Currently there are two types of
the authenticators, CBLBasicAuthenticator and CBLSessionAuthenticator, supported.
*/
@property (nonatomic, nullable) CBLAuthenticator* authenticator;
/**
If this property is non-null, the server is required to have this exact SSL/TLS certificate,
or the connection will fail.
*/
@property (nonatomic, nullable) SecCertificateRef pinnedServerCertificate;
/**
Extra HTTP headers to send in all requests to the remote target.
*/
@property (nonatomic, nullable) NSDictionary<NSString*, NSString*>* headers;
/**
A set of Sync Gateway channel names to pull from. Ignored for push replication.
The default value is nil, meaning that all accessible channels will be pulled.
Note: channels that are not accessible to the user will be ignored by Sync Gateway.
*/
@property (nonatomic, nullable) NSArray<NSString*>* channels;
/**
A set of document IDs to filter by: if not nil, only documents with these IDs will be pushed
and/or pulled.
*/
@property (nonatomic, nullable) NSArray<NSString*>* documentIDs;
#if TARGET_OS_IPHONE
/**
Allows the replicator to continue replicating in the background. The default
value is NO, which means that the replicator will suspend itself when the
replicator detects that the application is being backgrounded.
If setting the value to YES, please ensure that your application delegate
requests background time from the OS until the replication finishes.
*/
@property (nonatomic) BOOL allowReplicatingInBackground;
#endif
/** Not available */
- (instancetype) init NS_UNAVAILABLE;
/**
Initializes a CBLReplicatorConfiguration with the local database and
the target endpoint.
@param database The database.
@param target The target endpoint.
@return The CBLReplicatorConfiguration object.
*/
- (instancetype) initWithDatabase: (CBLDatabase*)database
target: (id <CBLEndpoint>)target;
/**
Initializes a CBLReplicatorConfiguration with the configuration object.
@param config The configuration.
@return The CBLReplicatorConfiguration object.
*/
- (instancetype) initWithConfig: (CBLReplicatorConfiguration*)config;
@end
Undocumented
-
The local database to replicate with the target endpoint.
Declaration
Objective-C
@property (readonly, nonatomic) CBLDatabase *_Nonnull database;
Swift
var database: CBLDatabase { get }
-
The replication endpoint to replicate with.
Declaration
Objective-C
@property (readonly, nonatomic) id<CBLEndpoint> _Nonnull target;
-
Replication type indicating the direction of the replication. The default value is .pushAndPull which is bidrectional.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CBLReplicatorType replicatorType;
Swift
var replicatorType: CBLReplicatorType { get set }
-
Should the replicator stay active indefinitely, and push/pull changed documents?. The default value is NO.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL continuous;
Swift
var continuous: Bool { get set }
-
An Authenticator to authenticate with a remote server. Currently there are two types of the authenticators, CBLBasicAuthenticator and CBLSessionAuthenticator, supported.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) CBLAuthenticator *authenticator;
Swift
var authenticator: CBLAuthenticator? { get set }
-
If this property is non-null, the server is required to have this exact SSL/TLS certificate, or the connection will fail.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) SecCertificateRef pinnedServerCertificate;
Swift
var pinnedServerCertificate: SecCertificate? { get set }
-
Extra HTTP headers to send in all requests to the remote target.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) NSDictionary<NSString *, NSString *> *headers;
Swift
var headers: [String : String]? { get set }
-
A set of Sync Gateway channel names to pull from. Ignored for push replication. The default value is nil, meaning that all accessible channels will be pulled. Note: channels that are not accessible to the user will be ignored by Sync Gateway.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) NSArray<NSString *> *channels;
Swift
var channels: [String]? { get set }
-
A set of document IDs to filter by: if not nil, only documents with these IDs will be pushed and/or pulled.
Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) NSArray<NSString *> *documentIDs;
Swift
var documentIDs: [String]? { get set }
-
Not available
Declaration
Objective-C
- (nonnull instancetype)init;
-
Initializes a CBLReplicatorConfiguration with the local database and the target endpoint.
Declaration
Objective-C
- (nonnull instancetype)initWithDatabase:(nonnull CBLDatabase *)database target:(nonnull id<CBLEndpoint>)target;
Parameters
database
The database.
target
The target endpoint.
Return Value
The CBLReplicatorConfiguration object.
-
Initializes a CBLReplicatorConfiguration with the configuration object.
Declaration
Objective-C
- (nonnull instancetype)initWithConfig: (nonnull CBLReplicatorConfiguration *)config;
Swift
init(config: CBLReplicatorConfiguration)
Parameters
config
The configuration.
Return Value
The CBLReplicatorConfiguration object.