Class ReactiveIndicesTemplate
java.lang.Object
org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate<co.elastic.clients.transport.ElasticsearchTransport,ReactiveElasticsearchIndicesClient>
org.springframework.data.elasticsearch.client.elc.ReactiveIndicesTemplate
- All Implemented Interfaces:
ReactiveIndexOperations
public class ReactiveIndicesTemplate
extends ReactiveChildTemplate<co.elastic.clients.transport.ElasticsearchTransport,ReactiveElasticsearchIndicesClient>
implements ReactiveIndexOperations
- Author:
- Peter-Josef Meisch
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
ReactiveChildTemplate.ClientCallback<CLIENT,RESULT extends org.reactivestreams.Publisher<?>> -
Field Summary
Fields inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
client, elasticsearchConverter, exceptionTranslator, requestConverter, responseConverter -
Constructor Summary
ConstructorsConstructorDescriptionReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, Class<?> clazz) ReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, IndexCoordinates index) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Boolean>alias(AliasActions aliasActions) Executes the givenAliasActions.reactor.core.publisher.Mono<Boolean>create()Create an index.reactor.core.publisher.Mono<Boolean>Create an index with the specified settings.reactor.core.publisher.Mono<Boolean>Create an index for given settings and mapping.reactor.core.publisher.Mono<Document>Creates the index mapping for the entity this IndexOperations is bound to.reactor.core.publisher.Mono<Document>createMapping(Class<?> clazz) Creates the index mapping for the given classreactor.core.publisher.Mono<Settings>Creates the index settings for the entity this IndexOperations is bound to.reactor.core.publisher.Mono<Settings>createSettings(Class<?> clazz) Creates the index settings from the annotations on the given classreactor.core.publisher.Mono<Boolean>Create an index with the settings and mapping defined for the entity this IndexOperations is bound to.reactor.core.publisher.Mono<Boolean>delete()Delete an index.reactor.core.publisher.Mono<Boolean>deleteComponentTemplate(DeleteComponentTemplateRequest deleteComponentTemplateRequest) Deletes a component index template.reactor.core.publisher.Mono<Boolean>deleteIndexTemplate(DeleteIndexTemplateRequest deleteIndexTemplateRequest) Deletes an index template.reactor.core.publisher.Mono<Boolean>deleteTemplate(DeleteTemplateRequest deleteTemplateRequest) Deletes an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)reactor.core.publisher.Mono<Boolean>exists()checks if an index existsreactor.core.publisher.Mono<Boolean>existsComponentTemplate(ExistsComponentTemplateRequest existsComponentTemplateRequest) Checks wether a component index template exists.reactor.core.publisher.Mono<Boolean>existsIndexTemplate(ExistsIndexTemplateRequest existsIndexTemplateRequest) Checks if an index template exists.reactor.core.publisher.Mono<Boolean>existsTemplate(ExistsTemplateRequest existsTemplateRequest) Checks if an index template exists using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)getAliases(String... aliasNames) gets information about aliasesgetAliasesForIndex(String... indexNames) gets information about aliasesreactor.core.publisher.Flux<TemplateResponse>getComponentTemplate(GetComponentTemplateRequest getComponentTemplateRequest) Get component template(s).get the currentIndexCoordinates.reactor.core.publisher.Flux<TemplateResponse>getIndexTemplate(GetIndexTemplateRequest getIndexTemplateRequest) Get index template(s).reactor.core.publisher.Flux<IndexInformation>getInformation(IndexCoordinates index) Gets theIndexInformationfor the indices defined byReactiveIndexOperations.getIndexCoordinates().reactor.core.publisher.Mono<Document>Get mapping for the index targeted defined by thisReactiveIndexOperationsreactor.core.publisher.Mono<Settings>getSettings(boolean includeDefaults) get the settings for the indexreactor.core.publisher.Mono<TemplateData>getTemplate(GetTemplateRequest getTemplateRequest) gets an index template using the legacy Elasticsearch interface.reactor.core.publisher.Mono<Boolean>putComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest) Writes a component index template that can be used in a composable index template.reactor.core.publisher.Mono<Boolean>putIndexTemplate(PutIndexTemplateRequest putIndexTemplateRequest) Creates an index template.reactor.core.publisher.Mono<Boolean>putMapping(reactor.core.publisher.Mono<Document> mapping) writes a mapping to the indexreactor.core.publisher.Mono<Boolean>putTemplate(PutTemplateRequest putTemplateRequest) Creates an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)reactor.core.publisher.Mono<Void>refresh()Refresh the index(es) this IndexOperations is bound toMethods inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
executeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.elasticsearch.core.ReactiveIndexOperations
deleteIndexTemplate, deleteTemplate, existsIndexTemplate, existsTemplate, getIndexTemplate, getInformation, getSettings, getTemplate, putMapping, putMapping
-
Constructor Details
-
ReactiveIndicesTemplate
public ReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, IndexCoordinates index) -
ReactiveIndicesTemplate
public ReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, Class<?> clazz)
-
-
Method Details
-
create
Description copied from interface:ReactiveIndexOperationsCreate an index.- Specified by:
createin interfaceReactiveIndexOperations- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
create
Description copied from interface:ReactiveIndexOperationsCreate an index with the specified settings.- Specified by:
createin interfaceReactiveIndexOperations- Parameters:
settings- index settings- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
create
Description copied from interface:ReactiveIndexOperationsCreate an index for given settings and mapping.- Specified by:
createin interfaceReactiveIndexOperations- Parameters:
settings- the index settingsmapping- the index mapping- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
createWithMapping
Description copied from interface:ReactiveIndexOperationsCreate an index with the settings and mapping defined for the entity this IndexOperations is bound to.- Specified by:
createWithMappingin interfaceReactiveIndexOperations- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
delete
Description copied from interface:ReactiveIndexOperationsDelete an index.- Specified by:
deletein interfaceReactiveIndexOperations- Returns:
- a
Monosignalling operation completion or anerror. If the index does not exist, a value of false is emitted.
-
exists
Description copied from interface:ReactiveIndexOperationschecks if an index exists- Specified by:
existsin interfaceReactiveIndexOperations- Returns:
- a
Monowith the result of exist check
-
refresh
Description copied from interface:ReactiveIndexOperationsRefresh the index(es) this IndexOperations is bound to- Specified by:
refreshin interfaceReactiveIndexOperations- Returns:
- a
Monosignalling operation completion.
-
createMapping
Description copied from interface:ReactiveIndexOperationsCreates the index mapping for the entity this IndexOperations is bound to.- Specified by:
createMappingin interfaceReactiveIndexOperations- Returns:
- mapping object
-
createMapping
Description copied from interface:ReactiveIndexOperationsCreates the index mapping for the given class- Specified by:
createMappingin interfaceReactiveIndexOperations- Parameters:
clazz- the clazz to create a mapping for- Returns:
- a
Monowith the mapping document
-
putMapping
public reactor.core.publisher.Mono<Boolean> putMapping(reactor.core.publisher.Mono<Document> mapping) Description copied from interface:ReactiveIndexOperationswrites a mapping to the index- Specified by:
putMappingin interfaceReactiveIndexOperations- Parameters:
mapping- the Document with the mapping definitions- Returns:
- true if the mapping could be stored
-
getMapping
Description copied from interface:ReactiveIndexOperationsGet mapping for the index targeted defined by thisReactiveIndexOperations- Specified by:
getMappingin interfaceReactiveIndexOperations- Returns:
- the mapping
-
createSettings
Description copied from interface:ReactiveIndexOperationsCreates the index settings for the entity this IndexOperations is bound to.- Specified by:
createSettingsin interfaceReactiveIndexOperations- Returns:
- a settings document.
-
createSettings
Description copied from interface:ReactiveIndexOperationsCreates the index settings from the annotations on the given class- Specified by:
createSettingsin interfaceReactiveIndexOperations- Parameters:
clazz- the class to create the index settings from- Returns:
- a settings document.
-
getSettings
Description copied from interface:ReactiveIndexOperationsget the settings for the index- Specified by:
getSettingsin interfaceReactiveIndexOperations- Parameters:
includeDefaults- whether or not to include all the default settings- Returns:
- a
Monowith aDocumentcontaining the index settings
-
alias
Description copied from interface:ReactiveIndexOperationsExecutes the givenAliasActions.- Specified by:
aliasin interfaceReactiveIndexOperations- Parameters:
aliasActions- the actions to execute- Returns:
- if the operation is acknowledged by Elasticsearch
-
getAliases
Description copied from interface:ReactiveIndexOperationsgets information about aliases- Specified by:
getAliasesin interfaceReactiveIndexOperations- Parameters:
aliasNames- alias names, must not be null- Returns:
- a
MonoofMapfrom index names toAliasDatafor that index
-
getAliasesForIndex
public reactor.core.publisher.Mono<Map<String,Set<AliasData>>> getAliasesForIndex(String... indexNames) Description copied from interface:ReactiveIndexOperationsgets information about aliases- Specified by:
getAliasesForIndexin interfaceReactiveIndexOperations- Parameters:
indexNames- alias names, must not be null- Returns:
- a
MonoofMapfrom index names toAliasDatafor that index
-
putTemplate
Description copied from interface:ReactiveIndexOperationsCreates an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
putTemplatein interfaceReactiveIndexOperations- Parameters:
putTemplateRequest- template request parameters- Returns:
- Mono of true if the template could be stored
-
putComponentTemplate
public reactor.core.publisher.Mono<Boolean> putComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsWrites a component index template that can be used in a composable index template.- Specified by:
putComponentTemplatein interfaceReactiveIndexOperations- Parameters:
putComponentTemplateRequest- index template request parameters- Returns:
- true if successful
-
getComponentTemplate
public reactor.core.publisher.Flux<TemplateResponse> getComponentTemplate(GetComponentTemplateRequest getComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsGet component template(s).- Specified by:
getComponentTemplatein interfaceReactiveIndexOperations- Parameters:
getComponentTemplateRequest- the getComponentTemplateRequest parameters- Returns:
- a
FluxofTemplateResponse
-
existsComponentTemplate
public reactor.core.publisher.Mono<Boolean> existsComponentTemplate(ExistsComponentTemplateRequest existsComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsChecks wether a component index template exists.- Specified by:
existsComponentTemplatein interfaceReactiveIndexOperations- Parameters:
existsComponentTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the componentTemplate exists.
-
deleteComponentTemplate
public reactor.core.publisher.Mono<Boolean> deleteComponentTemplate(DeleteComponentTemplateRequest deleteComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsDeletes a component index template.- Specified by:
deleteComponentTemplatein interfaceReactiveIndexOperations- Parameters:
deleteComponentTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the request was acknowledged.
-
putIndexTemplate
public reactor.core.publisher.Mono<Boolean> putIndexTemplate(PutIndexTemplateRequest putIndexTemplateRequest) Description copied from interface:ReactiveIndexOperationsCreates an index template.- Specified by:
putIndexTemplatein interfaceReactiveIndexOperations- Parameters:
putIndexTemplateRequest- template request parameters- Returns:
- true if successful
-
existsIndexTemplate
public reactor.core.publisher.Mono<Boolean> existsIndexTemplate(ExistsIndexTemplateRequest existsIndexTemplateRequest) Description copied from interface:ReactiveIndexOperationsChecks if an index template exists.- Specified by:
existsIndexTemplatein interfaceReactiveIndexOperations- Parameters:
existsIndexTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the index template exists.
-
getIndexTemplate
public reactor.core.publisher.Flux<TemplateResponse> getIndexTemplate(GetIndexTemplateRequest getIndexTemplateRequest) Description copied from interface:ReactiveIndexOperationsGet index template(s).- Specified by:
getIndexTemplatein interfaceReactiveIndexOperations- Returns:
- a
FluxofTemplateResponse
-
deleteIndexTemplate
public reactor.core.publisher.Mono<Boolean> deleteIndexTemplate(DeleteIndexTemplateRequest deleteIndexTemplateRequest) Description copied from interface:ReactiveIndexOperationsDeletes an index template.- Specified by:
deleteIndexTemplatein interfaceReactiveIndexOperations- Parameters:
deleteIndexTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the request was acknowledged.
-
getTemplate
Description copied from interface:ReactiveIndexOperationsgets an index template using the legacy Elasticsearch interface.- Specified by:
getTemplatein interfaceReactiveIndexOperations- Parameters:
getTemplateRequest- the request parameters- Returns:
- Mono of TemplateData, Mono.empty() if no template with the given name exists.
-
existsTemplate
public reactor.core.publisher.Mono<Boolean> existsTemplate(ExistsTemplateRequest existsTemplateRequest) Description copied from interface:ReactiveIndexOperationsChecks if an index template exists using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
existsTemplatein interfaceReactiveIndexOperations- Parameters:
existsTemplateRequest- template request parameters- Returns:
- Mono of true if the template exists
-
deleteTemplate
public reactor.core.publisher.Mono<Boolean> deleteTemplate(DeleteTemplateRequest deleteTemplateRequest) Description copied from interface:ReactiveIndexOperationsDeletes an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
deleteTemplatein interfaceReactiveIndexOperations- Parameters:
deleteTemplateRequest- template request parameters- Returns:
- Mono of true if the template could be deleted
-
getInformation
Description copied from interface:ReactiveIndexOperationsGets theIndexInformationfor the indices defined byReactiveIndexOperations.getIndexCoordinates().- Specified by:
getInformationin interfaceReactiveIndexOperations- Returns:
- a flux of
IndexInformation
-
getIndexCoordinates
Description copied from interface:ReactiveIndexOperationsget the currentIndexCoordinates. These may change over time when the entity class has a SpEL constructed index name. When this IndexOperations is not bound to a class, the bound IndexCoordinates are returned.- Specified by:
getIndexCoordinatesin interfaceReactiveIndexOperations- Returns:
- IndexCoordinates
-