@@ -237,12 +237,29 @@ public void getRoleMappingsAsync(final GetRoleMappingsRequest request, final Req
237237 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
238238 * @return the response from the enable user call
239239 * @throws IOException in case there is a problem sending the request or parsing back the response
240+ * @deprecated use {@link #enableUser(RequestOptions, EnableUserRequest)} instead
240241 */
242+ @ Deprecated
241243 public EmptyResponse enableUser (EnableUserRequest request , RequestOptions options ) throws IOException {
242244 return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::enableUser , options ,
243245 EmptyResponse ::fromXContent , emptySet ());
244246 }
245247
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+
246263 /**
247264 * Enable a native realm or built-in user asynchronously.
248265 * 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
251268 * @param request the request with the user to enable
252269 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
253270 * @param listener the listener to be notified upon request completion
271+ * @deprecated use {@link #enableUserAsync(RequestOptions, EnableUserRequest, ActionListener)} instead
254272 */
273+ @ Deprecated
255274 public void enableUserAsync (EnableUserRequest request , RequestOptions options ,
256275 ActionListener <EmptyResponse > listener ) {
257276 restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::enableUser , options ,
258277 EmptyResponse ::fromXContent , listener , emptySet ());
259278 }
260279
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+
261295 /**
262296 * Disable a native realm or built-in user synchronously.
263297 * 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,
267301 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
268302 * @return the response from the enable user call
269303 * @throws IOException in case there is a problem sending the request or parsing back the response
304+ * @deprecated use {@link #disableUser(RequestOptions, DisableUserRequest)} instead
270305 */
306+ @ Deprecated
271307 public EmptyResponse disableUser (DisableUserRequest request , RequestOptions options ) throws IOException {
272308 return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::disableUser , options ,
273309 EmptyResponse ::fromXContent , emptySet ());
274310 }
275311
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+
276327 /**
277328 * Disable a native realm or built-in user asynchronously.
278329 * 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
281332 * @param request the request with the user to disable
282333 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
283334 * @param listener the listener to be notified upon request completion
335+ * @deprecated use {@link #disableUserAsync(RequestOptions, DisableUserRequest, ActionListener)} instead
284336 */
337+ @ Deprecated
285338 public void disableUserAsync (DisableUserRequest request , RequestOptions options ,
286339 ActionListener <EmptyResponse > listener ) {
287340 restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::disableUser , options ,
288341 EmptyResponse ::fromXContent , listener , emptySet ());
289342 }
290343
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+
291359 /**
292360 * Authenticate the current user and return all the information about the authenticated user.
293361 * 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
457525 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
458526 * @return the response from the change user password call
459527 * @throws IOException in case there is a problem sending the request or parsing back the response
528+ * @deprecated use {@link #changePassword(RequestOptions, ChangePasswordRequest)} instead
460529 */
530+ @ Deprecated
461531 public EmptyResponse changePassword (ChangePasswordRequest request , RequestOptions options ) throws IOException {
462532 return restHighLevelClient .performRequestAndParseEntity (request , SecurityRequestConverters ::changePassword , options ,
463533 EmptyResponse ::fromXContent , emptySet ());
464534 }
465535
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+
466551 /**
467552 * Change the password of a user of a native realm or built-in user asynchronously.
468553 * 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
471556 * @param request the request with the user's new password
472557 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
473558 * @param listener the listener to be notified upon request completion
559+ * @deprecated use {@link #changePasswordAsync(RequestOptions, ChangePasswordRequest, ActionListener)} instead
474560 */
561+ @ Deprecated
475562 public void changePasswordAsync (ChangePasswordRequest request , RequestOptions options ,
476563 ActionListener <EmptyResponse > listener ) {
477564 restHighLevelClient .performRequestAsyncAndParseEntity (request , SecurityRequestConverters ::changePassword , options ,
478565 EmptyResponse ::fromXContent , listener , emptySet ());
479566 }
480567
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+
481584 /**
482585 * Delete a role mapping.
483586 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">
0 commit comments