Show / Hide Table of Contents

Class Replicator

An object that is responsible for the replication of data between two endpoints. The replication can set up to be pull only, push only, or both (i.e. pusher and puller are no longer separate) between a database and a URL or a database and another database on the same filesystem.

Inheritance
System.Object
Replicator
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Couchbase.Lite.Sync
Assembly: Couchbase.Lite.dll
Syntax
public sealed class Replicator : IDisposable

Constructors

| Improve this Doc View Source

Replicator(ReplicatorConfiguration)

Constructs a replicator based on the given ReplicatorConfiguration

Declaration
public Replicator(ReplicatorConfiguration config)
Parameters
Type Name Description
ReplicatorConfiguration config

The configuration to use to create the replicator

Properties

| Improve this Doc View Source

Config

Gets the configuration that was used to create this Replicator

Declaration
public ReplicatorConfiguration Config { get; }
Property Value
Type Description
ReplicatorConfiguration
| Improve this Doc View Source

Status

Gets the current status of the Replicator

Declaration
public ReplicatorStatus Status { get; set; }
Property Value
Type Description
ReplicatorStatus

Methods

| Improve this Doc View Source

AddChangeListener(EventHandler<ReplicatorStatusChangedEventArgs>)

Adds a change listener on this replication object (similar to a C# event)

Declaration
public ListenerToken AddChangeListener(EventHandler<ReplicatorStatusChangedEventArgs> handler)
Parameters
Type Name Description
System.EventHandler<ReplicatorStatusChangedEventArgs> handler

The logic to run during the callback

Returns
Type Description
ListenerToken

A token to remove the handler later

| Improve this Doc View Source

AddChangeListener(TaskScheduler, EventHandler<ReplicatorStatusChangedEventArgs>)

Adds a change listener on this replication object (similar to a C# event, but with the ability to specify a System.Threading.Tasks.TaskScheduler to schedule the handler to run on)

Declaration
public ListenerToken AddChangeListener(TaskScheduler scheduler, EventHandler<ReplicatorStatusChangedEventArgs> handler)
Parameters
Type Name Description
System.Threading.Tasks.TaskScheduler scheduler

The System.Threading.Tasks.TaskScheduler to run the handler on (null for default)

System.EventHandler<ReplicatorStatusChangedEventArgs> handler

The logic to run during the callback

Returns
Type Description
ListenerToken

A token to remove the handler later

| Improve this Doc View Source

AddDocumentReplicationListener(EventHandler<DocumentReplicationEventArgs>)

Adds a documents ended listener on this replication object (similar to a C# event)

Declaration
public ListenerToken AddDocumentReplicationListener(EventHandler<DocumentReplicationEventArgs> handler)
Parameters
Type Name Description
System.EventHandler<DocumentReplicationEventArgs> handler

The logic to run during the callback

Returns
Type Description
ListenerToken

A token to remove the handler later

| Improve this Doc View Source

AddDocumentReplicationListener(TaskScheduler, EventHandler<DocumentReplicationEventArgs>)

Adds a document ended listener on this replication object (similar to a C# event, but with the ability to specify a System.Threading.Tasks.TaskScheduler to schedule the handler to run on)

Declaration
public ListenerToken AddDocumentReplicationListener(TaskScheduler scheduler, EventHandler<DocumentReplicationEventArgs> handler)
Parameters
Type Name Description
System.Threading.Tasks.TaskScheduler scheduler

The System.Threading.Tasks.TaskScheduler to run the handler on (null for default)

System.EventHandler<DocumentReplicationEventArgs> handler

The logic to run during the callback

Returns
Type Description
ListenerToken

A token to remove the handler later

| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

Finalize()

Finalizer

Declaration
protected void Finalize()
| Improve this Doc View Source

RemoveChangeListener(ListenerToken)

Removes a previously added change listener via its ListenerToken and/or Removes a previously added documents ended listener via its ListenerToken

Declaration
public void RemoveChangeListener(ListenerToken token)
Parameters
Type Name Description
ListenerToken token

The token received from AddChangeListener(TaskScheduler, EventHandler<ReplicatorStatusChangedEventArgs>) and/or The token received from AddDocumentReplicationListener(TaskScheduler, EventHandler<DocumentReplicationEventArgs>)

| Improve this Doc View Source

ResetCheckpoint()

Resets the local checkpoint of the replicator, meaning that it will read all changes since the beginning of time from the remote database. This can only be called when the replicator is in a stopped state.

Declaration
public void ResetCheckpoint()
Exceptions
Type Condition
System.InvalidOperationException

Thrown if this method is called while the replicator is not in a stopped state

| Improve this Doc View Source

Start()

Starts the replication

Declaration
public void Start()
| Improve this Doc View Source

Stop()

Stops the replication

Declaration
public void Stop()
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX