38
38
import org .elasticsearch .client .security .DeleteUserRequest ;
39
39
import org .elasticsearch .client .security .DeleteUserResponse ;
40
40
import org .elasticsearch .client .security .DisableUserRequest ;
41
- import org .elasticsearch .client .security .EmptyResponse ;
42
41
import org .elasticsearch .client .security .EnableUserRequest ;
43
42
import org .elasticsearch .client .security .GetPrivilegesRequest ;
44
43
import org .elasticsearch .client .security .GetPrivilegesResponse ;
@@ -235,14 +234,12 @@ public void getRoleMappingsAsync(final GetRoleMappingsRequest request, final Req
235
234
*
236
235
* @param request the request with the user to enable
237
236
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
238
- * @return the response from the enable user call
237
+ * @return {@code true} if the request succeeded (the user is enabled)
239
238
* @throws IOException in case there is a problem sending the request or parsing back the response
240
- * @deprecated use {@link #enableUser(RequestOptions, EnableUserRequest)} instead
241
239
*/
242
- @ Deprecated
243
- public EmptyResponse enableUser (EnableUserRequest request , RequestOptions options ) throws IOException {
244
- return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::enableUser , options ,
245
- EmptyResponse ::fromXContent , emptySet ());
240
+ public boolean enableUser (EnableUserRequest request , RequestOptions options ) throws IOException {
241
+ return restHighLevelClient .performRequest (request , SecurityRequestConverters ::enableUser , options ,
242
+ RestHighLevelClient ::convertExistsResponse , emptySet ());
246
243
}
247
244
248
245
/**
@@ -254,10 +251,11 @@ public EmptyResponse enableUser(EnableUserRequest request, RequestOptions option
254
251
* @param request the request with the user to enable
255
252
* @return {@code true} if the request succeeded (the user is enabled)
256
253
* @throws IOException in case there is a problem sending the request or parsing back the response
254
+ * @deprecated use {@link #enableUser(EnableUserRequest, RequestOptions)} instead
257
255
*/
256
+ @ Deprecated
258
257
public boolean enableUser (RequestOptions options , EnableUserRequest request ) throws IOException {
259
- return restHighLevelClient .performRequest (request , SecurityRequestConverters ::enableUser , options ,
260
- RestHighLevelClient ::convertExistsResponse , emptySet ());
258
+ return enableUser (request , options );
261
259
}
262
260
263
261
/**
@@ -268,13 +266,11 @@ public boolean enableUser(RequestOptions options, EnableUserRequest request) thr
268
266
* @param request the request with the user to enable
269
267
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
270
268
* @param listener the listener to be notified upon request completion
271
- * @deprecated use {@link #enableUserAsync(RequestOptions, EnableUserRequest, ActionListener)} instead
272
269
*/
273
- @ Deprecated
274
270
public void enableUserAsync (EnableUserRequest request , RequestOptions options ,
275
- ActionListener <EmptyResponse > listener ) {
276
- restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::enableUser , options ,
277
- EmptyResponse :: fromXContent , listener , emptySet ());
271
+ ActionListener <Boolean > listener ) {
272
+ restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::enableUser , options ,
273
+ RestHighLevelClient :: convertExistsResponse , listener , emptySet ());
278
274
}
279
275
280
276
/**
@@ -285,11 +281,12 @@ public void enableUserAsync(EnableUserRequest request, RequestOptions options,
285
281
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
286
282
* @param request the request with the user to enable
287
283
* @param listener the listener to be notified upon request completion
284
+ * @deprecated use {@link #enableUserAsync(EnableUserRequest, RequestOptions, ActionListener)} instead
288
285
*/
286
+ @ Deprecated
289
287
public void enableUserAsync (RequestOptions options , EnableUserRequest request ,
290
288
ActionListener <Boolean > listener ) {
291
- restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::enableUser , options ,
292
- RestHighLevelClient ::convertExistsResponse , listener , emptySet ());
289
+ enableUserAsync (request , options , listener );
293
290
}
294
291
295
292
/**
@@ -299,14 +296,12 @@ public void enableUserAsync(RequestOptions options, EnableUserRequest request,
299
296
*
300
297
* @param request the request with the user to disable
301
298
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
302
- * @return the response from the enable user call
299
+ * @return {@code true} if the request succeeded (the user is disabled)
303
300
* @throws IOException in case there is a problem sending the request or parsing back the response
304
- * @deprecated use {@link #disableUser(RequestOptions, DisableUserRequest)} instead
305
301
*/
306
- @ Deprecated
307
- public EmptyResponse disableUser (DisableUserRequest request , RequestOptions options ) throws IOException {
308
- return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::disableUser , options ,
309
- EmptyResponse ::fromXContent , emptySet ());
302
+ public boolean disableUser (DisableUserRequest request , RequestOptions options ) throws IOException {
303
+ return restHighLevelClient .performRequest (request , SecurityRequestConverters ::disableUser , options ,
304
+ RestHighLevelClient ::convertExistsResponse , emptySet ());
310
305
}
311
306
312
307
/**
@@ -318,10 +313,11 @@ public EmptyResponse disableUser(DisableUserRequest request, RequestOptions opti
318
313
* @param request the request with the user to disable
319
314
* @return {@code true} if the request succeeded (the user is disabled)
320
315
* @throws IOException in case there is a problem sending the request or parsing back the response
316
+ * @deprecated use {@link #disableUser(DisableUserRequest, RequestOptions)} instead
321
317
*/
318
+ @ Deprecated
322
319
public boolean disableUser (RequestOptions options , DisableUserRequest request ) throws IOException {
323
- return restHighLevelClient .performRequest (request , SecurityRequestConverters ::disableUser , options ,
324
- RestHighLevelClient ::convertExistsResponse , emptySet ());
320
+ return disableUser (request , options );
325
321
}
326
322
327
323
/**
@@ -332,13 +328,11 @@ public boolean disableUser(RequestOptions options, DisableUserRequest request) t
332
328
* @param request the request with the user to disable
333
329
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
334
330
* @param listener the listener to be notified upon request completion
335
- * @deprecated use {@link #disableUserAsync(RequestOptions, DisableUserRequest, ActionListener)} instead
336
331
*/
337
- @ Deprecated
338
332
public void disableUserAsync (DisableUserRequest request , RequestOptions options ,
339
- ActionListener <EmptyResponse > listener ) {
340
- restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::disableUser , options ,
341
- EmptyResponse :: fromXContent , listener , emptySet ());
333
+ ActionListener <Boolean > listener ) {
334
+ restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::disableUser , options ,
335
+ RestHighLevelClient :: convertExistsResponse , listener , emptySet ());
342
336
}
343
337
344
338
/**
@@ -349,11 +343,12 @@ public void disableUserAsync(DisableUserRequest request, RequestOptions options,
349
343
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
350
344
* @param request the request with the user to disable
351
345
* @param listener the listener to be notified upon request completion
346
+ * @deprecated use {@link #disableUserAsync(DisableUserRequest, RequestOptions, ActionListener)} instead
352
347
*/
348
+ @ Deprecated
353
349
public void disableUserAsync (RequestOptions options , DisableUserRequest request ,
354
350
ActionListener <Boolean > listener ) {
355
- restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::disableUser , options ,
356
- RestHighLevelClient ::convertExistsResponse , listener , emptySet ());
351
+ disableUserAsync (request , options , listener );
357
352
}
358
353
359
354
/**
@@ -523,14 +518,12 @@ public void getSslCertificatesAsync(RequestOptions options, ActionListener<GetSs
523
518
*
524
519
* @param request the request with the user's new password
525
520
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
526
- * @return the response from the change user password call
521
+ * @return {@code true} if the request succeeded (the new password was set)
527
522
* @throws IOException in case there is a problem sending the request or parsing back the response
528
- * @deprecated use {@link #changePassword(RequestOptions, ChangePasswordRequest)} instead
529
523
*/
530
- @ Deprecated
531
- public EmptyResponse changePassword (ChangePasswordRequest request , RequestOptions options ) throws IOException {
532
- return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::changePassword , options ,
533
- EmptyResponse ::fromXContent , emptySet ());
524
+ public boolean changePassword (ChangePasswordRequest request , RequestOptions options ) throws IOException {
525
+ return restHighLevelClient .performRequest (request , SecurityRequestConverters ::changePassword , options ,
526
+ RestHighLevelClient ::convertExistsResponse , emptySet ());
534
527
}
535
528
536
529
/**
@@ -542,10 +535,11 @@ public EmptyResponse changePassword(ChangePasswordRequest request, RequestOption
542
535
* @param request the request with the user's new password
543
536
* @return {@code true} if the request succeeded (the new password was set)
544
537
* @throws IOException in case there is a problem sending the request or parsing back the response
538
+ * @deprecated use {@link #changePassword(ChangePasswordRequest, RequestOptions)} instead
545
539
*/
540
+ @ Deprecated
546
541
public boolean changePassword (RequestOptions options , ChangePasswordRequest request ) throws IOException {
547
- return restHighLevelClient .performRequest (request , SecurityRequestConverters ::changePassword , options ,
548
- RestHighLevelClient ::convertExistsResponse , emptySet ());
542
+ return changePassword (request , options );
549
543
}
550
544
551
545
/**
@@ -556,13 +550,11 @@ public boolean changePassword(RequestOptions options, ChangePasswordRequest requ
556
550
* @param request the request with the user's new password
557
551
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
558
552
* @param listener the listener to be notified upon request completion
559
- * @deprecated use {@link #changePasswordAsync(RequestOptions, ChangePasswordRequest, ActionListener)} instead
560
553
*/
561
- @ Deprecated
562
554
public void changePasswordAsync (ChangePasswordRequest request , RequestOptions options ,
563
- ActionListener <EmptyResponse > listener ) {
564
- restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::changePassword , options ,
565
- EmptyResponse :: fromXContent , listener , emptySet ());
555
+ ActionListener <Boolean > listener ) {
556
+ restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::changePassword , options ,
557
+ RestHighLevelClient :: convertExistsResponse , listener , emptySet ());
566
558
}
567
559
568
560
/**
@@ -573,14 +565,14 @@ public void changePasswordAsync(ChangePasswordRequest request, RequestOptions op
573
565
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
574
566
* @param request the request with the user's new password
575
567
* @param listener the listener to be notified upon request completion
568
+ * @deprecated use {@link #changePasswordAsync(ChangePasswordRequest, RequestOptions, ActionListener)} instead
576
569
*/
570
+ @ Deprecated
577
571
public void changePasswordAsync (RequestOptions options , ChangePasswordRequest request ,
578
572
ActionListener <Boolean > listener ) {
579
- restHighLevelClient .performRequestAsync (request , SecurityRequestConverters ::changePassword , options ,
580
- RestHighLevelClient ::convertExistsResponse , listener , emptySet ());
573
+ changePasswordAsync (request , options , listener );
581
574
}
582
575
583
-
584
576
/**
585
577
* Delete a role mapping.
586
578
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">
0 commit comments