21
21
22
22
import org .elasticsearch .action .ActionListener ;
23
23
import org .elasticsearch .action .admin .indices .alias .IndicesAliasesRequest ;
24
- import org .elasticsearch .action .admin .indices .alias .IndicesAliasesResponse ;
25
24
import org .elasticsearch .action .admin .indices .alias .get .GetAliasesRequest ;
26
25
import org .elasticsearch .action .admin .indices .analyze .AnalyzeRequest ;
27
26
import org .elasticsearch .action .admin .indices .analyze .AnalyzeResponse ;
28
27
import org .elasticsearch .action .admin .indices .cache .clear .ClearIndicesCacheRequest ;
29
28
import org .elasticsearch .action .admin .indices .cache .clear .ClearIndicesCacheResponse ;
30
29
import org .elasticsearch .action .admin .indices .close .CloseIndexRequest ;
31
- import org .elasticsearch .action .admin .indices .close .CloseIndexResponse ;
32
30
import org .elasticsearch .action .admin .indices .create .CreateIndexRequest ;
33
31
import org .elasticsearch .action .admin .indices .create .CreateIndexResponse ;
34
32
import org .elasticsearch .action .admin .indices .delete .DeleteIndexRequest ;
35
- import org .elasticsearch .action .admin .indices .delete .DeleteIndexResponse ;
36
33
import org .elasticsearch .action .admin .indices .flush .FlushRequest ;
37
34
import org .elasticsearch .action .admin .indices .flush .FlushResponse ;
38
35
import org .elasticsearch .action .admin .indices .flush .SyncedFlushRequest ;
45
42
import org .elasticsearch .action .admin .indices .mapping .get .GetMappingsRequest ;
46
43
import org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse ;
47
44
import org .elasticsearch .action .admin .indices .mapping .put .PutMappingRequest ;
48
- import org .elasticsearch .action .admin .indices .mapping .put .PutMappingResponse ;
49
45
import org .elasticsearch .action .admin .indices .open .OpenIndexRequest ;
50
46
import org .elasticsearch .action .admin .indices .open .OpenIndexResponse ;
51
47
import org .elasticsearch .action .admin .indices .refresh .RefreshRequest ;
55
51
import org .elasticsearch .action .admin .indices .settings .get .GetSettingsRequest ;
56
52
import org .elasticsearch .action .admin .indices .settings .get .GetSettingsResponse ;
57
53
import org .elasticsearch .action .admin .indices .settings .put .UpdateSettingsRequest ;
58
- import org .elasticsearch .action .admin .indices .settings .put .UpdateSettingsResponse ;
59
54
import org .elasticsearch .action .admin .indices .shrink .ResizeRequest ;
60
55
import org .elasticsearch .action .admin .indices .shrink .ResizeResponse ;
61
56
import org .elasticsearch .action .admin .indices .template .get .GetIndexTemplatesRequest ;
62
57
import org .elasticsearch .action .admin .indices .template .get .GetIndexTemplatesResponse ;
63
58
import org .elasticsearch .action .admin .indices .template .put .PutIndexTemplateRequest ;
64
- import org .elasticsearch .action .admin .indices .template .put .PutIndexTemplateResponse ;
65
59
import org .elasticsearch .action .admin .indices .validate .query .ValidateQueryRequest ;
66
60
import org .elasticsearch .action .admin .indices .validate .query .ValidateQueryResponse ;
61
+ import org .elasticsearch .action .support .master .AcknowledgedResponse ;
67
62
import org .elasticsearch .rest .RestStatus ;
68
63
69
64
import java .io .IOException ;
@@ -93,9 +88,9 @@ public final class IndicesClient {
93
88
* @return the response
94
89
* @throws IOException in case there is a problem sending the request or parsing back the response
95
90
*/
96
- public DeleteIndexResponse delete (DeleteIndexRequest deleteIndexRequest , RequestOptions options ) throws IOException {
91
+ public AcknowledgedResponse delete (DeleteIndexRequest deleteIndexRequest , RequestOptions options ) throws IOException {
97
92
return restHighLevelClient .performRequestAndParseEntity (deleteIndexRequest , RequestConverters ::deleteIndex , options ,
98
- DeleteIndexResponse ::fromXContent , emptySet ());
93
+ AcknowledgedResponse ::fromXContent , emptySet ());
99
94
}
100
95
101
96
/**
@@ -106,9 +101,9 @@ public DeleteIndexResponse delete(DeleteIndexRequest deleteIndexRequest, Request
106
101
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
107
102
* @param listener the listener to be notified upon request completion
108
103
*/
109
- public void deleteAsync (DeleteIndexRequest deleteIndexRequest , RequestOptions options , ActionListener <DeleteIndexResponse > listener ) {
104
+ public void deleteAsync (DeleteIndexRequest deleteIndexRequest , RequestOptions options , ActionListener <AcknowledgedResponse > listener ) {
110
105
restHighLevelClient .performRequestAsyncAndParseEntity (deleteIndexRequest , RequestConverters ::deleteIndex , options ,
111
- DeleteIndexResponse ::fromXContent , listener , emptySet ());
106
+ AcknowledgedResponse ::fromXContent , listener , emptySet ());
112
107
}
113
108
114
109
/**
@@ -147,9 +142,9 @@ public void createAsync(CreateIndexRequest createIndexRequest, RequestOptions op
147
142
* @return the response
148
143
* @throws IOException in case there is a problem sending the request or parsing back the response
149
144
*/
150
- public PutMappingResponse putMapping (PutMappingRequest putMappingRequest , RequestOptions options ) throws IOException {
145
+ public AcknowledgedResponse putMapping (PutMappingRequest putMappingRequest , RequestOptions options ) throws IOException {
151
146
return restHighLevelClient .performRequestAndParseEntity (putMappingRequest , RequestConverters ::putMapping , options ,
152
- PutMappingResponse ::fromXContent , emptySet ());
147
+ AcknowledgedResponse ::fromXContent , emptySet ());
153
148
}
154
149
155
150
/**
@@ -160,9 +155,10 @@ public PutMappingResponse putMapping(PutMappingRequest putMappingRequest, Reques
160
155
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
161
156
* @param listener the listener to be notified upon request completion
162
157
*/
163
- public void putMappingAsync (PutMappingRequest putMappingRequest , RequestOptions options , ActionListener <PutMappingResponse > listener ) {
158
+ public void putMappingAsync (PutMappingRequest putMappingRequest , RequestOptions options ,
159
+ ActionListener <AcknowledgedResponse > listener ) {
164
160
restHighLevelClient .performRequestAsyncAndParseEntity (putMappingRequest , RequestConverters ::putMapping , options ,
165
- PutMappingResponse ::fromXContent , listener , emptySet ());
161
+ AcknowledgedResponse ::fromXContent , listener , emptySet ());
166
162
}
167
163
168
164
/**
@@ -231,9 +227,9 @@ public void getFieldMappingAsync(GetFieldMappingsRequest getFieldMappingsRequest
231
227
* @return the response
232
228
* @throws IOException in case there is a problem sending the request or parsing back the response
233
229
*/
234
- public IndicesAliasesResponse updateAliases (IndicesAliasesRequest indicesAliasesRequest , RequestOptions options ) throws IOException {
230
+ public AcknowledgedResponse updateAliases (IndicesAliasesRequest indicesAliasesRequest , RequestOptions options ) throws IOException {
235
231
return restHighLevelClient .performRequestAndParseEntity (indicesAliasesRequest , RequestConverters ::updateAliases , options ,
236
- IndicesAliasesResponse ::fromXContent , emptySet ());
232
+ AcknowledgedResponse ::fromXContent , emptySet ());
237
233
}
238
234
239
235
/**
@@ -245,9 +241,9 @@ public IndicesAliasesResponse updateAliases(IndicesAliasesRequest indicesAliases
245
241
* @param listener the listener to be notified upon request completion
246
242
*/
247
243
public void updateAliasesAsync (IndicesAliasesRequest indicesAliasesRequest , RequestOptions options ,
248
- ActionListener <IndicesAliasesResponse > listener ) {
244
+ ActionListener <AcknowledgedResponse > listener ) {
249
245
restHighLevelClient .performRequestAsyncAndParseEntity (indicesAliasesRequest , RequestConverters ::updateAliases , options ,
250
- IndicesAliasesResponse ::fromXContent , listener , emptySet ());
246
+ AcknowledgedResponse ::fromXContent , listener , emptySet ());
251
247
}
252
248
253
249
/**
@@ -286,9 +282,9 @@ public void openAsync(OpenIndexRequest openIndexRequest, RequestOptions options,
286
282
* @return the response
287
283
* @throws IOException in case there is a problem sending the request or parsing back the response
288
284
*/
289
- public CloseIndexResponse close (CloseIndexRequest closeIndexRequest , RequestOptions options ) throws IOException {
285
+ public AcknowledgedResponse close (CloseIndexRequest closeIndexRequest , RequestOptions options ) throws IOException {
290
286
return restHighLevelClient .performRequestAndParseEntity (closeIndexRequest , RequestConverters ::closeIndex , options ,
291
- CloseIndexResponse ::fromXContent , emptySet ());
287
+ AcknowledgedResponse ::fromXContent , emptySet ());
292
288
}
293
289
294
290
/**
@@ -299,9 +295,9 @@ public CloseIndexResponse close(CloseIndexRequest closeIndexRequest, RequestOpti
299
295
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
300
296
* @param listener the listener to be notified upon request completion
301
297
*/
302
- public void closeAsync (CloseIndexRequest closeIndexRequest , RequestOptions options , ActionListener <CloseIndexResponse > listener ) {
298
+ public void closeAsync (CloseIndexRequest closeIndexRequest , RequestOptions options , ActionListener <AcknowledgedResponse > listener ) {
303
299
restHighLevelClient .performRequestAsyncAndParseEntity (closeIndexRequest , RequestConverters ::closeIndex , options ,
304
- CloseIndexResponse ::fromXContent , listener , emptySet ());
300
+ AcknowledgedResponse ::fromXContent , listener , emptySet ());
305
301
}
306
302
307
303
@@ -706,9 +702,9 @@ public void getAliasAsync(GetAliasesRequest getAliasesRequest, RequestOptions op
706
702
* @return the response
707
703
* @throws IOException in case there is a problem sending the request or parsing back the response
708
704
*/
709
- public UpdateSettingsResponse putSettings (UpdateSettingsRequest updateSettingsRequest , RequestOptions options ) throws IOException {
705
+ public AcknowledgedResponse putSettings (UpdateSettingsRequest updateSettingsRequest , RequestOptions options ) throws IOException {
710
706
return restHighLevelClient .performRequestAndParseEntity (updateSettingsRequest , RequestConverters ::indexPutSettings , options ,
711
- UpdateSettingsResponse ::fromXContent , emptySet ());
707
+ AcknowledgedResponse ::fromXContent , emptySet ());
712
708
}
713
709
714
710
/**
@@ -720,9 +716,9 @@ public UpdateSettingsResponse putSettings(UpdateSettingsRequest updateSettingsRe
720
716
* @param listener the listener to be notified upon request completion
721
717
*/
722
718
public void putSettingsAsync (UpdateSettingsRequest updateSettingsRequest , RequestOptions options ,
723
- ActionListener <UpdateSettingsResponse > listener ) {
719
+ ActionListener <AcknowledgedResponse > listener ) {
724
720
restHighLevelClient .performRequestAsyncAndParseEntity (updateSettingsRequest , RequestConverters ::indexPutSettings , options ,
725
- UpdateSettingsResponse ::fromXContent , listener , emptySet ());
721
+ AcknowledgedResponse ::fromXContent , listener , emptySet ());
726
722
}
727
723
728
724
/**
@@ -734,10 +730,10 @@ public void putSettingsAsync(UpdateSettingsRequest updateSettingsRequest, Reques
734
730
* @return the response
735
731
* @throws IOException in case there is a problem sending the request or parsing back the response
736
732
*/
737
- public PutIndexTemplateResponse putTemplate (PutIndexTemplateRequest putIndexTemplateRequest ,
738
- RequestOptions options ) throws IOException {
733
+ public AcknowledgedResponse putTemplate (PutIndexTemplateRequest putIndexTemplateRequest ,
734
+ RequestOptions options ) throws IOException {
739
735
return restHighLevelClient .performRequestAndParseEntity (putIndexTemplateRequest , RequestConverters ::putTemplate , options ,
740
- PutIndexTemplateResponse ::fromXContent , emptySet ());
736
+ AcknowledgedResponse ::fromXContent , emptySet ());
741
737
}
742
738
743
739
/**
@@ -749,9 +745,9 @@ public PutIndexTemplateResponse putTemplate(PutIndexTemplateRequest putIndexTemp
749
745
* @param listener the listener to be notified upon request completion
750
746
*/
751
747
public void putTemplateAsync (PutIndexTemplateRequest putIndexTemplateRequest , RequestOptions options ,
752
- ActionListener <PutIndexTemplateResponse > listener ) {
748
+ ActionListener <AcknowledgedResponse > listener ) {
753
749
restHighLevelClient .performRequestAsyncAndParseEntity (putIndexTemplateRequest , RequestConverters ::putTemplate , options ,
754
- PutIndexTemplateResponse ::fromXContent , listener , emptySet ());
750
+ AcknowledgedResponse ::fromXContent , listener , emptySet ());
755
751
}
756
752
757
753
/**
0 commit comments