Package org.elasticsearch.client
Class RequestOptions.Builder
java.lang.Object
org.elasticsearch.client.RequestOptions.Builder
- Enclosing class:
- RequestOptions
Builds
RequestOptions
. Get one by calling
RequestOptions.toBuilder()
on RequestOptions.DEFAULT
or
any other RequestOptions.-
Method Summary
Modifier and TypeMethodDescriptionAdd the provided header to the request.addParameter
(String key, String value) Add the provided parameter to the request.build()
Build the RequestOptions.List<org.apache.http.Header>
Return all headers for the requestremoveHeader
(String name) Remove all headers with the given name.void
setHttpAsyncResponseConsumerFactory
(HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory) Set theHttpAsyncResponseConsumerFactory
used to create oneHttpAsyncResponseConsumer
callback per retry.setRequestConfig
(org.apache.http.client.config.RequestConfig requestConfig) set RequestConfig, which can set socketTimeout, connectTimeout and so on by requestsetWarningsHandler
(WarningsHandler warningsHandler) How this request should handle warnings.
-
Method Details
-
build
Build the RequestOptions. -
addHeader
Add the provided header to the request. -
removeHeader
Remove all headers with the given name. -
getHeaders
Return all headers for the request -
addParameter
Add the provided parameter to the request. -
setHttpAsyncResponseConsumerFactory
public void setHttpAsyncResponseConsumerFactory(HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory) Set theHttpAsyncResponseConsumerFactory
used to create oneHttpAsyncResponseConsumer
callback per retry. Controls how the response body gets streamed from a non-blocking HTTP connection on the client side. -
setWarningsHandler
How this request should handle warnings. If null (the default) then this request will default to the behavior dictacted byRestClientBuilder.setStrictDeprecationMode(boolean)
.This can be set to
WarningsHandler.PERMISSIVE
if the client should ignore all warnings which is the same behavior as setting strictDeprecationMode to true. It can be set toWarningsHandler.STRICT
if the client should fail if there are any warnings which is the same behavior as settings strictDeprecationMode to false.It can also be set to a custom implementation of WarningsHandler to permit only certain warnings or to fail the request if the warnings returned don't exactly match some set.
-
setRequestConfig
public RequestOptions.Builder setRequestConfig(org.apache.http.client.config.RequestConfig requestConfig) set RequestConfig, which can set socketTimeout, connectTimeout and so on by request- Parameters:
requestConfig
- http client RequestConfig- Returns:
- Builder
-