Package org.elasticsearch.client
Class RequestOptions.Builder
- java.lang.Object
-
- org.elasticsearch.client.RequestOptions.Builder
-
- Enclosing class:
- RequestOptions
public static class RequestOptions.Builder extends java.lang.Object
BuildsRequestOptions
. Get one by callingRequestOptions.toBuilder()
onRequestOptions.DEFAULT
or any other RequestOptions.
-
-
Method Summary
Modifier and Type Method Description void
addHeader(java.lang.String name, java.lang.String value)
Add the provided header to the request.RequestOptions
build()
Build the RequestOptions.void
setHttpAsyncResponseConsumerFactory(HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory)
Set theHttpAsyncResponseConsumerFactory
used to create oneHttpAsyncResponseConsumer
callback per retry.void
setWarningsHandler(WarningsHandler warningsHandler)
How this request should handle warnings.
-
-
-
Method Detail
-
build
public RequestOptions build()
Build the RequestOptions.
-
addHeader
public void addHeader(java.lang.String name, java.lang.String value)
Add the provided header 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
public void setWarningsHandler(WarningsHandler warningsHandler)
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.
-
-