public abstract class AbstractReplicatorConfiguration extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractReplicatorConfiguration.ReplicatorType
Deprecated.
Use AbstractReplicator.ReplicatorType
|
Modifier and Type | Field and Description |
---|---|
static int |
DISABLE_HEARTBEAT
This is a long time: just under 25 days.
|
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.
|
int |
getHeartbeat()
Return the heartbeat interval, in seconds.
|
int |
getMaxAttempts()
Return the max number of retry attempts made after connection failure.
|
int |
getMaxAttemptWaitTime()
Return the max time between retry attempts (exponential backoff).
|
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.
|
AbstractReplicatorConfiguration.ReplicatorType |
getReplicatorType()
Deprecated.
Use getType()
|
Endpoint |
getTarget()
Return the replication target to replicate with.
|
ReplicatorType |
getType()
Return Replicator type indicating the direction of the replicator.
|
boolean |
isAcceptParentDomainCookies()
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 the domain of the sender.
|
boolean |
isAutoPurgeEnabled()
Enable/disable auto-purge.
|
boolean |
isContinuous()
Return the continuous flag indicating whether the replicator should stay
active indefinitely to replicate changed documents.
|
ReplicatorConfiguration |
setAcceptParentDomainCookies(boolean acceptParentCookies)
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 the domain of the sender.
|
ReplicatorConfiguration |
setAuthenticator(Authenticator authenticator)
Sets the authenticator to authenticate with a remote target server.
|
ReplicatorConfiguration |
setAutoPurgeEnabled(boolean enabled)
Enable/disable auto-purge.
|
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 |
setHeartbeat(int heartbeat)
Set the heartbeat interval, in seconds.
|
ReplicatorConfiguration |
setMaxAttempts(int maxAttempts)
Set the max number of retry attempts made after a connection failure.
|
ReplicatorConfiguration |
setMaxAttemptWaitTime(int maxAttemptWaitTime)
Set the max time between retry attempts (exponential backoff).
|
ReplicatorConfiguration |
setPinnedServerCertificate(byte[] pinnedCert)
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(AbstractReplicatorConfiguration.ReplicatorType replicatorType)
Deprecated.
Use setType(AbstractReplicator.ReplicatorType)
|
ReplicatorConfiguration |
setType(ReplicatorType type)
Sets the replicator type indicating the direction of the replicator.
|
String |
toString() |
public static final int DISABLE_HEARTBEAT
@NonNull public final ReplicatorConfiguration setAuthenticator(@NonNull Authenticator authenticator)
authenticator
- The authenticator.@NonNull public final ReplicatorConfiguration setChannels(@Nullable List<String> channels)
channels
- The Sync Gateway channel names.@NonNull public final ReplicatorConfiguration setConflictResolver(@Nullable ConflictResolver conflictResolver)
conflictResolver
- A conflict resolver.@NonNull public final ReplicatorConfiguration setContinuous(boolean continuous)
continuous
- The continuous flag.@NonNull public final ReplicatorConfiguration setDocumentIDs(@Nullable List<String> documentIDs)
documentIDs
- The document IDs.@NonNull public final ReplicatorConfiguration setHeaders(@Nullable Map<String,String> headers)
headers
- The HTTP Headers.@NonNull public final ReplicatorConfiguration setAcceptParentDomainCookies(boolean acceptParentCookies)
@NonNull public final ReplicatorConfiguration setPinnedServerCertificate(@Nullable byte[] pinnedCert)
pinnedCert
- the SSL certificate.@NonNull public final ReplicatorConfiguration setPullFilter(@Nullable ReplicationFilter pullFilter)
pullFilter
- The filter to filter the document to be pulled.@NonNull public final ReplicatorConfiguration setPushFilter(@Nullable ReplicationFilter pushFilter)
pushFilter
- The filter to filter the document to be pushed.@Deprecated @NonNull public final ReplicatorConfiguration setReplicatorType(@NonNull AbstractReplicatorConfiguration.ReplicatorType replicatorType)
replicatorType
- The replicator type.@NonNull public final ReplicatorConfiguration setType(@NonNull ReplicatorType type)
type
- The replicator type.@NonNull public final ReplicatorConfiguration setMaxAttempts(int maxAttempts)
maxAttempts
- max retry attempts@NonNull public final ReplicatorConfiguration setMaxAttemptWaitTime(int maxAttemptWaitTime)
maxAttemptWaitTime
- max attempt wait time@NonNull public final ReplicatorConfiguration setHeartbeat(int heartbeat)
Must be non-negative and less than Integer.MAX_VALUE milliseconds
@NonNull public final ReplicatorConfiguration setAutoPurgeEnabled(boolean enabled)
Auto-purge is enabled, by default.
When the autoPurge flag is disabled, the replicator will notify the registered DocumentReplication listeners with an "access removed" event when access to the document is revoked on the Sync Gateway. On receiving the event, the application may decide to manually purge the document. However, for performance reasons, any DocumentReplication listeners added to the replicator after the replicator is started will not receive the access removed events until the replicator is restarted or reconnected with Sync Gateway.
@Nullable public final Authenticator getAuthenticator()
@Nullable public final List<String> getChannels()
@Nullable public final ConflictResolver getConflictResolver()
public final boolean isContinuous()
@NonNull public final Database getDatabase()
@Nullable public final List<String> getDocumentIDs()
@Nullable public final Map<String,String> getHeaders()
public final boolean isAcceptParentDomainCookies()
@Nullable public final byte[] getPinnedServerCertificate()
@Nullable public final ReplicationFilter getPullFilter()
@Nullable public final ReplicationFilter getPushFilter()
@Deprecated @NonNull public final AbstractReplicatorConfiguration.ReplicatorType getReplicatorType()
@NonNull public final ReplicatorType getType()
@NonNull public final Endpoint getTarget()
public final int getMaxAttempts()
public final int getMaxAttemptWaitTime()
public final int getHeartbeat()
public final boolean isAutoPurgeEnabled()