Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
cbl::ReplicatorConfiguration Class Reference

The configuration of a replicator. More...

#include <cbl++/Replicator.hh>

Public Member Functions

 ReplicatorConfiguration (std::vector< CollectionConfiguration >collections, Endpoint endpoint)
 Creates a config with a list of collections and per-collection configurations to replicate and an endpoint.
std::vector< CollectionConfigurationcollections () const
 Returns the configured collections.
Endpoint endpoint () const
 Returns the configured endpoint.

Public Attributes

CBLReplicatorType replicatorType = kCBLReplicatorTypePushAndPull
 Replicator type : Push, pull or both.
bool continuous = false
 Continuous replication or single-shot replication.
bool enableAutoPurge = true
 Enabled auto-purge or not.
unsigned maxAttempts = 0
 Max retry attempts where the initial connect to replicate counts toward the given value.
unsigned maxAttemptWaitTime = 0
 Max wait time between retry attempts in seconds.
unsigned heartbeat = 0
 The heartbeat interval in seconds.
Authenticator authenticator
 Authentication credentials, if needed.
CBLProxySettings *_Nullable proxy = nullptr
 HTTP client proxy settings.
fleece::MutableDict headers = fleece::MutableDict::newDict()
 Extra HTTP headers to add to the WebSocket request.
bool acceptParentDomainCookies = kCBLDefaultReplicatorAcceptParentCookies
 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.
std::string pinnedServerCertificate
 An X.509 cert (PEM or DER) to "pin" for TLS connections.
std::string trustedRootCertificates
 Set of anchor certs (PEM format).
bool acceptOnlySelfSignedServerCertificate = false
 Accept only self-signed server certificates; any other certificates are rejected.
PropertyEncryptor documentPropertyEncryptor
 Optional callback to encrypt encryptable properties during push replication.
PropertyDecryptor documentPropertyDecryptor
 Optional callback to decrypt encrypted properties during pull replication.

Protected Member Functions

 operator CBLReplicatorConfiguration () const
 Base config without collections set.

Friends

class Replicator

Detailed Description

The configuration of a replicator.

Constructor & Destructor Documentation

◆ ReplicatorConfiguration()

cbl::ReplicatorConfiguration::ReplicatorConfiguration ( std::vector< CollectionConfiguration > collections,
Endpoint endpoint )
inline

Creates a config with a list of collections and per-collection configurations to replicate and an endpoint.

Parameters
collectionsThe collections and per-collection configurations.
endpointThe endpoint to replicate with.

Member Function Documentation

◆ collections()

std::vector< CollectionConfiguration > cbl::ReplicatorConfiguration::collections ( ) const
inline

Returns the configured collections.

◆ endpoint()

Endpoint cbl::ReplicatorConfiguration::endpoint ( ) const
inline

Returns the configured endpoint.

◆ operator CBLReplicatorConfiguration()

cbl::ReplicatorConfiguration::operator CBLReplicatorConfiguration ( ) const
inlineprotected

Base config without collections set.

◆ Replicator

friend class Replicator
friend

Member Data Documentation

◆ acceptOnlySelfSignedServerCertificate

bool cbl::ReplicatorConfiguration::acceptOnlySelfSignedServerCertificate = false

Accept only self-signed server certificates; any other certificates are rejected.

(Enterprise Edition only.)

◆ acceptParentDomainCookies

bool cbl::ReplicatorConfiguration::acceptParentDomainCookies = kCBLDefaultReplicatorAcceptParentCookies

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 is only recommended if the host issuing the cookie is well trusted.

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

◆ authenticator

Authenticator cbl::ReplicatorConfiguration::authenticator

Authentication credentials, if needed.

◆ continuous

bool cbl::ReplicatorConfiguration::continuous = false

Continuous replication or single-shot replication.

◆ documentPropertyDecryptor

PropertyDecryptor cbl::ReplicatorConfiguration::documentPropertyDecryptor

Optional callback to decrypt encrypted properties during pull replication.

◆ documentPropertyEncryptor

PropertyEncryptor cbl::ReplicatorConfiguration::documentPropertyEncryptor

Optional callback to encrypt encryptable properties during push replication.

◆ enableAutoPurge

bool cbl::ReplicatorConfiguration::enableAutoPurge = true

Enabled auto-purge or not.

If auto purge is enabled, then the replicator will automatically purge any documents that the replicating user loses access to via the Sync Function on Sync Gateway.

◆ headers

fleece::MutableDict cbl::ReplicatorConfiguration::headers = fleece::MutableDict::newDict()

Extra HTTP headers to add to the WebSocket request.

◆ heartbeat

unsigned cbl::ReplicatorConfiguration::heartbeat = 0

The heartbeat interval in seconds.

Specify 0 to use the default value of 300 seconds.

◆ maxAttempts

unsigned cbl::ReplicatorConfiguration::maxAttempts = 0

Max retry attempts where the initial connect to replicate counts toward the given value.

Specify 0 to use the default value, 10 times for a non-continuous replicator and max-int time for a continuous replicator. Specify 1 means there will be no retry after the first attempt.

◆ maxAttemptWaitTime

unsigned cbl::ReplicatorConfiguration::maxAttemptWaitTime = 0

Max wait time between retry attempts in seconds.

Specify 0 to use the default value of 300 seconds.

◆ pinnedServerCertificate

std::string cbl::ReplicatorConfiguration::pinnedServerCertificate

An X.509 cert (PEM or DER) to "pin" for TLS connections.

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.

◆ proxy

CBLProxySettings* _Nullable cbl::ReplicatorConfiguration::proxy = nullptr

HTTP client proxy settings.

◆ replicatorType

CBLReplicatorType cbl::ReplicatorConfiguration::replicatorType = kCBLReplicatorTypePushAndPull

Replicator type : Push, pull or both.

◆ trustedRootCertificates

std::string cbl::ReplicatorConfiguration::trustedRootCertificates

Set of anchor certs (PEM format).


The documentation for this class was generated from the following file: