delete-role-mapping.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. [[java-rest-high-security-delete-role-mapping]]
  2. === Delete Role Mapping API
  3. [[java-rest-high-security-delete-role-mapping-execution]]
  4. ==== Execution
  5. Deletion of a role mapping can be performed using the `security().deleteRoleMapping()`
  6. method:
  7. ["source","java",subs="attributes,callouts,macros"]
  8. --------------------------------------------------
  9. include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute]
  10. --------------------------------------------------
  11. [[java-rest-high-security-delete-role-mapping-response]]
  12. ==== Response
  13. The returned `DeleteRoleMappingResponse` contains a single field, `found`. If the mapping
  14. is successfully found and deleted, found is set to true. Otherwise, found is set to false.
  15. ["source","java",subs="attributes,callouts,macros"]
  16. --------------------------------------------------
  17. include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-response]
  18. --------------------------------------------------
  19. <1> `found` is a boolean indicating whether the role mapping was found and deleted
  20. [[java-rest-high-security-delete-role-mapping-async]]
  21. ==== Asynchronous Execution
  22. This request can be executed asynchronously using the `security().deleteRoleMappingAsync()`
  23. method:
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute-async]
  27. --------------------------------------------------
  28. <1> The `DeleteRoleMappingRequest` to execute and the `ActionListener` to use when
  29. the execution completes
  30. The asynchronous method does not block and returns immediately. Once the request
  31. has completed the `ActionListener` is called back using the `onResponse` method
  32. if the execution successfully completed or using the `onFailure` method if
  33. it failed.
  34. A typical listener for a `DeleteRoleMappingResponse` looks like:
  35. ["source","java",subs="attributes,callouts,macros"]
  36. --------------------------------------------------
  37. include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute-listener]
  38. --------------------------------------------------
  39. <1> Called when the execution is successfully completed. The response is
  40. provided as an argument
  41. <2> Called in case of failure. The raised exception is provided as an argument