ReplicatorConfiguration

Configuration for a Replicator

actual class ReplicatorConfiguration : DelegatedClass<<Error class: unknown class>> (source)

Constructors

Link copied to clipboard
expect constructor(database: Database, target: Endpoint)

Create a Replicator Configuration

expect constructor(target: Endpoint)

Create a Replicator Configuration

expect constructor(config: ReplicatorConfiguration)

Create a Replicator Configuration

actual constructor(database: Database, target: Endpoint)
actual constructor(target: Endpoint)
actual constructor(config: ReplicatorConfiguration)
actual constructor(database: Database, target: Endpoint)
actual constructor(target: Endpoint)
actual constructor(config: ReplicatorConfiguration)

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion

Properties

Link copied to clipboard

The Authenticator used to authenticate the remote.

Link copied to clipboard
expect var channels: List<String>?

Gets the collection of Sync Gateway channel names from which to pull documents. If unset, all accessible channels will be pulled. Default is empty: pull from all accessible channels.

actual var channels: List<String>?
actual var channels: List<String>?
Link copied to clipboard

The list of collections in the replicator configuration

Link copied to clipboard

The conflict resolver.

Link copied to clipboard
expect val database: Database

The local database to replicate with the replication target.

actual val database: Database
actual val database: Database
Link copied to clipboard
expect var documentIDs: List<String>?

A collection of document IDs to filter: if not null, only documents with these IDs will be pushed and/or pulled.

actual var documentIDs: List<String>?
actual var documentIDs: List<String>?
Link copied to clipboard
expect var headers: Map<String, String>?

Return Extra HTTP headers to send in all requests to the remote target.

actual var headers: Map<String, String>?
actual var headers: Map<String, String>?
Link copied to clipboard
expect var heartbeat: Int

The heartbeat interval, in seconds.

actual var heartbeat: Int
actual var heartbeat: Int
Link copied to clipboard

The option to remove a restriction that does not allow a replicator to accept cookies from a remote host unless the cookie domain exactly matches the domain of the sender. For instance, when the option is set to false (the default), and the remote host, “bar.foo.com”, sends a cookie for the domain “.foo.com”, the replicator will reject it. If the option is set true, however, the replicator will accept it. This is, in general, dangerous: a host might, for instance, set a cookie for the domain ".com". It is safe only when the replicator is connecting only to known hosts. The default value of this option is false: parent-domain cookies are not accepted

Link copied to clipboard

Enable/disable auto-purge. Default is enabled.

Link copied to clipboard
expect var isContinuous: Boolean

The continuous flag indicating whether the replicator should stay active indefinitely to replicate changed documents.

actual var isContinuous: Boolean
actual var isContinuous: Boolean
Link copied to clipboard
expect var maxAttempts: Int

The max number of retry attempts made after connection failure. This method will return 0 when implicitly using the default: 10 total connection attempts (the initial attempt and up to 9 retries) for a one-shot replicator and a very, very large number of retries, for a continuous replicator.

actual var maxAttempts: Int
actual var maxAttempts: Int
Link copied to clipboard

The max time between retry attempts (exponential backoff).

Link copied to clipboard

The remote target's SSL certificate.

Link copied to clipboard

The remote target’s SSL certificate.

Link copied to clipboard
var ReplicatorConfiguration.pinnedServerX509Certificate: <Error class: unknown class>?

The remote target's SSL certificate.

Link copied to clipboard

The filter used to determine whether a document will be pulled from the remote endpoint.

Link copied to clipboard

The filter used to determine whether a document will be pushed to the remote endpoint.

Link copied to clipboard
expect val target: Endpoint

The replication target to replicate with.

actual val target: Endpoint
actual val target: Endpoint
Link copied to clipboard
expect var type: ReplicatorType

Replicator type indicating the direction of the replicator.

actual var type: ReplicatorType
actual var type: ReplicatorType

Functions

Link copied to clipboard

Add a collection used for the replication with an optional collection configuration. If the collection has been added before, the previously added collection and its configuration if specified will be replaced.

Link copied to clipboard

Add multiple collections used for the replication with an optional shared collection configuration. If any of the collections have been added before, the previously added collections and their configuration if specified will be replaced. Adding an empty collection array is a no-op.

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

Get the CollectionConfiguration for the passed Collection.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun ReplicatorConfiguration?.newConfig(target: Endpoint? = null, collections: Map<out Collection<Collection>, CollectionConfiguration?>? = null, type: ReplicatorType? = null, continuous: Boolean? = null, authenticator: Authenticator? = null, headers: Map<String, String>? = null, pinnedServerCertificate: ByteArray? = null, maxAttempts: Int? = null, maxAttemptWaitTime: Int? = null, heartbeat: Int? = null, enableAutoPurge: Boolean? = null, acceptParentDomainCookies: Boolean? = null): ReplicatorConfiguration

Create a ReplicatorConfiguration, overriding the receiver's values with the passed parameters.

