delete-license.asciidoc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. [[java-rest-high-delete-license]]
  2. === Delete License
  3. [[java-rest-high-delete-license-execution]]
  4. ==== Execution
  5. The license can be deleted using the `deleteLicense()` method:
  6. ["source","java",subs="attributes,callouts,macros"]
  7. --------------------------------------------------
  8. include-tagged::{doc-tests}/LicensingDocumentationIT.java[delete-license-execute]
  9. --------------------------------------------------
  10. [[java-rest-high-delete-license-response]]
  11. ==== Response
  12. The returned `DeleteLicenseResponse` contains the `acknowledged` flag, which
  13. returns true if the request was processed by all nodes.
  14. ["source","java",subs="attributes,callouts,macros"]
  15. --------------------------------------------------
  16. include-tagged::{doc-tests}/LicensingDocumentationIT.java[delete-license-response]
  17. --------------------------------------------------
  18. <1> Check the acknowledge flag. It should be true if license deletion is acknowledged.
  19. [[java-rest-high-delete-license-async]]
  20. ==== Asynchronous Execution
  21. This request can be executed asynchronously:
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests}/LicensingDocumentationIT.java[delete-license-execute-async]
  25. --------------------------------------------------
  26. <1> The `DeleteLicenseRequest` to execute and the `ActionListener` to use when
  27. the execution completes
  28. The asynchronous method does not block and returns immediately. Once it is
  29. completed the `ActionListener` is called back using the `onResponse` method
  30. if the execution successfully completed or using the `onFailure` method if
  31. it failed.
  32. A typical listener for `DeleteLicenseResponse` looks like:
  33. ["source","java",subs="attributes,callouts,macros"]
  34. --------------------------------------------------
  35. include-tagged::{doc-tests}/LicensingDocumentationIT.java[delete-license-execute-listener]
  36. --------------------------------------------------
  37. <1> Called when the execution is successfully completed. The response is
  38. provided as an argument
  39. <2> Called in case of failure. The raised exception is provided as an argument