@@ -237,12 +237,29 @@ public void getRoleMappingsAsync(final GetRoleMappingsRequest request, final Req
237
237
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
238
238
* @return the response from the enable user call
239
239
* @throws IOException in case there is a problem sending the request or parsing back the response
240
+ * @deprecated use {@link #enableUser(RequestOptions, EnableUserRequest)} instead
240
241
*/
242
+ @ Deprecated
241
243
public EmptyResponse enableUser (EnableUserRequest request , RequestOptions options ) throws IOException {
242
244
return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::enableUser , options ,
243
245
EmptyResponse ::fromXContent , emptySet ());
244
246
}
245
247
248
+ /**
249
+ * Enable a native realm or built-in user synchronously.
250
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html">
251
+ * the docs</a> for more.
252
+ *
253
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
254
+ * @param request the request with the user to enable
255
+ * @return {@code true} if the request succeeded (the user is enabled)
256
+ * @throws IOException in case there is a problem sending the request or parsing back the response
257
+ */
258
+ public boolean enableUser (RequestOptions options , EnableUserRequest request ) throws IOException {
259
+ return restHighLevelClient .performRequest (request , SecurityRequestConverters ::enableUser , options ,
260
+ RestHighLevelClient ::convertExistsResponse , emptySet ());
261
+ }
262
+
246
263
/**
247
264
* Enable a native realm or built-in user asynchronously.
248
265
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html">
@@ -251,13 +268,30 @@ public EmptyResponse enableUser(EnableUserRequest request, RequestOptions option
251
268
* @param request the request with the user to enable
252
269
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
253
270
* @param listener the listener to be notified upon request completion
271
+ * @deprecated use {@link #enableUserAsync(RequestOptions, EnableUserRequest, ActionListener)} instead
254
272
*/
273
+ @ Deprecated
255
274
public void enableUserAsync (EnableUserRequest request , RequestOptions options ,
256
275
ActionListener <EmptyResponse > listener ) {
257
276
restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::enableUser , options ,
258
277
EmptyResponse ::fromXContent , listener , emptySet ());
259
278
}
260
279
280
+ /**
281
+ * Enable a native realm or built-in user asynchronously.
282
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html">
283
+ * the docs</a> for more.
284
+ *
285
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
286
+ * @param request the request with the user to enable
287
+ * @param listener the listener to be notified upon request completion
288
+ */
289
+ public void enableUserAsync (RequestOptions options , EnableUserRequest request ,
290
+ ActionListener <Boolean > listener ) {
291
+ restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::enableUser , options ,
292
+ RestHighLevelClient ::convertExistsResponse , listener , emptySet ());
293
+ }
294
+
261
295
/**
262
296
* Disable a native realm or built-in user synchronously.
263
297
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html">
@@ -267,12 +301,29 @@ public void enableUserAsync(EnableUserRequest request, RequestOptions options,
267
301
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
268
302
* @return the response from the enable user call
269
303
* @throws IOException in case there is a problem sending the request or parsing back the response
304
+ * @deprecated use {@link #disableUser(RequestOptions, DisableUserRequest)} instead
270
305
*/
306
+ @ Deprecated
271
307
public EmptyResponse disableUser (DisableUserRequest request , RequestOptions options ) throws IOException {
272
308
return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::disableUser , options ,
273
309
EmptyResponse ::fromXContent , emptySet ());
274
310
}
275
311
312
+ /**
313
+ * Disable a native realm or built-in user synchronously.
314
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html">
315
+ * the docs</a> for more.
316
+ *
317
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
318
+ * @param request the request with the user to disable
319
+ * @return {@code true} if the request succeeded (the user is disabled)
320
+ * @throws IOException in case there is a problem sending the request or parsing back the response
321
+ */
322
+ public boolean disableUser (RequestOptions options , DisableUserRequest request ) throws IOException {
323
+ return restHighLevelClient .performRequest (request , SecurityRequestConverters ::disableUser , options ,
324
+ RestHighLevelClient ::convertExistsResponse , emptySet ());
325
+ }
326
+
276
327
/**
277
328
* Disable a native realm or built-in user asynchronously.
278
329
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html">
@@ -281,13 +332,30 @@ public EmptyResponse disableUser(DisableUserRequest request, RequestOptions opti
281
332
* @param request the request with the user to disable
282
333
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
283
334
* @param listener the listener to be notified upon request completion
335
+ * @deprecated use {@link #disableUserAsync(RequestOptions, DisableUserRequest, ActionListener)} instead
284
336
*/
337
+ @ Deprecated
285
338
public void disableUserAsync (DisableUserRequest request , RequestOptions options ,
286
339
ActionListener <EmptyResponse > listener ) {
287
340
restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::disableUser , options ,
288
341
EmptyResponse ::fromXContent , listener , emptySet ());
289
342
}
290
343
344
+ /**
345
+ * Disable a native realm or built-in user asynchronously.
346
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html">
347
+ * the docs</a> for more.
348
+ *
349
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
350
+ * @param request the request with the user to disable
351
+ * @param listener the listener to be notified upon request completion
352
+ */
353
+ public void disableUserAsync (RequestOptions options , DisableUserRequest request ,
354
+ ActionListener <Boolean > listener ) {
355
+ restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::disableUser , options ,
356
+ RestHighLevelClient ::convertExistsResponse , listener , emptySet ());
357
+ }
358
+
291
359
/**
292
360
* Authenticate the current user and return all the information about the authenticated user.
293
361
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html">
@@ -457,12 +525,29 @@ public void getSslCertificatesAsync(RequestOptions options, ActionListener<GetSs
457
525
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
458
526
* @return the response from the change user password call
459
527
* @throws IOException in case there is a problem sending the request or parsing back the response
528
+ * @deprecated use {@link #changePassword(RequestOptions, ChangePasswordRequest)} instead
460
529
*/
530
+ @ Deprecated
461
531
public EmptyResponse changePassword (ChangePasswordRequest request , RequestOptions options ) throws IOException {
462
532
return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::changePassword , options ,
463
533
EmptyResponse ::fromXContent , emptySet ());
464
534
}
465
535
536
+ /**
537
+ * Change the password of a user of a native realm or built-in user synchronously.
538
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html">
539
+ * the docs</a> for more.
540
+ *
541
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
542
+ * @param request the request with the user's new password
543
+ * @return {@code true} if the request succeeded (the new password was set)
544
+ * @throws IOException in case there is a problem sending the request or parsing back the response
545
+ */
546
+ public boolean changePassword (RequestOptions options , ChangePasswordRequest request ) throws IOException {
547
+ return restHighLevelClient .performRequest (request , SecurityRequestConverters ::changePassword , options ,
548
+ RestHighLevelClient ::convertExistsResponse , emptySet ());
549
+ }
550
+
466
551
/**
467
552
* Change the password of a user of a native realm or built-in user asynchronously.
468
553
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html">
@@ -471,13 +556,31 @@ public EmptyResponse changePassword(ChangePasswordRequest request, RequestOption
471
556
* @param request the request with the user's new password
472
557
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
473
558
* @param listener the listener to be notified upon request completion
559
+ * @deprecated use {@link #changePasswordAsync(RequestOptions, ChangePasswordRequest, ActionListener)} instead
474
560
*/
561
+ @ Deprecated
475
562
public void changePasswordAsync (ChangePasswordRequest request , RequestOptions options ,
476
563
ActionListener <EmptyResponse > listener ) {
477
564
restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::changePassword , options ,
478
565
EmptyResponse ::fromXContent , listener , emptySet ());
479
566
}
480
567
568
+ /**
569
+ * Change the password of a user of a native realm or built-in user asynchronously.
570
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html">
571
+ * the docs</a> for more.
572
+ *
573
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
574
+ * @param request the request with the user's new password
575
+ * @param listener the listener to be notified upon request completion
576
+ */
577
+ public void changePasswordAsync (RequestOptions options , ChangePasswordRequest request ,
578
+ ActionListener <Boolean > listener ) {
579
+ restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::changePassword , options ,
580
+ RestHighLevelClient ::convertExistsResponse , listener , emptySet ());
581
+ }
582
+
583
+
481
584
/**
482
585
* Delete a role mapping.
483
586
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">
0 commit comments