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.ObjectBuildsRequestOptions. Get one by callingRequestOptions.toBuilder()onRequestOptions.DEFAULTor any other RequestOptions.
-
-
Method Summary
Modifier and Type Method Description voidaddHeader(java.lang.String name, java.lang.String value)Add the provided header to the request.RequestOptionsbuild()Build the RequestOptions.voidsetHttpAsyncResponseConsumerFactory(HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory)Set theHttpAsyncResponseConsumerFactoryused to create oneHttpAsyncResponseConsumercallback per retry.voidsetWarningsHandler(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 theHttpAsyncResponseConsumerFactoryused to create oneHttpAsyncResponseConsumercallback 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.PERMISSIVEif the client should ignore all warnings which is the same behavior as setting strictDeprecationMode to true. It can be set toWarningsHandler.STRICTif 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.
-
-