public final class ReplicatorConfiguration extends Object
Modifier and Type | Class and Description |
---|---|
static class |
com.couchbase.lite.AbstractReplicatorConfiguration.ReplicatorType
Replicator type
PUSH_AND_PULL: Bidirectional; both push and pull
PUSH: Pushing changes to the target
PULL: Pulling changes from the target
|
Constructor and Description |
---|
ReplicatorConfiguration(Database database,
Endpoint target) |
ReplicatorConfiguration(ReplicatorConfiguration config) |
Modifier and Type | Method and Description |
---|---|
Authenticator |
getAuthenticator()
Return the Authenticator to authenticate with a remote target.
|
List<String> |
getChannels()
A set of Sync Gateway channel names to pull from.
|
ConflictResolver |
getConflictResolver()
Return the conflict resolver.
|
Database |
getDatabase()
Return the local database to replicate with the replication target.
|
List<String> |
getDocumentIDs()
A set of document IDs to filter by: if not nil, only documents with these IDs will be pushed
and/or pulled.
|
Map<String,String> |
getHeaders()
Return Extra HTTP headers to send in all requests to the remote target.
|
byte[] |
getPinnedServerCertificate()
Return the remote target's SSL certificate.
|
ReplicationFilter |
getPullFilter()
Gets a filter object for validating whether the documents can be pulled
from the remote endpoint.
|
ReplicationFilter |
getPushFilter()
Gets a filter object for validating whether the documents can be pushed
to the remote endpoint.
|
com.couchbase.lite.AbstractReplicatorConfiguration.ReplicatorType |
getReplicatorType()
Return Replicator type indicating the direction of the replicator.
|
Endpoint |
getTarget()
Return the replication target to replicate with.
|
boolean |
isContinuous()
Return the continuous flag indicating whether the replicator should stay
active indefinitely to replicate changed documents.
|
ReplicatorConfiguration |
setAuthenticator(Authenticator authenticator)
Sets the authenticator to authenticate with a remote target server.
|
ReplicatorConfiguration |
setChannels(List<String> channels)
Sets a set of Sync Gateway channel names to pull from.
|
ReplicatorConfiguration |
setConflictResolver(ConflictResolver conflictResolver)
Sets the the conflict resolver.
|
ReplicatorConfiguration |
setContinuous(boolean continuous)
Sets whether the replicator stays active indefinitely to replicate
changed documents.
|
ReplicatorConfiguration |
setDocumentIDs(List<String> documentIDs)
Sets a set of document IDs to filter by: if given, only documents
with these IDs will be pushed and/or pulled.
|
ReplicatorConfiguration |
setHeaders(Map<String,String> headers)
Sets the extra HTTP headers to send in all requests to the remote target.
|
ReplicatorConfiguration |
setPinnedServerCertificate(byte[] pinnedServerCertificate)
Sets the target server's SSL certificate.
|
ReplicatorConfiguration |
setPullFilter(ReplicationFilter pullFilter)
Sets a filter object for validating whether the documents can be pulled from the
remote endpoint.
|
ReplicatorConfiguration |
setPushFilter(ReplicationFilter pushFilter)
Sets a filter object for validating whether the documents can be pushed
to the remote endpoint.
|
ReplicatorConfiguration |
setReplicatorType(com.couchbase.lite.AbstractReplicatorConfiguration.ReplicatorType replicatorType)
Sets the replicator type indicating the direction of the replicator.
|
public ReplicatorConfiguration(@NonNull ReplicatorConfiguration config)
@NonNull public ReplicatorConfiguration setAuthenticator(@NonNull Authenticator authenticator)
authenticator
- The authenticator.@NonNull public ReplicatorConfiguration setChannels(List<String> channels)
channels
- The Sync Gateway channel names.public ReplicatorConfiguration setConflictResolver(@Nullable ConflictResolver conflictResolver)
conflictResolver
- The replicator type.@NonNull public ReplicatorConfiguration setContinuous(boolean continuous)
continuous
- The continuous flag.@NonNull public ReplicatorConfiguration setDocumentIDs(List<String> documentIDs)
documentIDs
- The document IDs.@NonNull public ReplicatorConfiguration setHeaders(Map<String,String> headers)
headers
- The HTTP Headers.@NonNull public ReplicatorConfiguration setPinnedServerCertificate(byte[] pinnedServerCertificate)
pinnedServerCertificate
- the SSL certificate.@NonNull public ReplicatorConfiguration setPullFilter(ReplicationFilter pullFilter)
pullFilter
- The filter to filter the document to be pulled.@NonNull public ReplicatorConfiguration setPushFilter(ReplicationFilter pushFilter)
pushFilter
- The filter to filter the document to be pushed.@NonNull public ReplicatorConfiguration setReplicatorType(@NonNull com.couchbase.lite.AbstractReplicatorConfiguration.ReplicatorType replicatorType)
replicatorType
- The replicator type.public Authenticator getAuthenticator()
public List<String> getChannels()
@Nullable public ConflictResolver getConflictResolver()
public boolean isContinuous()
@NonNull public Database getDatabase()
public List<String> getDocumentIDs()
public Map<String,String> getHeaders()
public byte[] getPinnedServerCertificate()
public ReplicationFilter getPullFilter()
public ReplicationFilter getPushFilter()
@NonNull public com.couchbase.lite.AbstractReplicatorConfiguration.ReplicatorType getReplicatorType()
@NonNull public Endpoint getTarget()