Package com.couchbase.lite
Class CollectionConfiguration
java.lang.Object
com.couchbase.lite.CollectionConfiguration
-
Constructor Summary
ConstructorDescriptionCollectionConfiguration
(List<String> channels, List<String> documentIDs, ReplicationFilter pullFilter, ReplicationFilter pushFilter, ConflictResolver conflictResolver) -
Method Summary
Modifier and TypeMethodDescriptionSets a collection of Sync Gateway channel names from which to pull Documents.Return the conflict resolver.A collection of document IDs to filter: if not nil, only documents with these IDs will be pushed and/or pulled.Gets the filter used to determine whether a document will be pulled from the remote endpoint.Gets the filter used to determine whether a document will be pushed to the remote endpoint.final CollectionConfiguration
setChannels
(List<String> channels) Sets a collection of Sync Gateway channel names from which to pull Documents.final CollectionConfiguration
setConflictResolver
(ConflictResolver conflictResolver) Sets the conflict resolver.final CollectionConfiguration
setDocumentIDs
(List<String> documentIDs) Sets a collection of document IDs to filter by: if given, only documents with these IDs will be pushed and/or pulled.final CollectionConfiguration
setPullFilter
(ReplicationFilter pullFilter) Sets a filter object for validating whether the documents can be pulled from the remote endpoint.final CollectionConfiguration
setPushFilter
(ReplicationFilter pushFilter) Sets a filter object for validating whether the documents can be pushed to the remote endpoint.toString()
-
Constructor Details
-
CollectionConfiguration
public CollectionConfiguration() -
CollectionConfiguration
public CollectionConfiguration(@Nullable List<String> channels, @Nullable List<String> documentIDs, @Nullable ReplicationFilter pullFilter, @Nullable ReplicationFilter pushFilter, @Nullable ConflictResolver conflictResolver)
-
-
Method Details
-
setDocumentIDs
Sets a collection of document IDs to filter by: if given, only documents with these IDs will be pushed and/or pulled.- Parameters:
documentIDs
- The document IDs.- Returns:
- this.
-
setChannels
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. Note: Channel specifications apply only to replications pulling from a SyncGateway and only the channels visible to the authenticated user. Channel specs are ignored:- during a push replication.
- during peer-to-peer or database-to-database replication
- when the specified channel is not accessible to the user
- Parameters:
channels
- The Sync Gateway channel names.- Returns:
- this.
-
setConflictResolver
@NonNull public final CollectionConfiguration setConflictResolver(@Nullable ConflictResolver conflictResolver) Sets the conflict resolver.- Parameters:
conflictResolver
- A conflict resolver.- Returns:
- this.
-
setPullFilter
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.- Parameters:
pullFilter
- The filter to filter the document to be pulled.- Returns:
- this.
-
setPushFilter
Sets a filter object for validating whether the documents can be pushed to the remote endpoint.- Parameters:
pushFilter
- The filter to filter the document to be pushed.- Returns:
- this.
-
getChannels
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. Note: Channel specifications apply only to replications pulling from a SyncGateway and only the channels visible to the authenticated user. Channel specs are ignored:- during a push replication.
- during peer-to-peer or database-to-database replication
- when the specified channel is not accessible to the user
-
getDocumentIDs
A collection of document IDs to filter: if not nil, only documents with these IDs will be pushed and/or pulled. -
getConflictResolver
Return the conflict resolver. -
getPullFilter
Gets the filter used to determine whether a document will be pulled from the remote endpoint. -
getPushFilter
Gets the filter used to determine whether a document will be pushed to the remote endpoint. -
toString
-