use of com.couchbase.client.core.error.context.ReducedViewErrorContext in project couchbase-jvm-clients by couchbase.
the class AsyncBucket method viewQuery.
public CompletableFuture<ViewResult> viewQuery(final String designDoc, final String viewName, final ViewOptions options) {
notNull(options, "ViewOptions", () -> new ReducedViewErrorContext(designDoc, viewName, name));
ViewOptions.Built opts = options.build();
JsonSerializer serializer = opts.serializer() == null ? environment.jsonSerializer() : opts.serializer();
return ViewAccessor.viewQueryAsync(core, viewRequest(designDoc, viewName, opts), serializer);
}
use of com.couchbase.client.core.error.context.ReducedViewErrorContext in project couchbase-jvm-clients by couchbase.
the class AsyncViewIndexManager method getAllDesignDocuments.
/**
* Returns all of the design documents in the specified namespace.
*
* @param namespace namespace to query
* @param options additional optional arguments (timeout, retry, etc.)
*/
public CompletableFuture<List<DesignDocument>> getAllDesignDocuments(final DesignDocumentNamespace namespace, final GetAllDesignDocumentsOptions options) {
notNull(namespace, "DesignDocumentNamespace", () -> new ReducedViewErrorContext(null, null, bucket));
notNull(options, "GetAllDesignDocumentsOptions", () -> new ReducedViewErrorContext(null, null, bucket));
return coreManager.getAllDesignDocuments(namespace == PRODUCTION, options.build()).thenApply(AsyncViewIndexManager::parseAllDesignDocuments);
}
use of com.couchbase.client.core.error.context.ReducedViewErrorContext in project couchbase-jvm-clients by couchbase.
the class AsyncViewIndexManager method getDesignDocument.
/**
* Returns the named design document from the specified namespace.
*
* @param name name of the design document to retrieve
* @param namespace namespace to look in
* @param options additional optional arguments (timeout, retry, etc.)
* @throws DesignDocumentNotFoundException if the namespace does not contain a document with the given name
*/
public CompletableFuture<DesignDocument> getDesignDocument(String name, DesignDocumentNamespace namespace, GetDesignDocumentOptions options) {
notNullOrEmpty(name, "Name", () -> new ReducedViewErrorContext(null, null, bucket));
notNull(namespace, "DesignDocumentNamespace", () -> new ReducedViewErrorContext(name, null, bucket));
notNull(options, "GetDesignDocumentOptions", () -> new ReducedViewErrorContext(name, null, bucket));
return coreManager.getDesignDocument(name, namespace == PRODUCTION, options.build()).thenApply(responseBytes -> parseDesignDocument(name, Mapper.decodeIntoTree(responseBytes)));
}
use of com.couchbase.client.core.error.context.ReducedViewErrorContext in project couchbase-jvm-clients by couchbase.
the class AsyncViewIndexManager method publishDesignDocument.
/**
* Convenience method that gets a the document from the development namespace
* and upserts it to the production namespace.
*
* @param name name of the development design document
* @param options additional optional arguments (timeout, retry, etc.)
* @throws DesignDocumentNotFoundException if the development namespace does not contain a document with the given name
*/
public CompletableFuture<Void> publishDesignDocument(final String name, final PublishDesignDocumentOptions options) {
notNullOrEmpty(name, "Name", () -> new ReducedViewErrorContext(null, null, bucket));
notNull(options, "PublishDesignDocumentOptions", () -> new ReducedViewErrorContext(name, null, bucket));
return coreManager.publishDesignDocument(name, options.build());
}
Aggregations