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
Implements
Inherited Members
Namespace: Couchbase.Lite.Sync
Assembly: Couchbase.Lite.dll
Syntax
public sealed class Replicator : IDisposable
Constructors
| Improve this Doc View SourceReplicator(ReplicatorConfiguration)
Constructs a replicator based on the given Replicator
Declaration
public Replicator(ReplicatorConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
Replicator |
config | The configuration to use to create the replicator |
Properties
| Improve this Doc View SourceConfig
Gets the configuration that was used to create this Replicator
Declaration
public ReplicatorConfiguration Config { get; }
Property Value
Type | Description |
---|---|
Replicator |
Status
Gets the current status of the Replicator
Declaration
public ReplicatorStatus Status { get; set; }
Property Value
Type | Description |
---|---|
Replicator |
Methods
| Improve this Doc View SourceAddChangeListener(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. |
handler | The logic to run during the callback |
Returns
Type | Description |
---|---|
Listener |
A token to remove the handler later |
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.
Declaration
public ListenerToken AddChangeListener(TaskScheduler scheduler, EventHandler<ReplicatorStatusChangedEventArgs> handler)
Parameters
Type | Name | Description |
---|---|---|
System. |
scheduler | The System. |
System. |
handler | The logic to run during the callback |
Returns
Type | Description |
---|---|
Listener |
A token to remove the handler later |
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. |
handler | The logic to run during the callback |
Returns
Type | Description |
---|---|
Listener |
A token to remove the handler later |
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.
Declaration
public ListenerToken AddDocumentReplicationListener(TaskScheduler scheduler, EventHandler<DocumentReplicationEventArgs> handler)
Parameters
Type | Name | Description |
---|---|---|
System. |
scheduler | The System. |
System. |
handler | The logic to run during the callback |
Returns
Type | Description |
---|---|
Listener |
A token to remove the handler later |
Dispose()
Declaration
public void Dispose()
Finalize()
Finalizer
Declaration
protected void Finalize()
RemoveChangeListener(ListenerToken)
Removes a previously added change listener via its Listener
Declaration
public void RemoveChangeListener(ListenerToken token)
Parameters
Type | Name | Description |
---|---|---|
Listener |
token | The token received from AddChangeListener(TaskScheduler, EventHandler<ReplicatorStatusChangedEventArgs>) and/or The token received from AddDocumentReplicationListener(TaskScheduler, EventHandler<DocumentReplicationEventArgs>) |
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. |
Thrown if this method is called while the replicator is not in a stopped state |
Start()
Starts the replication
Declaration
public void Start()
Stop()
Stops the replication
Declaration
public void Stop()
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |