Package net.sinyax.sofa
Class RemoteHttpDatabase
java.lang.Object
net.sinyax.sofa.RemoteHttpDatabase
- All Implemented Interfaces:
ReplicatorDbAdapter
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteHttpDatabase(String baseUrl, @Nullable String authentication) RemoteHttpDatabase(String baseUrl, @Nullable String authentication, @Nullable String userAgent) Create a replication endpoint for a remote (HTTP or HTTPS) with a CouchDB-compatible REST interface -
Method Summary
Modifier and TypeMethodDescriptionbulkSaveDocuments(List<Document> docs, boolean newEdits) getChanges(String since, int limit) getDocument(String docId, boolean revs) getDocument(String docId, boolean revs, List<String> revisions) getLocalDocument(String docId) getRevisionDiff(Map<String, List<String>> revs) info()
-
Constructor Details
-
RemoteHttpDatabase
public RemoteHttpDatabase(String baseUrl, @Nullable @Nullable String authentication, @Nullable @Nullable String userAgent) Create a replication endpoint for a remote (HTTP or HTTPS) with a CouchDB-compatible REST interface- Parameters:
baseUrl- URL of the DB info endpoint (https://docs.couchdb.org/en/stable/api/database/common.html#get--db)authentication- If not null, this String is passed literally as "Authorization" header for all requestsuserAgent- If not null, this String is set as User Agent for all HTTP requests
-
RemoteHttpDatabase
-
-
Method Details
-
identifier
- Specified by:
identifierin interfaceReplicatorDbAdapter
-
info
- Specified by:
infoin interfaceReplicatorDbAdapter
-
getChanges
- Specified by:
getChangesin interfaceReplicatorDbAdapter
-
getDocument
- Specified by:
getDocumentin interfaceReplicatorDbAdapter
-
getDocument
public CompletableFuture<List<DocRevResponse>> getDocument(String docId, boolean revs, List<String> revisions) - Specified by:
getDocumentin interfaceReplicatorDbAdapter
-
bulkSaveDocuments
public CompletableFuture<List<DocSaveResponse>> bulkSaveDocuments(List<Document> docs, boolean newEdits) - Specified by:
bulkSaveDocumentsin interfaceReplicatorDbAdapter
-
getLocalDocument
- Specified by:
getLocalDocumentin interfaceReplicatorDbAdapter
-
saveLocalDocument
- Specified by:
saveLocalDocumentin interfaceReplicatorDbAdapter
-
getRevisionDiff
public CompletableFuture<Map<String,Map<String, getRevisionDiffList<String>>>> (Map<String, List<String>> revs) - Specified by:
getRevisionDiffin interfaceReplicatorDbAdapter
-