Class ReplicatorConfiguration
A class representing configuration options for a Replicator
Inheritance
Namespace: Couchbase.Lite.Sync
Assembly: Couchbase.Lite.dll
Syntax
public sealed class ReplicatorConfiguration : object
Constructors
| Improve this Doc View SourceReplicatorConfiguration(Database, IEndpoint)
Constructs a new builder object with the required properties
Declaration
public ReplicatorConfiguration(Database database, IEndpoint target)
Parameters
Type | Name | Description |
---|---|---|
Database | database | The database that will serve as the local side of the replication |
IEndpoint | target | The endpoint to replicate to, either local or remote |
Properties
| Improve this Doc View SourceAcceptOnlySelfSignedServerCertificate
Get or set the way that the replicator will validate TLS certificates. This property will be overriden if the PinnedServerCertificate property is set.
Declaration
public bool AcceptOnlySelfSignedServerCertificate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AcceptParentDomainCookies
Gets or sets whether or not a cookie can be set on a parent domain of the host that issued it (i.e. foo.bar.com can set a cookie for all of bar.com). This is only recommended if the host issuing the cookie is well trusted.
Declaration
public bool AcceptParentDomainCookies { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Authenticator
Gets or sets the class which will authenticate the replication
Declaration
public Authenticator Authenticator { get; set; }
Property Value
Type | Description |
---|---|
Authenticator |
Channels
A set of Sync Gateway channel names to pull from. Ignored for push replicatoin. The default value is null, meaning that all accessible channels will be pulled. Note: channels that are not accessible to the user will be ignored by Sync Gateway.
Declaration
public IList<string> Channels { get; set; }
Property Value
Type | Description |
---|---|
IList<System.String> |
ConflictResolver
The implemented custom conflict resolver object can be registered to the replicator at ConflictResolver property. The default value of the conflictResolver is null. When the value is null, the default conflict resolution will be applied.
Declaration
public IConflictResolver ConflictResolver { get; set; }
Property Value
Type | Description |
---|---|
IConflictResolver |
Continuous
Gets or sets whether or not the Replicator should stay
active indefinitely. The default is false
Declaration
public bool Continuous { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Database
Gets the local database participating in the replication.
Declaration
public Database Database { get; }
Property Value
Type | Description |
---|---|
Database |
DocumentIDs
A set of document IDs to filter by. If not null, only documents with these IDs will be pushed and/or pulled
Declaration
public IList<string> DocumentIDs { get; set; }
Property Value
Type | Description |
---|---|
IList<System.String> |
EnableAutoPurge
Gets or sets the value 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. - If set the property to
false
, AutoPurge is disabled, the replicator will notify the registered DocumentReplicationListener AddDocumentReplicationListener(EventHandler<DocumentReplicationEventArgs>) with an "access removed" event AccessRemoved when access to the document is revoked on the Sync Gateway. On receiving the event, the application may decide to manually purge the document. However, for performance reasons, any DocumentReplicationListeners added AddDocumentReplicationListener(EventHandler<DocumentReplicationEventArgs>) to the replicator after the replicator is started will not receive the access removed events until the replicator is restarted or reconnected with Sync Gateway.
Declaration
public bool EnableAutoPurge { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Headers
Extra HTTP headers to send in all requests to the remote target
Declaration
public IDictionary<string, string> Headers { get; set; }
Property Value
Type | Description |
---|---|
IDictionary<System.String, System.String> |
Heartbeat
Gets or sets the replicator heartbeat keep-alive interval. The default is null (5 min interval is applied).
5
min interval is applied when Heartbeat is set to null.- null will be returned when default
5
min interval is applied.
Declaration
public TimeSpan? Heartbeat { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<TimeSpan> |
MaxAttempts
Gets or sets the Max number of retry attempts. The retry attempts will reset
after the replicator is connected to a remote peer.
The default is 0
(10
for a single shot replicator or
10
for a single shot replicator orfor a continuous replicator is applied when user set MaxAttempts to 0. - 0 will be returned when default
10
for a single shot replicator orfor a continuous replicator is applied. - Setting the value to 1 means that the replicator will try connect once and the replicator will stop if there is a transient error.
Declaration
public int MaxAttempts { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxAttemptsWaitTime
Gets or sets the Max delay between retries. The default is null (5 min interval is applied).
5
min interval is applied when MaxAttemptsWaitTime is set to null.- null will be returned when default
5
min interval is applied.
Declaration
public TimeSpan? MaxAttemptsWaitTime { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<TimeSpan> |
PinnedServerCertificate
Gets or sets a certificate to trust. All other certificates received by a Replicator with this configuration will be rejected.
Declaration
public X509Certificate2 PinnedServerCertificate { get; set; }
Property Value
Type | Description |
---|---|
X509Certificate2 |
PullFilter
Func delegate that takes Document input parameter and bool output parameter Document pull will be allowed if output is true, othewise, Document pull will not be allowed
Declaration
public Func<Document, DocumentFlags, bool> PullFilter { get; set; }
Property Value
Type | Description |
---|---|
Func<Document, DocumentFlags, System.Boolean> |
PushFilter
Func delegate that takes Document input parameter and bool output parameter Document push will be allowed if output is true, othewise, Document push will not be allowed
Declaration
public Func<Document, DocumentFlags, bool> PushFilter { get; set; }
Property Value
Type | Description |
---|---|
Func<Document, DocumentFlags, System.Boolean> |
ReplicatorType
A value indicating the direction of the replication. The default is PushAndPull which is bidirectional
Declaration
public ReplicatorType ReplicatorType { get; set; }
Property Value
Type | Description |
---|---|
ReplicatorType |
Target
Gets the target to replicate with (either Database
or
Declaration
public IEndpoint Target { get; }
Property Value
Type | Description |
---|---|
IEndpoint |