|
1 | 1 | /*
|
2 | 2 | * Copyright 2019-2023 the original author or authors.
|
3 | 3 | *
|
4 |
| - * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License", @Nullable RefreshPolicy refreshPolicy); |
5 | 5 | * you may not use this file except in compliance with the License.
|
6 | 6 | * You may obtain a copy of the License at
|
7 | 7 | *
|
|
15 | 15 | */
|
16 | 16 | package org.springframework.data.elasticsearch.repository;
|
17 | 17 |
|
| 18 | +import reactor.core.publisher.Flux; |
| 19 | +import reactor.core.publisher.Mono; |
| 20 | + |
| 21 | +import org.reactivestreams.Publisher; |
| 22 | +import org.springframework.data.elasticsearch.core.RefreshPolicy; |
18 | 23 | import org.springframework.data.repository.NoRepositoryBean;
|
19 | 24 | import org.springframework.data.repository.reactive.ReactiveCrudRepository;
|
20 | 25 | import org.springframework.data.repository.reactive.ReactiveSortingRepository;
|
| 26 | +import org.springframework.lang.Nullable; |
21 | 27 |
|
22 | 28 | /**
|
23 | 29 | * Elasticsearch specific {@link org.springframework.data.repository.Repository} interface with reactive support.
|
24 | 30 | *
|
25 | 31 | * @author Christoph Strobl
|
26 | 32 | * @since 3.2
|
27 | 33 | */
|
| 34 | +@SuppressWarnings("unused") |
28 | 35 | @NoRepositoryBean
|
29 | 36 | public interface ReactiveElasticsearchRepository<T, ID>
|
30 |
| - extends ReactiveSortingRepository<T, ID>, ReactiveCrudRepository<T, ID> {} |
| 37 | + extends ReactiveSortingRepository<T, ID>, ReactiveCrudRepository<T, ID> { |
| 38 | + /** |
| 39 | + * @since 5.2 |
| 40 | + */ |
| 41 | + <S extends T> Mono<S> save(S entity, @Nullable RefreshPolicy refreshPolicy); |
| 42 | + |
| 43 | + /** |
| 44 | + * @since 5.2 |
| 45 | + */ |
| 46 | + <S extends T> Flux<S> saveAll(Iterable<S> entities, @Nullable RefreshPolicy refreshPolicy); |
| 47 | + |
| 48 | + /** |
| 49 | + * @since 5.2 |
| 50 | + */ |
| 51 | + <S extends T> Flux<S> saveAll(Publisher<S> entityStream, @Nullable RefreshPolicy refreshPolicy); |
| 52 | + |
| 53 | + /** |
| 54 | + * @since 5.2 |
| 55 | + */ |
| 56 | + Mono<Void> deleteById(ID id, @Nullable RefreshPolicy refreshPolicy); |
| 57 | + |
| 58 | + /** |
| 59 | + * @since 5.2 |
| 60 | + */ |
| 61 | + Mono<Void> deleteById(Publisher<ID> id, @Nullable RefreshPolicy refreshPolicy); |
| 62 | + |
| 63 | + /** |
| 64 | + * @since 5.2 |
| 65 | + */ |
| 66 | + Mono<Void> delete(T entity, @Nullable RefreshPolicy refreshPolicy); |
| 67 | + |
| 68 | + /** |
| 69 | + * @since 5.2 |
| 70 | + */ |
| 71 | + Mono<Void> deleteAllById(Iterable<? extends ID> ids, @Nullable RefreshPolicy refreshPolicy); |
| 72 | + |
| 73 | + /** |
| 74 | + * @since 5.2 |
| 75 | + */ |
| 76 | + Mono<Void> deleteAll(Iterable<? extends T> entities, @Nullable RefreshPolicy refreshPolicy); |
| 77 | + |
| 78 | + /** |
| 79 | + * @since 5.2 |
| 80 | + */ |
| 81 | + Mono<Void> deleteAll(Publisher<? extends T> entityStream, @Nullable RefreshPolicy refreshPolicy); |
| 82 | + |
| 83 | + /** |
| 84 | + * @since 5.2 |
| 85 | + */ |
| 86 | + Mono<Void> deleteAll(@Nullable RefreshPolicy refreshPolicy); |
| 87 | +} |
0 commit comments