CBLReplicatorConfiguration

@interface CBLReplicatorConfiguration : NSObject

Replicator Configuration

  • The local database to replicate with the target endpoint.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CBLDatabase *_Nonnull database;
  • The replication endpoint to replicate with.

    Declaration

    Objective-C

    @property (nonatomic, readonly) id<CBLEndpoint> _Nonnull target;
  • Replication type indicating the direction of the replication. The default value is .pushAndPull which is bidrectional.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        CBLReplicatorType replicatorType;
  • Should the replicator stay active indefinitely, and push/pull changed documents?. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL continuous;
  • An Authenticator to authenticate with a remote server. Currently there are two types of the authenticators, CBLBasicAuthenticator and CBLSessionAuthenticator, supported.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, 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.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        SecCertificateRef pinnedServerCertificate;
  • Extra HTTP headers to send in all requests to the remote target.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, 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.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, 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.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        NSArray<NSString *> *documentIDs;
  • Filter block for validating whether the documents can be pushed to the remote endpoint. Only documents for which the block returns true are replicated.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        CBLReplicationFilter pushFilter;
  • Filter block for validating whether the documents can be pulled from the remote endpoint. Only documents for which the block returns true are replicated.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        CBLReplicationFilter pullFilter;
  • The custom conflict resolver object can be set here. If this value is not set, or set to nil, the default conflict resolver will be applied.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        id<CBLConflictResolver>
            conflictResolver;
  • The heartbeat interval in second.

    The interval when the replicator sends the ping message to check whether the other peer is still alive. Set the value to zero(by default) means using the default heartbeat of 300 seconds.

    Note: Setting the heartbeat to negative value will result in InvalidArgumentException being thrown.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSTimeInterval heartbeat;
  • The maximum attempts to perform retry. The retry attempt will be reset when the replicator is able to connect and replicate with the remote server again.

    Setting the maxAttempts to zero(by default), the default maxAttempts of 10 times for single shot replicators and max-int times for continuous replicators will be applied and present to users. Settings the value to 1, will perform an initial request and if there is a transient error occurs, will stop will retrying.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSUInteger maxAttempts;
  • Max wait time for the next attempt(retry).

    The exponential backoff for calculating the wait time will be used by default and cannot be customized. Set the value to zero(by default) means using the default max attempts of 300 seconds.

    Set the maxAttemptWaitTime to negative value will result in InvalidArgumentException being thrown.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSTimeInterval maxAttemptWaitTime;
  • To enable/disable the auto purge feature

    The default value is true which means that the document will be automatically purged by the pull replicator when the user loses access to the document from both removed and revoked scenarios.

    When the property is set to false, this behavior is disabled and an access removed event will be sent to any document listeners that are active on the replicator. For performance reasons, the document listeners must be added before the replicator is started or they will not receive the events.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) BOOL enableAutoPurge;
  • 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;

    Parameters

    config

    The configuration.

    Return Value

    The CBLReplicatorConfiguration object.

  • ENTERPRISE EDITION ONLY.

    Specify the replicator to accept any and only self-signed certs. Any non-self-signed certs will be rejected to avoid accidentally using this mode with the non-self-signed certs in production.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        BOOL acceptOnlySelfSignedServerCertificate;