[HLRC] Add support for Delete role mapping API (#34531)

Building on expression dsl and create role mapping API, this
commit adds support for delete role mapping API to high level client.
This commit is contained in:
Yogesh Gaikwad 2018-10-19 13:46:26 +11:00 committed by GitHub
parent 2283a337b9
commit 39a6163316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 472 additions and 3 deletions

View file

@ -0,0 +1,51 @@
[[java-rest-high-security-delete-role-mapping]]
=== Delete Role Mapping API
[[java-rest-high-security-delete-role-mapping-execution]]
==== Execution
Deletion of a role mapping can be performed using the `security().deleteRoleMapping()`
method:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute]
--------------------------------------------------
[[java-rest-high-security-delete-role-mapping-response]]
==== Response
The 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.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-response]
--------------------------------------------------
<1> `found` is a boolean indicating whether the role mapping was found and deleted
[[java-rest-high-security-delete-role-mapping-async]]
==== Asynchronous Execution
This request can be executed asynchronously using the `security().deleteRoleMappingAsync()`
method:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute-async]
--------------------------------------------------
<1> The `DeleteRoleMappingRequest` to execute and the `ActionListener` to use when
the execution completes
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:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute-listener]
--------------------------------------------------
<1> Called when the execution is successfully completed. The response is
provided as an argument
<2> Called in case of failure. The raised exception is provided as an argument

View file

@ -34,7 +34,7 @@ method:
--------------------------------------------------
include-tagged::{doc-tests}/SecurityDocumentationIT.java[put-role-mapping-execute-async]
--------------------------------------------------
<1> The `PutRoleMappingResponse` to execute and the `ActionListener` to use when
<1> The `PutRoleMappingRequest` to execute and the `ActionListener` to use when
the execution completes
The asynchronous method does not block and returns immediately. Once the request

View file

@ -318,6 +318,7 @@ The Java High Level REST Client supports the following Security APIs:
* <<java-rest-high-security-change-password>>
* <<java-rest-high-security-get-certificates>>
* <<java-rest-high-security-put-role-mapping>>
* <<java-rest-high-security-delete-role-mapping>>
include::security/put-user.asciidoc[]
include::security/enable-user.asciidoc[]
@ -325,6 +326,7 @@ include::security/disable-user.asciidoc[]
include::security/change-password.asciidoc[]
include::security/get-certificates.asciidoc[]
include::security/put-role-mapping.asciidoc[]
include::security/delete-role-mapping.asciidoc[]
== Watcher APIs