Class ChildTemplate<T extends co.elastic.clients.transport.Transport,CLIENT extends co.elastic.clients.ApiClient<T,CLIENT>>
java.lang.Object
org.springframework.data.elasticsearch.client.elc.ChildTemplate<T,CLIENT>
- Direct Known Subclasses:
ClusterTemplate,IndicesTemplate
public abstract class ChildTemplate<T extends co.elastic.clients.transport.Transport,CLIENT extends co.elastic.clients.ApiClient<T,CLIENT>>
extends Object
base class for a template that uses one of the
ElasticsearchClient's child
clients like ElasticsearchClusterClient or
ElasticsearchIndicesClient.- Since:
- 4.4
- Author:
- Peter-Josef Meisch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback interface to be used withexecute(ClientCallback)for operating directly on the client. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CLIENTprotected final ElasticsearchExceptionTranslatorprotected final org.springframework.data.elasticsearch.client.elc.RequestConverterprotected final org.springframework.data.elasticsearch.client.elc.ResponseConverter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<RESULT> RESULTexecute(ChildTemplate.ClientCallback<CLIENT, RESULT> callback) Execute a callback with the client and provide exception translation.
-
Field Details
-
client
-
requestConverter
protected final org.springframework.data.elasticsearch.client.elc.RequestConverter requestConverter -
responseConverter
protected final org.springframework.data.elasticsearch.client.elc.ResponseConverter responseConverter -
exceptionTranslator
-
-
Constructor Details
-
ChildTemplate
-
-
Method Details
-
execute
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
-