Class ChildTemplate<T extends org.opensearch.client.transport.Transport,CLIENT extends org.opensearch.client.ApiClient<T,CLIENT>>

java.lang.Object
org.opensearch.data.client.osc.ChildTemplate<T,CLIENT>
Direct Known Subclasses:
ClusterTemplate, IndicesTemplate

public abstract class ChildTemplate<T extends org.opensearch.client.transport.Transport,CLIENT extends org.opensearch.client.ApiClient<T,CLIENT>> extends Object
base class for a template that uses one of the OpenSearchClient's child clients like OpenSearchClusterClient or OpenSearchIndicesClient.
Since:
4.4
  • Field Details

    • client

      protected final CLIENT extends org.opensearch.client.ApiClient<T,CLIENT> client
    • requestConverter

      protected final org.opensearch.data.client.osc.RequestConverter requestConverter
    • responseConverter

      protected final org.opensearch.data.client.osc.ResponseConverter responseConverter
    • exceptionTranslator

      protected final OpenSearchExceptionTranslator exceptionTranslator
  • Constructor Details

    • ChildTemplate

      public ChildTemplate(CLIENT client, org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter elasticsearchConverter)
  • Method Details

    • execute

      public <RESULT> RESULT execute(ChildTemplate.ClientCallback<CLIENT,RESULT> callback)
      Execute a callback with the client and provide exception translation.
      Type Parameters:
      RESULT - the type returned from the callback
      Parameters:
      callback - the callback to execute, must not be null
      Returns:
      the callback result