Package org.opensearch.data.client.osc
Class OpenSearchClients
java.lang.Object
org.opensearch.data.client.osc.OpenSearchClients
Utility class to create the different OpenSearch clients
- Since:
- 4.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceClientConfiguration.ClientConfigurationCallbackto configure the OpenSearch RestClient's Http client with aHttpAsyncClientBuilderstatic interfaceClientConfiguration.ClientConfigurationCallbackto configure the RestClient client with aRestClientBuilder -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opensearch.client.opensearch.OpenSearchClientcreateImperative(org.opensearch.client.RestClient restClient) Creates a new imperativeOpenSearchClientstatic org.opensearch.client.opensearch.OpenSearchClientcreateImperative(org.opensearch.client.RestClient restClient, org.opensearch.client.transport.TransportOptions transportOptions) Creates a new imperativeOpenSearchClientstatic org.opensearch.client.opensearch.OpenSearchClientcreateImperative(org.opensearch.client.RestClient restClient, org.opensearch.client.transport.TransportOptions transportOptions, org.opensearch.client.json.JsonpMapper jsonpMapper) Creates a new imperativeOpenSearchClientcreateImperative(org.opensearch.client.transport.OpenSearchTransport transport) Creates a newOpenSearchClientthat uses the givenOpenSearchTransport.static org.opensearch.client.opensearch.OpenSearchClientcreateImperative(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration) Creates a new imperativeOpenSearchClientstatic org.opensearch.client.opensearch.OpenSearchClientcreateImperative(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration, org.opensearch.client.transport.TransportOptions transportOptions) Creates a new imperativeOpenSearchClientstatic org.opensearch.client.transport.OpenSearchTransportgetOpenSearchTransport(org.opensearch.client.RestClient restClient, String clientType, org.opensearch.client.transport.TransportOptions transportOptions, org.opensearch.client.json.JsonpMapper jsonpMapper) Creates anOpenSearchTransportthat will use the given client that additionally is customized with a header to contain the clientTypestatic org.opensearch.client.RestClientgetRestClient(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration) Creates a low levelRestClientfor the given configuration.
-
Field Details
-
IMPERATIVE_CLIENT
- See Also:
-
-
Constructor Details
-
OpenSearchClients
public OpenSearchClients()
-
-
Method Details
-
createImperative
public static org.opensearch.client.opensearch.OpenSearchClient createImperative(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration) Creates a new imperativeOpenSearchClient- Parameters:
clientConfiguration- configuration options, must not be null.- Returns:
- the
OpenSearchClient
-
createImperative
public static org.opensearch.client.opensearch.OpenSearchClient createImperative(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration, org.opensearch.client.transport.TransportOptions transportOptions) Creates a new imperativeOpenSearchClient- Parameters:
clientConfiguration- configuration options, must not be null.transportOptions- options to be added to each request.- Returns:
- the
OpenSearchClient
-
createImperative
public static org.opensearch.client.opensearch.OpenSearchClient createImperative(org.opensearch.client.RestClient restClient) Creates a new imperativeOpenSearchClient- Parameters:
restClient- the RestClient to use- Returns:
- the
OpenSearchClient
-
createImperative
public static org.opensearch.client.opensearch.OpenSearchClient createImperative(org.opensearch.client.RestClient restClient, @Nullable org.opensearch.client.transport.TransportOptions transportOptions) Creates a new imperativeOpenSearchClient- Parameters:
restClient- the RestClient to usetransportOptions- options to be added to each request.- Returns:
- the
OpenSearchClient
-
createImperative
public static org.opensearch.client.opensearch.OpenSearchClient createImperative(org.opensearch.client.RestClient restClient, @Nullable org.opensearch.client.transport.TransportOptions transportOptions, org.opensearch.client.json.JsonpMapper jsonpMapper) Creates a new imperativeOpenSearchClient- Parameters:
restClient- the RestClient to usetransportOptions- options to be added to each request.jsonpMapper- the mapper for the transport to use- Returns:
- the
OpenSearchClient
-
createImperative
public static AutoCloseableOpenSearchClient createImperative(org.opensearch.client.transport.OpenSearchTransport transport) Creates a newOpenSearchClientthat uses the givenOpenSearchTransport.- Parameters:
transport- the transport to use- Returns:
- the
OpenSearchClient
-
getRestClient
public static org.opensearch.client.RestClient getRestClient(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration) Creates a low levelRestClientfor the given configuration.- Parameters:
clientConfiguration- must not be null- Returns:
- the
RestClient
-
getOpenSearchTransport
public static org.opensearch.client.transport.OpenSearchTransport getOpenSearchTransport(org.opensearch.client.RestClient restClient, String clientType, @Nullable org.opensearch.client.transport.TransportOptions transportOptions, org.opensearch.client.json.JsonpMapper jsonpMapper) Creates anOpenSearchTransportthat will use the given client that additionally is customized with a header to contain the clientType- Parameters:
restClient- the client to useclientType- the client type to pass in each request as headertransportOptions- options for the transportjsonpMapper- mapper for the transport- Returns:
- OpenSearchTransport
-