start-trial.asciidoc 3.1 KB

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