start-basic.asciidoc 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [[java-rest-high-start-basic]]
  2. === Start Basic License
  3. [[java-rest-high-start-basic-execution]]
  4. ==== Execution
  5. This API creates and enables a basic license using the `startBasic()` method.
  6. ["source","java",subs="attributes,callouts,macros"]
  7. --------------------------------------------------
  8. include-tagged::{doc-tests}/LicensingDocumentationIT.java[start-basic-execute]
  9. --------------------------------------------------
  10. [[java-rest-high-start-basic-response]]
  11. ==== Response
  12. The returned `StartBasicResponse` returns a field indicating whether the
  13. basic was started. If it was started, the response returns a the type of
  14. license started. If it was not started, it returns an error message describing
  15. why.
  16. Acknowledgement messages may also be returned if this API was called without
  17. the `acknowledge` flag set to `true`. In this case you need to display the
  18. messages to the end user and if they agree, resubmit the request with the
  19. `acknowledge` flag set to `true`. Please note that the response will still
  20. return a 200 return code even if it requires an acknowledgement. So, it is
  21. necessary to check the `acknowledged` flag.
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests}/LicensingDocumentationIT.java[start-basic-response]
  25. --------------------------------------------------
  26. <1> Whether or not the request had the `acknowledge` flag set
  27. <2> Whether or not this request caused a basic to start
  28. <3> If this request did not cause a basic to start, a message explaining why
  29. <4> If the user's request did not have the `acknowledge` flag set, a summary
  30. of the user's acknowledgement required for this API
  31. <5> If the user's request did not have the `acknowledge` flag set, contains
  32. keys of commercial features and values of messages describing how they will
  33. be affected by licensing changes as the result of starting a basic
  34. [[java-rest-high-start-basic-async]]
  35. ==== Asynchronous Execution
  36. This request can be executed asynchronously:
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests}/LicensingDocumentationIT.java[start-basic-execute-async]
  40. --------------------------------------------------
  41. <1> The `StartBasicResponse` to execute and the `ActionListener` to use when
  42. the execution completes
  43. The asynchronous method does not block and returns immediately. Once it is
  44. completed the `ActionListener` is called back using the `onResponse` method
  45. if the execution successfully completed or using the `onFailure` method if
  46. it failed.
  47. A typical listener for `StartBasicResponse` looks like:
  48. ["source","java",subs="attributes,callouts,macros"]
  49. --------------------------------------------------
  50. include-tagged::{doc-tests}/LicensingDocumentationIT.java[start-basic-listener]
  51. --------------------------------------------------
  52. <1> Called when the execution is successfully completed. The response is
  53. provided as an argument
  54. <2> Called in case of failure. The raised exception is provided as an argument