From 6920a09cd2d1189f3a7ce27d98fccc044086f951 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Wed, 28 Oct 2015 11:54:11 +0100 Subject: [PATCH] Docs: Updated watcher java docs to show that plugin must be loaded Using the new addPlugin() instead of plugin.types setting. Original commit: elastic/x-pack-elasticsearch@e1deea853cb817e815578fa1d247ab350f899d4f --- watcher/docs/reference/java.asciidoc | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/watcher/docs/reference/java.asciidoc b/watcher/docs/reference/java.asciidoc index ef77b32f4f9..bab0e2d38f9 100644 --- a/watcher/docs/reference/java.asciidoc +++ b/watcher/docs/reference/java.asciidoc @@ -75,10 +75,18 @@ Creating the `WatcherClient` can simply be done as the following snippet shows: [source,java] -------------------------------------------------- +import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.watcher.client.WatcherClient; +import org.elasticsearch.watcher.WatcherPlugin; ... -Client client = ... // create and initialize either the transport or the node client +TransportClient client = TransportClient.builder() + .settings(Settings.builder() + .put("cluster.name", "myClusterName") + ... + .build()) + .addPlugin(WatcherPlugin.class) + .addTransportAddress(new InetSocketTransportAddress("localhost", 9300)); WatcherClient watcherClient = new WatcherClient(client); -------------------------------------------------- @@ -100,16 +108,3 @@ include::java/deactivate-watch.asciidoc[] include::java/stats.asciidoc[] include::java/service.asciidoc[] - - - - - - - - - - - - -