NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Activate Watch API
editActivate Watch API
editExecution
editA watch can be activated as follows:
ActivateWatchRequest request = new ActivateWatchRequest("my_watch_id"); ActivateWatchResponse response = client.watcher().activateWatch(request, RequestOptions.DEFAULT);
Response
editThe returned ActivateWatchResponse
contains the new status of the activated watch.
Asynchronous Execution
editThis request can be executed asynchronously:
The asynchronous method does not block and returns immediately. Once it is
completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for ActivateWatchResponse
looks like: