1- [[java-rest-high-watcher-ack-watch]]
1+ --
2+ :api: ack-watch
3+ :request: AckWatchRequest
4+ :response: AckWatchResponse
5+ --
6+
7+ [id="{upid}-{api}"]
28=== Ack Watch API
39
4- [[java-rest-high-watcher-ack-watch-execution] ]
10+ [id="{upid}-{api}-request" ]
511==== Execution
612
713{xpack-ref}/actions.html#actions-ack-throttle[Acknowledging a watch] enables you
@@ -10,48 +16,23 @@ through the following request:
1016
1117["source","java",subs="attributes,callouts,macros"]
1218--------------------------------------------------
13- include-tagged::{doc-tests}/WatcherDocumentationIT.java[ack-watch-execute ]
19+ include-tagged::{doc-tests-file}[{api}-request ]
1420--------------------------------------------------
1521<1> The ID of the watch to ack.
1622<2> An optional list of IDs representing the watch actions that should be acked.
1723If no action IDs are provided, then all of the watch's actions will be acked.
1824
19- [[java-rest-high-watcher-ack-watch- response] ]
25+ [id="{upid}-{api}- response" ]
2026==== Response
2127
22- The returned `AckWatchResponse` contains the new status of the requested watch:
28+ The returned +{response}+ contains the new status of the requested watch:
2329
2430["source","java",subs="attributes,callouts,macros"]
2531--------------------------------------------------
26- include-tagged::{doc-tests}/WatcherDocumentationIT.java[ack-watch -response]
32+ include-tagged::{doc-tests-file}[{api} -response]
2733--------------------------------------------------
2834<1> The status of a specific action that was acked.
2935<2> The acknowledgement state of the action. If the action was successfully
3036acked, this state will be equal to `AckStatus.State.ACKED`.
3137
32- [[java-rest-high-watcher-ack-watch-async]]
33- ==== Asynchronous Execution
34-
35- This request can be executed asynchronously:
36-
37- ["source","java",subs="attributes,callouts,macros"]
38- --------------------------------------------------
39- include-tagged::{doc-tests}/WatcherDocumentationIT.java[ack-watch-execute-async]
40- --------------------------------------------------
41- <1> The `AckWatchRequest` to execute and the `ActionListener` to use when
42- the execution completes.
43-
44- The asynchronous method does not block and returns immediately. Once the request
45- completes, the `ActionListener` is called back using the `onResponse` method
46- if the execution successfully completed or using the `onFailure` method if
47- it failed.
48-
49- A listener for `AckWatchResponse` can be constructed as follows:
50-
51- ["source","java",subs="attributes,callouts,macros"]
52- --------------------------------------------------
53- include-tagged::{doc-tests}/WatcherDocumentationIT.java[ack-watch-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.
38+ include::../execution.asciidoc[]
0 commit comments