Class CoreProtostellarAccessors
- java.lang.Object
-
- com.couchbase.client.core.protostellar.CoreProtostellarAccessors
-
public class CoreProtostellarAccessors extends Object
Used to generically handle the core functionality of sending a GRPC request over Protostellar and handling the response.Can handle any single-request-single-response setup, e.g. KV, collection management, etc.
Does not handle streaming.
-
-
Constructor Summary
Constructors Constructor Description CoreProtostellarAccessors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <TSdkResult,TGrpcRequest,TGrpcResponse>
CoreAsyncResponse<TSdkResult>async(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse)
Convenience overload that uses the default exception handling.static <TSdkResult,TGrpcRequest,TGrpcResponse>
CoreAsyncResponse<TSdkResult>async(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
static <TSdkResult,TGrpcRequest,TGrpcResponse>
voidasyncInternal(CompletableFuture<TSdkResult> ret, CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
static <TSdkResult,TGrpcRequest,TGrpcResponse>
TSdkResultblocking(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,TGrpcResponse> executeBlockingGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse)
Convenience overload that uses the default exception handling.static <TSdkResult,TGrpcRequest,TGrpcResponse>
TSdkResultblocking(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,TGrpcResponse> executeBlockingGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
static <TSdkResult,TGrpcRequest,TGrpcResponse>
Mono<TSdkResult>reactive(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse)
Convenience overload that uses the default exception handling.static <TSdkResult,TGrpcRequest,TGrpcResponse>
Mono<TSdkResult>reactive(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
static <TSdkResult,TGrpcRequest,TGrpcResponse>
voidreactiveInternal(Sinks.One<TSdkResult> ret, CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
This method must always be called at Reactive runtime, not build-time (e.g., inside a Mono.defer or similar).
-
-
-
Method Detail
-
blocking
public static <TSdkResult,TGrpcRequest,TGrpcResponse> TSdkResult blocking(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,TGrpcResponse> executeBlockingGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse)
Convenience overload that uses the default exception handling.
-
blocking
public static <TSdkResult,TGrpcRequest,TGrpcResponse> TSdkResult blocking(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,TGrpcResponse> executeBlockingGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
- Type Parameters:
TSdkResult
- e.g. MutationResultTGrpcResponse
- e.g. com.couchbase.client.protostellar.kv.v1.InsertResponse
-
async
public static <TSdkResult,TGrpcRequest,TGrpcResponse> CoreAsyncResponse<TSdkResult> async(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse)
Convenience overload that uses the default exception handling.
-
async
public static <TSdkResult,TGrpcRequest,TGrpcResponse> CoreAsyncResponse<TSdkResult> async(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
-
asyncInternal
public static <TSdkResult,TGrpcRequest,TGrpcResponse> void asyncInternal(CompletableFuture<TSdkResult> ret, CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
-
reactive
public static <TSdkResult,TGrpcRequest,TGrpcResponse> Mono<TSdkResult> reactive(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse)
Convenience overload that uses the default exception handling.
-
reactive
public static <TSdkResult,TGrpcRequest,TGrpcResponse> Mono<TSdkResult> reactive(CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
-
reactiveInternal
public static <TSdkResult,TGrpcRequest,TGrpcResponse> void reactiveInternal(Sinks.One<TSdkResult> ret, CoreProtostellar core, ProtostellarRequest<TGrpcRequest> request, Function<ProtostellarEndpoint,com.couchbase.client.core.deps.com.google.common.util.concurrent.ListenableFuture<TGrpcResponse>> executeFutureGrpcCall, Function<TGrpcResponse,TSdkResult> convertResponse, Function<Throwable,ProtostellarRequestBehaviour> convertException)
This method must always be called at Reactive runtime, not build-time (e.g., inside a Mono.defer or similar).
-
-