Search in sources :

Example 6 with Builder

use of org.opensearch.client.RequestOptions.Builder in project OpenSearch by opensearch-project.

the class OpenSearchRestTestCase method expectVersionSpecificWarnings.

public static RequestOptions expectVersionSpecificWarnings(Consumer<VersionSensitiveWarningsHandler> expectationsSetter) {
    Builder builder = RequestOptions.DEFAULT.toBuilder();
    VersionSensitiveWarningsHandler warningsHandler = new VersionSensitiveWarningsHandler(nodeVersions);
    expectationsSetter.accept(warningsHandler);
    builder.setWarningsHandler(warningsHandler);
    return builder.build();
}
Also used : RestClientBuilder(org.opensearch.client.RestClientBuilder) Builder(org.opensearch.client.RequestOptions.Builder) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder)

Aggregations

Builder (org.opensearch.client.RequestOptions.Builder)6 RestClientBuilder (org.opensearch.client.RestClientBuilder)6 XContentBuilder (org.opensearch.common.xcontent.XContentBuilder)6 BufferedReader (java.io.BufferedReader)3 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 InputStreamReader (java.io.InputStreamReader)3 StandardCharsets (java.nio.charset.StandardCharsets)3 Files (java.nio.file.Files)3 Path (java.nio.file.Path)3 KeyManagementException (java.security.KeyManagementException)3 KeyStore (java.security.KeyStore)3 KeyStoreException (java.security.KeyStoreException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 CertificateException (java.security.cert.CertificateException)3 ArrayList (java.util.ArrayList)3 Arrays (java.util.Arrays)3 Collections (java.util.Collections)3 Collections.sort (java.util.Collections.sort)3 Collections.unmodifiableList (java.util.Collections.unmodifiableList)3