get-license.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. [[java-rest-high-get-license]]
  2. === Get License
  3. [[java-rest-high-get-license-execution]]
  4. ==== Execution
  5. The license can be added or updated using the `getLicense()` method:
  6. ["source","java",subs="attributes,callouts,macros"]
  7. --------------------------------------------------
  8. include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-execute]
  9. --------------------------------------------------
  10. [[java-rest-high-get-license-response]]
  11. ==== Response
  12. The returned `GetLicenseResponse` contains the license in the JSON format.
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-response]
  16. --------------------------------------------------
  17. <1> The text of the license.
  18. [[java-rest-high-get-license-async]]
  19. ==== Asynchronous Execution
  20. This request can be executed asynchronously:
  21. ["source","java",subs="attributes,callouts,macros"]
  22. --------------------------------------------------
  23. include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-execute-async]
  24. --------------------------------------------------
  25. <1> The `GetLicenseRequest` to execute and the `ActionListener` to use when
  26. the execution completes
  27. The asynchronous method does not block and returns immediately. Once it is
  28. completed the `ActionListener` is called back using the `onResponse` method
  29. if the execution successfully completed or using the `onFailure` method if
  30. it failed.
  31. A typical listener for `GetLicenseResponse` looks like:
  32. ["source","java",subs="attributes,callouts,macros"]
  33. --------------------------------------------------
  34. include-tagged::{doc-tests}/LicensingDocumentationIT.java[get-license-execute-listener]
  35. --------------------------------------------------
  36. <1> Called when the execution is successfully completed. The response is
  37. provided as an argument
  38. <2> Called in case of failure. The raised exception is provided as an argument