Package com.couchbase.lite
Class CollectionConfiguration
- java.lang.Object
-
- com.couchbase.lite.CollectionConfiguration
-
public class CollectionConfiguration extends Object
-
-
Constructor Summary
Constructors Constructor Description CollectionConfiguration()
CollectionConfiguration(List<String> channels, List<String> documentIDs, ReplicationFilter pullFilter, ReplicationFilter pushFilter, ConflictResolver conflictResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getChannels()
Sets a collection of Sync Gateway channel names from which to pull Documents.ConflictResolver
getConflictResolver()
Return the conflict resolver.List<String>
getDocumentIDs()
A collection of document IDs to filter: if not nil, only documents with these IDs will be pushed and/or pulled.ReplicationFilter
getPullFilter()
Gets the filter used to determine whether a document will be pulled from the remote endpoint.ReplicationFilter
getPushFilter()
Gets the filter used to determine whether a document will be pushed to the remote endpoint.CollectionConfiguration
setChannels(List<String> channels)
Sets a collection of Sync Gateway channel names from which to pull Documents.CollectionConfiguration
setConflictResolver(ConflictResolver conflictResolver)
Sets the conflict resolver.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.CollectionConfiguration
setPullFilter(ReplicationFilter pullFilter)
Sets a filter object for validating whether the documents can be pulled from the remote endpoint.CollectionConfiguration
setPushFilter(ReplicationFilter pushFilter)
Sets a filter object for validating whether the documents can be pushed to the remote endpoint.String
toString()
-
-
-
Constructor Detail
-
CollectionConfiguration
public CollectionConfiguration()
-
CollectionConfiguration
public CollectionConfiguration(@Nullable List<String> channels, @Nullable List<String> documentIDs, @Nullable ReplicationFilter pullFilter, @Nullable ReplicationFilter pushFilter, @Nullable ConflictResolver conflictResolver)
-
-
Method Detail
-
setDocumentIDs
@NonNull public final CollectionConfiguration setDocumentIDs(@Nullable 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.- Parameters:
documentIDs
- The document IDs.- Returns:
- this.
-
setChannels
@NonNull public final CollectionConfiguration setChannels(@Nullable List<String> channels)
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
@NonNull public final CollectionConfiguration setPullFilter(@Nullable ReplicationFilter pullFilter)
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
@NonNull public final CollectionConfiguration setPushFilter(@Nullable ReplicationFilter pushFilter)
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
@Nullable public final List<String> 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
@Nullable public final List<String> getDocumentIDs()
A collection of document IDs to filter: if not nil, only documents with these IDs will be pushed and/or pulled.
-
getConflictResolver
@Nullable public ConflictResolver getConflictResolver()
Return the conflict resolver.
-
getPullFilter
@Nullable public ReplicationFilter getPullFilter()
Gets the filter used to determine whether a document will be pulled from the remote endpoint.
-
getPushFilter
@Nullable public ReplicationFilter getPushFilter()
Gets the filter used to determine whether a document will be pushed to the remote endpoint.
-
-