WARNING: Deprecated in 7.15.0.
The Java REST Client is deprecated in favor of the Java API Client.
Delete Role Mapping API
editDelete Role Mapping API
editExecution
editDeletion of a role mapping can be performed using the security().deleteRoleMapping()
method:
final DeleteRoleMappingRequest request = new DeleteRoleMappingRequest("mapping-example", RefreshPolicy.NONE); final DeleteRoleMappingResponse response = client.security().deleteRoleMapping(request, RequestOptions.DEFAULT);
Response
editThe returned DeleteRoleMappingResponse
contains a single field, found
. If the mapping
is successfully found and deleted, found is set to true. Otherwise, found is set to false.
Asynchronous Execution
editThis request can be executed asynchronously using the security().deleteRoleMappingAsync()
method:
The asynchronous method does not block and returns immediately. Once the request
has completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for a DeleteRoleMappingResponse
looks like: