Package co.elastic.clients.base
Class RestClientTransport
java.lang.Object
co.elastic.clients.base.RestClientTransport
- All Implemented Interfaces:
Transport
public class RestClientTransport extends java.lang.Object implements Transport
-
Constructor Summary
Constructors Constructor Description RestClientTransport(org.elasticsearch.client.RestClient restClient, JsonpMapper mapper)
RestClientTransport(org.elasticsearch.client.RestClient restClient, JsonpMapper mapper, org.elasticsearch.client.RequestOptions options)
-
Method Summary
Modifier and Type Method Description JsonpMapper
jsonpMapper()
<RequestT, ResponseT, ErrorT>
ResponseTperformRequest(RequestT request, Endpoint<RequestT,ResponseT,ErrorT> endpoint)
<RequestT, ResponseT, ErrorT>
java.util.concurrent.CompletableFuture<ResponseT>performRequestAsync(RequestT request, Endpoint<RequestT,ResponseT,ErrorT> endpoint)
RestClientTransport
withRequestOptions(java.util.function.Function<org.elasticsearch.client.RequestOptions.Builder,org.elasticsearch.client.RequestOptions.Builder> fn)
Creates a newRestClientTransport(org.elasticsearch.client.RestClient, co.elastic.clients.json.JsonpMapper)
with specific request options, inheriting existing options.RestClientTransport
withRequestOptions(org.elasticsearch.client.RequestOptions options)
Creates a newRestClientTransport(org.elasticsearch.client.RestClient, co.elastic.clients.json.JsonpMapper)
with specific request options.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RestClientTransport
public RestClientTransport(org.elasticsearch.client.RestClient restClient, JsonpMapper mapper, @Nullable org.elasticsearch.client.RequestOptions options) -
RestClientTransport
-
-
Method Details
-
withRequestOptions
public RestClientTransport withRequestOptions(@Nullable org.elasticsearch.client.RequestOptions options)Creates a newRestClientTransport(org.elasticsearch.client.RestClient, co.elastic.clients.json.JsonpMapper)
with specific request options. -
withRequestOptions
public RestClientTransport withRequestOptions(java.util.function.Function<org.elasticsearch.client.RequestOptions.Builder,org.elasticsearch.client.RequestOptions.Builder> fn)Creates a newRestClientTransport(org.elasticsearch.client.RestClient, co.elastic.clients.json.JsonpMapper)
with specific request options, inheriting existing options.- Parameters:
fn
- a function taking an options builder initialized with the current request options, or initialized with default values.
-
jsonpMapper
- Specified by:
jsonpMapper
in interfaceTransport
-
performRequest
public <RequestT, ResponseT, ErrorT> ResponseT performRequest(RequestT request, Endpoint<RequestT,ResponseT,ErrorT> endpoint) throws java.io.IOException- Specified by:
performRequest
in interfaceTransport
- Throws:
java.io.IOException
-
performRequestAsync
public <RequestT, ResponseT, ErrorT> java.util.concurrent.CompletableFuture<ResponseT> performRequestAsync(RequestT request, Endpoint<RequestT,ResponseT,ErrorT> endpoint)- Specified by:
performRequestAsync
in interfaceTransport
-