CBLReplicatorConfiguration

@interface CBLReplicatorConfiguration : NSObject

Replicator Configuration

  • The replication endpoint to replicate with.

    Declaration

    Objective-C

    @property (nonatomic, readonly) id<CBLEndpoint> _Nonnull target;
  • The collection configurations used for the replication. Each configuration specifies a collection and its configuration.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<CBLCollectionConfiguration *> *_Nonnull collections;
  • Replication type indicating the direction of the replication. The default value is .pushAndPull which is bidrectional.

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    @property (nonatomic) 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, nullable) CBLAuthenticator *authenticator;
  • The remote target’s SSL certificate.

    @Note: The pinned cert will be evaluated against any certs in a cert chain, and the cert chain will be valid only if the cert chain contains the pinned cert.

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSDictionary<NSString *, NSString *> *headers;
  • Specific network interface (e.g. en0 and pdp_ip0) for connecting to the remote target.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *networkInterface;
  • The option to remove the restriction that does not allow the replicator to save the parent-domain cookies, the cookies whose domains are the parent domain of the remote host, from the HTTP response. For example, when the option is set to true, the cookies whose domain are “.foo.com” returned by “bar.foo.com” host will be permitted to save.

    This option is disabled by default (See kCBLDefaultReplicatorAcceptParentCookies) which means that the parent-domain cookies are not permitted to save by default.

    Declaration

    Objective-C

    @property (nonatomic) BOOL acceptParentDomainCookies;
  • The heartbeat interval in second.

    The interval when the replicator sends the ping message to check whether the other peer is still alive. Default heartbeat is kCBLDefaultReplicatorHeartbeat seconds.

    @Note: Setting the heartbeat to negative value will result in InvalidArgumentException being thrown. For backward compatibility, setting to zero will result in default heartbeat internally.

    Declaration

    Objective-C

    @property (nonatomic) 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.

    Default maxAttempts is kCBLDefaultReplicatorMaxAttemptsSingleShot times for single shot replicators and kCBLDefaultReplicatorMaxAttemptsContinuous times for continuous replicators.

    Settings the value to 1, will perform an initial request and if there is a transient error occurs, will stop without retry.

    @Note: For backward compatibility, setting it to zero will result in default maxAttempt internally.

    Declaration

    Objective-C

    @property (nonatomic) 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. Default max attempts is kCBLDefaultReplicatorMaxAttemptsWaitTime seconds.

    @Note: Set the maxAttemptWaitTime to negative value will result in InvalidArgumentException being thrown. For backward compatibility, setting it to zero will result in default maxAttemptWaitTime internally.

    Declaration

    Objective-C

    @property (nonatomic) 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.

    @Note: Auto purge will not be performed when documentIDs filter is specified.

    Declaration

    Objective-C

    @property (nonatomic) BOOL enableAutoPurge;
  • Unavailable

    Not available

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Initializes a CBLReplicatorConfiguration with the specified collection configurations and target’s endpoint.

    Each CBLCollectionConfiguration in the collections array must be initialized using -initWithCollection:.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCollections:
                                (nonnull NSArray<CBLCollectionConfiguration *> *)
                                    collections
                                         target:(nonnull id<CBLEndpoint>)target;

    Parameters

    collections

    An array of collection configurations to replicate.

    target

    The target endpoint.

  • 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.

ServerCert