Search in sources :

Example 6 with CoreCommonOptions

use of com.couchbase.client.core.endpoint.http.CoreCommonOptions in project couchbase-jvm-clients by couchbase.

the class HealthPinger method pingHttpEndpoint.

private static Mono<EndpointPingReport> pingHttpEndpoint(final Core core, final RequestTarget target, final CoreCommonOptions options, final String path) {
    return Mono.defer(() -> {
        CoreHttpRequest request = core.httpClient(target).get(path(path), options).build();
        core.send(request);
        return Reactor.wrap(request, request.response(), true).map(response -> {
            request.context().logicallyComplete();
            return assembleSuccessReport(request.context(), response.channelId(), Optional.empty());
        }).onErrorResume(throwable -> {
            request.context().logicallyComplete();
            return Mono.just(assembleFailureReport(throwable, request.context(), Optional.empty()));
        });
    });
}
Also used : ClusterConfig(com.couchbase.client.core.config.ClusterConfig) CbCollections.isNullOrEmpty(com.couchbase.client.core.util.CbCollections.isNullOrEmpty) CoreHttpRequest(com.couchbase.client.core.endpoint.http.CoreHttpRequest) TimeoutException(com.couchbase.client.core.error.TimeoutException) RequestTarget(com.couchbase.client.core.msg.RequestTarget) KvPingRequest(com.couchbase.client.core.msg.kv.KvPingRequest) CoreCommonOptions(com.couchbase.client.core.endpoint.http.CoreCommonOptions) HashSet(java.util.HashSet) ServiceType(com.couchbase.client.core.service.ServiceType) Duration(java.time.Duration) Map(java.util.Map) CoreHttpPath.path(com.couchbase.client.core.endpoint.http.CoreHttpPath.path) Stability(com.couchbase.client.core.annotation.Stability) RequestContext(com.couchbase.client.core.msg.RequestContext) BucketConfig(com.couchbase.client.core.config.BucketConfig) KvPingResponse(com.couchbase.client.core.msg.kv.KvPingResponse) Reactor(com.couchbase.client.core.Reactor) NodeInfo(com.couchbase.client.core.config.NodeInfo) Set(java.util.Set) Mono(reactor.core.publisher.Mono) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Flux(reactor.core.publisher.Flux) Optional(java.util.Optional) CollectionIdentifier(com.couchbase.client.core.io.CollectionIdentifier) RetryStrategy(com.couchbase.client.core.retry.RetryStrategy) Core(com.couchbase.client.core.Core) PortInfo(com.couchbase.client.core.config.PortInfo) CoreHttpRequest(com.couchbase.client.core.endpoint.http.CoreHttpRequest)

Aggregations

CoreCommonOptions (com.couchbase.client.core.endpoint.http.CoreCommonOptions)6 Map (java.util.Map)6 Core (com.couchbase.client.core.Core)5 Stability (com.couchbase.client.core.annotation.Stability)5 CoreHttpPath.path (com.couchbase.client.core.endpoint.http.CoreHttpPath.path)5 RequestTarget (com.couchbase.client.core.msg.RequestTarget)5 CoreHttpClient (com.couchbase.client.core.endpoint.http.CoreHttpClient)4 TracingIdentifiers (com.couchbase.client.core.cnc.TracingIdentifiers)3 CoreHttpPath (com.couchbase.client.core.endpoint.http.CoreHttpPath)3 CoreHttpRequest (com.couchbase.client.core.endpoint.http.CoreHttpRequest)3 CoreHttpResponse (com.couchbase.client.core.endpoint.http.CoreHttpResponse)3 CouchbaseException (com.couchbase.client.core.error.CouchbaseException)3 CbCollections.mapOf (com.couchbase.client.core.util.CbCollections.mapOf)3 Objects.requireNonNull (java.util.Objects.requireNonNull)3 Reactor (com.couchbase.client.core.Reactor)2 CbTracing (com.couchbase.client.core.cnc.CbTracing)2 RequestSpan (com.couchbase.client.core.cnc.RequestSpan)2 BucketConfig (com.couchbase.client.core.config.BucketConfig)2 ClusterConfig (com.couchbase.client.core.config.ClusterConfig)2 NodeInfo (com.couchbase.client.core.config.NodeInfo)2