34
34
import org .elasticsearch .action .admin .indices .flush .SyncedFlushRequest ;
35
35
import org .elasticsearch .action .admin .indices .forcemerge .ForceMergeRequest ;
36
36
import org .elasticsearch .action .admin .indices .forcemerge .ForceMergeResponse ;
37
- import org .elasticsearch .action .admin .indices .get .GetIndexRequest ;
38
- import org .elasticsearch .action .admin .indices .get .GetIndexResponse ;
39
- import org .elasticsearch .client .indices .GetFieldMappingsRequest ;
40
- import org .elasticsearch .client .indices .GetFieldMappingsResponse ;
41
37
import org .elasticsearch .action .admin .indices .open .OpenIndexRequest ;
42
38
import org .elasticsearch .action .admin .indices .open .OpenIndexResponse ;
43
39
import org .elasticsearch .action .admin .indices .refresh .RefreshRequest ;
44
40
import org .elasticsearch .action .admin .indices .refresh .RefreshResponse ;
45
- import org .elasticsearch .action .admin .indices .rollover .RolloverRequest ;
46
- import org .elasticsearch .action .admin .indices .rollover .RolloverResponse ;
47
41
import org .elasticsearch .action .admin .indices .settings .get .GetSettingsRequest ;
48
42
import org .elasticsearch .action .admin .indices .settings .get .GetSettingsResponse ;
49
43
import org .elasticsearch .action .admin .indices .settings .put .UpdateSettingsRequest ;
57
51
import org .elasticsearch .client .indices .CreateIndexRequest ;
58
52
import org .elasticsearch .client .indices .CreateIndexResponse ;
59
53
import org .elasticsearch .client .indices .FreezeIndexRequest ;
54
+ import org .elasticsearch .client .indices .GetFieldMappingsRequest ;
55
+ import org .elasticsearch .client .indices .GetFieldMappingsResponse ;
56
+ import org .elasticsearch .client .indices .GetIndexRequest ;
57
+ import org .elasticsearch .client .indices .GetIndexResponse ;
60
58
import org .elasticsearch .client .indices .GetIndexTemplatesRequest ;
61
59
import org .elasticsearch .client .indices .GetMappingsRequest ;
62
60
import org .elasticsearch .client .indices .GetMappingsResponse ;
65
63
import org .elasticsearch .client .indices .PutIndexTemplateRequest ;
66
64
import org .elasticsearch .client .indices .PutMappingRequest ;
67
65
import org .elasticsearch .client .indices .UnfreezeIndexRequest ;
66
+ import org .elasticsearch .client .indices .rollover .RolloverRequest ;
67
+ import org .elasticsearch .client .indices .rollover .RolloverResponse ;
68
68
import org .elasticsearch .rest .RestStatus ;
69
69
70
70
import java .io .IOException ;
@@ -901,6 +901,41 @@ public void getAsync(GetIndexRequest getIndexRequest, RequestOptions options,
901
901
GetIndexResponse ::fromXContent , listener , emptySet ());
902
902
}
903
903
904
+ /**
905
+ * Retrieve information about one or more indexes
906
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html">
907
+ * Indices Get Index API on elastic.co</a>
908
+ * @param getIndexRequest the request
909
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
910
+ * @return the response
911
+ * @throws IOException in case there is a problem sending the request or parsing back the response
912
+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
913
+ * {@link #get(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object.
914
+ */
915
+ @ Deprecated
916
+ public org .elasticsearch .action .admin .indices .get .GetIndexResponse get (
917
+ org .elasticsearch .action .admin .indices .get .GetIndexRequest getIndexRequest , RequestOptions options ) throws IOException {
918
+ return restHighLevelClient .performRequestAndParseEntity (getIndexRequest , IndicesRequestConverters ::getIndex , options ,
919
+ org .elasticsearch .action .admin .indices .get .GetIndexResponse ::fromXContent , emptySet ());
920
+ }
921
+
922
+ /**
923
+ * Retrieve information about one or more indexes
924
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html">
925
+ * Indices Get Index API on elastic.co</a>
926
+ * @param getIndexRequest the request
927
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
928
+ * @param listener the listener to be notified upon request completion
929
+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
930
+ * {@link #getAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object.
931
+ */
932
+ @ Deprecated
933
+ public void getAsync (org .elasticsearch .action .admin .indices .get .GetIndexRequest getIndexRequest , RequestOptions options ,
934
+ ActionListener <org .elasticsearch .action .admin .indices .get .GetIndexResponse > listener ) {
935
+ restHighLevelClient .performRequestAsyncAndParseEntity (getIndexRequest , IndicesRequestConverters ::getIndex , options ,
936
+ org .elasticsearch .action .admin .indices .get .GetIndexResponse ::fromXContent , listener , emptySet ());
937
+ }
938
+
904
939
/**
905
940
* Force merge one or more indices using the Force Merge API.
906
941
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html">
@@ -1058,15 +1093,38 @@ public boolean exists(GetIndexRequest request, RequestOptions options) throws IO
1058
1093
);
1059
1094
}
1060
1095
1096
+ /**
1097
+ * Checks if the index (indices) exists or not.
1098
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
1099
+ * Indices Exists API on elastic.co</a>
1100
+ * @param request the request
1101
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1102
+ * @return the response
1103
+ * @throws IOException in case there is a problem sending the request
1104
+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1105
+ * {@link #exists(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object.
1106
+ */
1107
+ @ Deprecated
1108
+ public boolean exists (org .elasticsearch .action .admin .indices .get .GetIndexRequest request , RequestOptions options ) throws IOException {
1109
+ return restHighLevelClient .performRequest (
1110
+ request ,
1111
+ IndicesRequestConverters ::indicesExist ,
1112
+ options ,
1113
+ RestHighLevelClient ::convertExistsResponse ,
1114
+ Collections .emptySet ()
1115
+ );
1116
+ }
1117
+
1061
1118
/**
1062
1119
* Checks if the index (indices) exists or not.
1063
1120
* <p>
1064
1121
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
1065
1122
* Indices Exists API on elastic.co</a>
1066
- * @deprecated Prefer {@link #exists(GetIndexRequest, RequestOptions)}
1123
+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1124
+ * {@link #exists(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object.
1067
1125
*/
1068
1126
@ Deprecated
1069
- public boolean exists (GetIndexRequest request , Header ... headers ) throws IOException {
1127
+ public boolean exists (org . elasticsearch . action . admin . indices . get . GetIndexRequest request , Header ... headers ) throws IOException {
1070
1128
return restHighLevelClient .performRequest (
1071
1129
request ,
1072
1130
IndicesRequestConverters ::indicesExist ,
@@ -1095,15 +1153,40 @@ public void existsAsync(GetIndexRequest request, RequestOptions options, ActionL
1095
1153
);
1096
1154
}
1097
1155
1156
+ /**
1157
+ * Asynchronously checks if the index (indices) exists or not.
1158
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
1159
+ * Indices Exists API on elastic.co</a>
1160
+ * @param request the request
1161
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1162
+ * @param listener the listener to be notified upon request completion
1163
+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1164
+ * {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object.
1165
+ */
1166
+ @ Deprecated
1167
+ public void existsAsync (org .elasticsearch .action .admin .indices .get .GetIndexRequest request , RequestOptions options ,
1168
+ ActionListener <Boolean > listener ) {
1169
+ restHighLevelClient .performRequestAsync (
1170
+ request ,
1171
+ IndicesRequestConverters ::indicesExist ,
1172
+ options ,
1173
+ RestHighLevelClient ::convertExistsResponse ,
1174
+ listener ,
1175
+ Collections .emptySet ()
1176
+ );
1177
+ }
1178
+
1098
1179
/**
1099
1180
* Asynchronously checks if the index (indices) exists or not.
1100
1181
* <p>
1101
1182
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
1102
1183
* Indices Exists API on elastic.co</a>
1103
- * @deprecated Prefer {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)}
1184
+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1185
+ * {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object.
1104
1186
*/
1105
1187
@ Deprecated
1106
- public void existsAsync (GetIndexRequest request , ActionListener <Boolean > listener , Header ... headers ) {
1188
+ public void existsAsync (org .elasticsearch .action .admin .indices .get .GetIndexRequest request , ActionListener <Boolean > listener ,
1189
+ Header ... headers ) {
1107
1190
restHighLevelClient .performRequestAsync (
1108
1191
request ,
1109
1192
IndicesRequestConverters ::indicesExist ,
@@ -1234,17 +1317,54 @@ public RolloverResponse rollover(RolloverRequest rolloverRequest, RequestOptions
1234
1317
RolloverResponse ::fromXContent , emptySet ());
1235
1318
}
1236
1319
1320
+ /**
1321
+ * Asynchronously rolls over an index using the Rollover Index API.
1322
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
1323
+ * Rollover Index API on elastic.co</a>
1324
+ * @param rolloverRequest the request
1325
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1326
+ * @param listener the listener to be notified upon request completion
1327
+ */
1328
+ public void rolloverAsync (RolloverRequest rolloverRequest , RequestOptions options , ActionListener <RolloverResponse > listener ) {
1329
+ restHighLevelClient .performRequestAsyncAndParseEntity (rolloverRequest , IndicesRequestConverters ::rollover , options ,
1330
+ RolloverResponse ::fromXContent , listener , emptySet ());
1331
+ }
1332
+
1333
+ /**
1334
+ * Rolls over an index using the Rollover Index API.
1335
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
1336
+ * Rollover Index API on elastic.co</a>
1337
+ * @param rolloverRequest the request
1338
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1339
+ * @return the response
1340
+ * @throws IOException in case there is a problem sending the request or parsing back the response
1341
+ *
1342
+ * @deprecated This method uses deprecated request and response objects.
1343
+ * The method {@link #rollover(RolloverRequest, RequestOptions)} should be used instead, which accepts a new request object.
1344
+ */
1345
+ @ Deprecated
1346
+ public org .elasticsearch .action .admin .indices .rollover .RolloverResponse rollover (
1347
+ org .elasticsearch .action .admin .indices .rollover .RolloverRequest rolloverRequest ,
1348
+ RequestOptions options ) throws IOException {
1349
+ return restHighLevelClient .performRequestAndParseEntity (rolloverRequest , IndicesRequestConverters ::rollover , options ,
1350
+ org .elasticsearch .action .admin .indices .rollover .RolloverResponse ::fromXContent , emptySet ());
1351
+ }
1352
+
1237
1353
/**
1238
1354
* Rolls over an index using the Rollover Index API.
1239
1355
* <p>
1240
1356
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
1241
1357
* Rollover Index API on elastic.co</a>
1242
- * @deprecated Prefer {@link #rollover(RolloverRequest, RequestOptions)}
1358
+ *
1359
+ * @deprecated This method uses deprecated request and response objects.
1360
+ * The method {@link #rollover(RolloverRequest, RequestOptions)} should be used instead, which accepts a new request object.
1243
1361
*/
1244
1362
@ Deprecated
1245
- public RolloverResponse rollover (RolloverRequest rolloverRequest , Header ... headers ) throws IOException {
1363
+ public org .elasticsearch .action .admin .indices .rollover .RolloverResponse rollover (
1364
+ org .elasticsearch .action .admin .indices .rollover .RolloverRequest rolloverRequest ,
1365
+ Header ... headers ) throws IOException {
1246
1366
return restHighLevelClient .performRequestAndParseEntity (rolloverRequest , IndicesRequestConverters ::rollover ,
1247
- RolloverResponse ::fromXContent , emptySet (), headers );
1367
+ org . elasticsearch . action . admin . indices . rollover . RolloverResponse ::fromXContent , emptySet (), headers );
1248
1368
}
1249
1369
1250
1370
/**
@@ -1254,23 +1374,33 @@ public RolloverResponse rollover(RolloverRequest rolloverRequest, Header... head
1254
1374
* @param rolloverRequest the request
1255
1375
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1256
1376
* @param listener the listener to be notified upon request completion
1377
+ *
1378
+ * @deprecated This method uses deprecated request and response objects.
1379
+ * The method {@link #rolloverAsync(RolloverRequest, RequestOptions, ActionListener)} should be used instead, which
1380
+ * accepts a new request object.
1257
1381
*/
1258
- public void rolloverAsync (RolloverRequest rolloverRequest , RequestOptions options , ActionListener <RolloverResponse > listener ) {
1382
+ @ Deprecated
1383
+ public void rolloverAsync (org .elasticsearch .action .admin .indices .rollover .RolloverRequest rolloverRequest ,
1384
+ RequestOptions options , ActionListener <org .elasticsearch .action .admin .indices .rollover .RolloverResponse > listener ) {
1259
1385
restHighLevelClient .performRequestAsyncAndParseEntity (rolloverRequest , IndicesRequestConverters ::rollover , options ,
1260
- RolloverResponse ::fromXContent , listener , emptySet ());
1386
+ org . elasticsearch . action . admin . indices . rollover . RolloverResponse ::fromXContent , listener , emptySet ());
1261
1387
}
1262
1388
1263
1389
/**
1264
1390
* Asynchronously rolls over an index using the Rollover Index API.
1265
1391
* <p>
1266
1392
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
1267
1393
* Rollover Index API on elastic.co</a>
1268
- * @deprecated Prefer {@link #rolloverAsync(RolloverRequest, RequestOptions, ActionListener)}
1394
+ *
1395
+ * @deprecated This method uses deprecated request and response objects.
1396
+ * The method {@link #rolloverAsync(RolloverRequest, RequestOptions, ActionListener)} should be used instead, which
1397
+ * accepts a new request object.
1269
1398
*/
1270
1399
@ Deprecated
1271
- public void rolloverAsync (RolloverRequest rolloverRequest , ActionListener <RolloverResponse > listener , Header ... headers ) {
1400
+ public void rolloverAsync (org .elasticsearch .action .admin .indices .rollover .RolloverRequest rolloverRequest ,
1401
+ ActionListener <org .elasticsearch .action .admin .indices .rollover .RolloverResponse > listener , Header ... headers ) {
1272
1402
restHighLevelClient .performRequestAsyncAndParseEntity (rolloverRequest , IndicesRequestConverters ::rollover ,
1273
- RolloverResponse ::fromXContent , listener , emptySet (), headers );
1403
+ org . elasticsearch . action . admin . indices . rollover . RolloverResponse ::fromXContent , listener , emptySet (), headers );
1274
1404
}
1275
1405
1276
1406
/**
0 commit comments