Replicator

A replicator for replicating document changes between a local database and a target database. The replicator can be bidirectional or either push or pull. The replicator can also be one-shot or continuous. The replicator runs asynchronously, so observe the status to be notified of progress.

actual class Replicator(config: ReplicatorConfiguration) : DelegatedClass<<Error class: unknown class>> , AutoCloseable(source)

Constructors

Link copied to clipboard
expect constructor(config: ReplicatorConfiguration)
actual constructor(config: ReplicatorConfiguration)
actual constructor(config: ReplicatorConfiguration)

Properties

Link copied to clipboard

The replicator's configuration.

Link copied to clipboard

The server certificates received from the server during the TLS handshake.

Link copied to clipboard

The replicator's current status: its activity level and progress. Observable.

Functions

Link copied to clipboard

Adds a change listener for the changes in the replication status and progress.

Adds a change listener for the changes in the replication status and progress with a CoroutineContext that will be used to launch coroutines the listener will be called on. Coroutines will be launched in a CoroutineScope that is canceled when the listener is removed.

Adds a change listener for the changes in the replication status and progress with a CoroutineScope that will be used to launch coroutines the listener will be called on. The listener is removed when the scope is canceled.

Link copied to clipboard

Adds a document replication event listener.

Adds a document replication event listener with a CoroutineContext that will be used to launch coroutines the listener will be called on. Coroutines will be launched in a CoroutineScope that is canceled when the listener is removed.

Adds a document replication event listener with a CoroutineScope that will be used to launch coroutines the listener will be called on. The listener is removed when the scope is canceled.

Link copied to clipboard
expect open override fun close()
actual open override fun close()
actual open override fun close()
Link copied to clipboard

A Flow of document replications.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Get a best effort list of documents still pending replication.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
expect fun isDocumentPending(docId: String): Boolean

Best effort check to see if the document whose ID is passed is still pending replication.

actual fun isDocumentPending(docId: String): Boolean
actual fun isDocumentPending(docId: String): Boolean
Link copied to clipboard

Remove the given ReplicatorChangeListener or DocumentReplicationListener from the replicator.

Link copied to clipboard

A Flow of replicator state changes.

Link copied to clipboard
expect fun start()

Start the replicator.

expect fun start(resetCheckpoint: Boolean)

Start the replicator. This method does not wait for the replicator to start. The replicator runs asynchronously and reports its progress through replicator change notifications.

actual fun start()
actual fun start(resetCheckpoint: Boolean)
actual fun start()
actual fun start(resetCheckpoint: Boolean)
Link copied to clipboard
expect fun stop()

Stop a running replicator. This method does not wait for the replicator to stop. When it does actually stop it will a new state, STOPPED, to change listeners.

actual fun stop()
actual fun stop()
Link copied to clipboard
open override fun toString(): String