disable-user.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. [[java-rest-high-security-disable-user]]
  2. === Disable User API
  3. [[java-rest-high-security-disable-user-execution]]
  4. ==== Execution
  5. Disabling a user can be performed using the `security().disableUser()`
  6. method:
  7. ["source","java",subs="attributes,callouts,macros"]
  8. --------------------------------------------------
  9. include-tagged::{doc-tests}/SecurityDocumentationIT.java[disable-user-execute]
  10. --------------------------------------------------
  11. [[java-rest-high-security-disable-user-response]]
  12. ==== Response
  13. The returned `EmptyResponse` does not contain any fields. The return of this
  14. response indicates a successful request.
  15. [[java-rest-high-security-disable-user-async]]
  16. ==== Asynchronous Execution
  17. This request can be executed asynchronously:
  18. ["source","java",subs="attributes,callouts,macros"]
  19. --------------------------------------------------
  20. include-tagged::{doc-tests}/SecurityDocumentationIT.java[disable-user-execute-async]
  21. --------------------------------------------------
  22. <1> The `DisableUser` request to execute and the `ActionListener` to use when
  23. the execution completes.
  24. The asynchronous method does not block and returns immediately. Once the request
  25. has completed the `ActionListener` is called back using the `onResponse` method
  26. if the execution successfully completed or using the `onFailure` method if
  27. it failed.
  28. A typical listener for a `EmptyResponse` looks like:
  29. ["source","java",subs="attributes,callouts,macros"]
  30. --------------------------------------------------
  31. include-tagged::{doc-tests}/SecurityDocumentationIT.java[disable-user-execute-listener]
  32. --------------------------------------------------
  33. <1> Called when the execution is successfully completed. The response is
  34. provided as an argument.
  35. <2> Called in case of failure. The raised exception is provided as an argument.