fun ReplicatorConfiguration?.newConfig(target: Endpoint? = null, collections: Map<out Collection<Collection>, CollectionConfiguration?>? = null, type: ReplicatorType? = null, continuous: Boolean? = null, authenticator: Authenticator? = null, headers: Map<String, String>? = null, pinnedServerCertificate: ByteArray? = null, maxAttempts: Int? = null, maxAttemptWaitTime: Int? = null, heartbeat: Int? = null, enableAutoPurge: Boolean? = null, acceptOnlySelfSignedServerCertificate: Boolean? = null, acceptParentDomainCookies: Boolean? = null): ReplicatorConfiguration
fun ReplicatorConfiguration?.newConfig(database: Database? = null, target: Endpoint? = null, type: ReplicatorType? = null, continuous: Boolean? = null, authenticator: Authenticator? = null, headers: Map<String, String>? = null, pinnedServerCertificate: ByteArray? = null, channels: List<String>? = null, documentIDs: List<String>? = null, pushFilter: ReplicationFilter? = null, pullFilter: ReplicationFilter? = null, conflictResolver: ConflictResolver? = null, maxAttempts: Int? = null, maxAttemptWaitTime: Int? = null, heartbeat: Int? = null, enableAutoPurge: Boolean? = null, acceptParentDomainCookies: Boolean? = null): ReplicatorConfiguration
fun ReplicatorConfiguration?.newConfig(database: Database? = null, target: Endpoint? = null, type: ReplicatorType? = null, continuous: Boolean? = null, authenticator: Authenticator? = null, headers: Map<String, String>? = null, pinnedServerCertificate: ByteArray? = null, channels: List<String>? = null, documentIDs: List<String>? = null, pushFilter: ReplicationFilter? = null, pullFilter: ReplicationFilter? = null, conflictResolver: ConflictResolver? = null, maxAttempts: Int? = null, maxAttemptWaitTime: Int? = null, heartbeat: Int? = null, enableAutoPurge: Boolean? = null, acceptOnlySelfSignedServerCertificate: Boolean? = null, acceptParentDomainCookies: Boolean? = null): ReplicatorConfiguration

Create a ReplicatorConfiguration, overriding the receiver's values with the passed parameters:

Link copied to clipboard

Remove a collection from the replication.

Link copied to clipboard

The option to remove a restriction that does not allow a replicator to accept cookies from a remote host unless the cookie domain exactly matches the domain of the sender. For instance, when the option is set to false (the default), and the remote host, “bar.foo.com”, sends a cookie for the domain “.foo.com”, the replicator will reject it. If the option is set true, however, the replicator will accept it. This is, in general, dangerous: a host might, for instance, set a cookie for the domain ".com". It is safe only when the replicator is connecting only to known hosts. The default value of this option is false: parent-domain cookies are not accepted

Link copied to clipboard

Sets the authenticator to authenticate with a remote target server. Currently, there are two types of the authenticators, BasicAuthenticator and SessionAuthenticator, supported. The default is no authenticator.

Link copied to clipboard

Enable/disable auto-purge. The default is auto-purge enabled.

Link copied to clipboard

Sets a collection of Sync Gateway channel names from which to pull Documents. If unset, all accessible channels will be pulled. Default is empty: pull from all accessible channels.

Link copied to clipboard

Sets the conflict resolver. Default is ReplicatorConfiguration.DEFAULT_CONFLICT_RESOLVER

Link copied to clipboard

Sets whether the replicator stays active indefinitely to replicate changed documents. The default is false: the replicator will stop after it finishes replicating changed documents.

Link copied to clipboard

A collection of document IDs identifying documents to be replicated. If non-empty, only documents with IDs in this collection will be pushed and/or pulled. Default is empty: do not filter documents.

Link copied to clipboard

Sets the extra HTTP headers to send in all requests to the remote target. The default is no extra headers.

Link copied to clipboard
expect fun setHeartbeat(heartbeat: Int): ReplicatorConfiguration

Set the heartbeat interval, in seconds. The default is 5 minutes (300 seconds). Setting the parameter to 0 will restore the default.

actual fun setHeartbeat(heartbeat: Int): ReplicatorConfiguration
actual fun setHeartbeat(heartbeat: Int): ReplicatorConfiguration
Link copied to clipboard
expect fun setMaxAttempts(maxAttempts: Int): ReplicatorConfiguration

Set the max number of retry attempts made after a connection failure. Set to 1 for no retries and to 0 to restore default behavior. The default is 10 total connection attempts (the initial attempt and up to 9 retries) for a one-shot replicator and a very, very large number of retries, for a continuous replicator.

actual fun setMaxAttempts(maxAttempts: Int): ReplicatorConfiguration
actual fun setMaxAttempts(maxAttempts: Int): ReplicatorConfiguration
Link copied to clipboard
expect fun setMaxAttemptWaitTime(maxAttemptWaitTime: Int): ReplicatorConfiguration

Set the max time between retry attempts, in seconds. Time between retries is initially small but backs off exponentially up to this limit. Once the limit is reached the interval between subsequent attempts will be the value set here, until max-attempts attempts have been made. The minimum value legal value is 1 second. The default is 5 minutes (300 seconds). Setting the parameter to 0 will restore the default.

actual fun setMaxAttemptWaitTime(maxAttemptWaitTime: Int): ReplicatorConfiguration
actual fun setMaxAttemptWaitTime(maxAttemptWaitTime: Int): ReplicatorConfiguration
Link copied to clipboard

Sets the certificate used to authenticate the target server. A server will be authenticated if it presents a chain of certificates (possibly of length 1) in which any one of the certificates matches the one passed here. The default is no pinned certificate.

Link copied to clipboard

Sets the certificate used to authenticate the target server. A server will be authenticated if it presents a chain of certificates (possibly of length 1) in which any one of the certificates matches the one passed here. The default is no pinned certificate.

Link copied to clipboard

Sets the certificate used to authenticate the target server. A server will be authenticated if it presents a chain of certificates (possibly of length 1) in which any one of the certificates matches the one passed here. The default is no pinned certificate.

Link copied to clipboard

Sets a filter object for validating whether the documents can be pulled from the remote endpoint. Only documents for which the object returns true are replicated. Default is no filter.

Link copied to clipboard

Sets a filter object for validating whether the documents can be pushed to the remote endpoint. Default is no filter.

Link copied to clipboard

Sets the replicator type indicating the direction of the replicator. The default is ReplicatorType.PUSH_AND_PULL: bi-directional replication.

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