diff --git a/src/main/java/org/elasticsearch/action/Action.java b/src/main/java/org/elasticsearch/action/Action.java
index 2946b78d4fd..f45e525c58f 100644
--- a/src/main/java/org/elasticsearch/action/Action.java
+++ b/src/main/java/org/elasticsearch/action/Action.java
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.client.ElasticsearchClient;
/**
- * Main action (used with {@link Client} API.
+ * Base action. Supports building the Request
through a RequestBuilder
.
*/
public abstract class Action, Client extends ElasticsearchClient>
extends GenericAction {
@@ -31,5 +31,8 @@ public abstract class Action>
extends Action {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ClusterAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/ClusterAction.java
index da7f91a63e9..91ce66543d4 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ClusterAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ClusterAction.java
@@ -19,12 +19,14 @@
package org.elasticsearch.action.admin.cluster;
-import org.elasticsearch.action.*;
+import org.elasticsearch.action.Action;
+import org.elasticsearch.action.ActionRequest;
+import org.elasticsearch.action.ActionRequestBuilder;
+import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.ClusterAdminClient;
-import org.elasticsearch.client.ElasticsearchClient;
/**
- * Cluster action (used with {@link ClusterAdminClient} API.
+ * Cluster action (used with {@link ClusterAdminClient} API).
*/
public abstract class ClusterAction>
extends Action {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/IndicesAction.java b/src/main/java/org/elasticsearch/action/admin/indices/IndicesAction.java
index 45306817656..4fae668f77e 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/IndicesAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/IndicesAction.java
@@ -23,7 +23,7 @@ import org.elasticsearch.action.*;
import org.elasticsearch.client.IndicesAdminClient;
/**
- * Indices action (used with {@link IndicesAdminClient} API.
+ * Indices action (used with {@link IndicesAdminClient} API).
*/
public abstract class IndicesAction>
extends Action {
diff --git a/src/main/java/org/elasticsearch/action/bench/AbortBenchmarkAction.java b/src/main/java/org/elasticsearch/action/bench/AbortBenchmarkAction.java
index e5e98273a57..f17de510263 100644
--- a/src/main/java/org/elasticsearch/action/bench/AbortBenchmarkAction.java
+++ b/src/main/java/org/elasticsearch/action/bench/AbortBenchmarkAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.bench;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/bench/BenchmarkAction.java b/src/main/java/org/elasticsearch/action/bench/BenchmarkAction.java
index 33630407fe2..a2c66dbc5a4 100644
--- a/src/main/java/org/elasticsearch/action/bench/BenchmarkAction.java
+++ b/src/main/java/org/elasticsearch/action/bench/BenchmarkAction.java
@@ -18,7 +18,6 @@
*/
package org.elasticsearch.action.bench;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.Strings;
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkAction.java b/src/main/java/org/elasticsearch/action/bulk/BulkAction.java
index 591d775656d..0e03ad2f9a8 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkAction.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.bulk;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.Settings;
diff --git a/src/main/java/org/elasticsearch/action/count/CountAction.java b/src/main/java/org/elasticsearch/action/count/CountAction.java
index f038feaff44..33fd2e2be67 100644
--- a/src/main/java/org/elasticsearch/action/count/CountAction.java
+++ b/src/main/java/org/elasticsearch/action/count/CountAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.count;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/delete/DeleteAction.java b/src/main/java/org/elasticsearch/action/delete/DeleteAction.java
index 1d80ae7add2..b0e9666ac33 100644
--- a/src/main/java/org/elasticsearch/action/delete/DeleteAction.java
+++ b/src/main/java/org/elasticsearch/action/delete/DeleteAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.delete;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryAction.java b/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryAction.java
index c5a4a5f6770..6b0811a20c1 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryAction.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.deletebyquery;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/explain/ExplainAction.java b/src/main/java/org/elasticsearch/action/explain/ExplainAction.java
index 0d31f94b6d1..63d339500b7 100644
--- a/src/main/java/org/elasticsearch/action/explain/ExplainAction.java
+++ b/src/main/java/org/elasticsearch/action/explain/ExplainAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.explain;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/get/GetAction.java b/src/main/java/org/elasticsearch/action/get/GetAction.java
index f5c903c8a5f..061d83bd797 100644
--- a/src/main/java/org/elasticsearch/action/get/GetAction.java
+++ b/src/main/java/org/elasticsearch/action/get/GetAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.get;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/get/MultiGetAction.java b/src/main/java/org/elasticsearch/action/get/MultiGetAction.java
index c2c1ffa5990..e846fedf57b 100644
--- a/src/main/java/org/elasticsearch/action/get/MultiGetAction.java
+++ b/src/main/java/org/elasticsearch/action/get/MultiGetAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.get;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/index/IndexAction.java b/src/main/java/org/elasticsearch/action/index/IndexAction.java
index af887ddc14c..e9d2859fa06 100644
--- a/src/main/java/org/elasticsearch/action/index/IndexAction.java
+++ b/src/main/java/org/elasticsearch/action/index/IndexAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.index;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/mlt/MoreLikeThisAction.java b/src/main/java/org/elasticsearch/action/mlt/MoreLikeThisAction.java
index 5337b615cbb..0eeef1403bf 100644
--- a/src/main/java/org/elasticsearch/action/mlt/MoreLikeThisAction.java
+++ b/src/main/java/org/elasticsearch/action/mlt/MoreLikeThisAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.mlt;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/percolate/MultiPercolateAction.java b/src/main/java/org/elasticsearch/action/percolate/MultiPercolateAction.java
index b08f60c9350..a464c88dd18 100644
--- a/src/main/java/org/elasticsearch/action/percolate/MultiPercolateAction.java
+++ b/src/main/java/org/elasticsearch/action/percolate/MultiPercolateAction.java
@@ -18,7 +18,6 @@
*/
package org.elasticsearch.action.percolate;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/percolate/PercolateAction.java b/src/main/java/org/elasticsearch/action/percolate/PercolateAction.java
index 829e85a8e47..ec5b227641c 100644
--- a/src/main/java/org/elasticsearch/action/percolate/PercolateAction.java
+++ b/src/main/java/org/elasticsearch/action/percolate/PercolateAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.percolate;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java b/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java
index 1b4f86e2c0e..bb7adb04557 100644
--- a/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java
+++ b/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.search;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java b/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java
index 00a4c3db8ad..ce54fa1b85e 100644
--- a/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java
+++ b/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.search;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/search/SearchAction.java b/src/main/java/org/elasticsearch/action/search/SearchAction.java
index 4c76173f272..c541b760b1a 100644
--- a/src/main/java/org/elasticsearch/action/search/SearchAction.java
+++ b/src/main/java/org/elasticsearch/action/search/SearchAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.search;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java b/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java
index af908772c7f..0f736ae06ad 100644
--- a/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java
+++ b/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.search;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/suggest/SuggestAction.java b/src/main/java/org/elasticsearch/action/suggest/SuggestAction.java
index 277b281c91c..868f62d28fb 100644
--- a/src/main/java/org/elasticsearch/action/suggest/SuggestAction.java
+++ b/src/main/java/org/elasticsearch/action/suggest/SuggestAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.suggest;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.suggest.Suggest;
diff --git a/src/main/java/org/elasticsearch/action/termvector/MultiTermVectorsAction.java b/src/main/java/org/elasticsearch/action/termvector/MultiTermVectorsAction.java
index 3b75868fc23..848a8505bd4 100644
--- a/src/main/java/org/elasticsearch/action/termvector/MultiTermVectorsAction.java
+++ b/src/main/java/org/elasticsearch/action/termvector/MultiTermVectorsAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.termvector;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/action/update/UpdateAction.java b/src/main/java/org/elasticsearch/action/update/UpdateAction.java
index e5e2c9e7d3b..b1438c74055 100644
--- a/src/main/java/org/elasticsearch/action/update/UpdateAction.java
+++ b/src/main/java/org/elasticsearch/action/update/UpdateAction.java
@@ -19,7 +19,6 @@
package org.elasticsearch.action.update;
-import org.elasticsearch.action.Action;
import org.elasticsearch.action.ClientAction;
import org.elasticsearch.client.Client;
diff --git a/src/main/java/org/elasticsearch/client/node/NodeClient.java b/src/main/java/org/elasticsearch/client/node/NodeClient.java
index 9ec97233180..dbd19953cdf 100644
--- a/src/main/java/org/elasticsearch/client/node/NodeClient.java
+++ b/src/main/java/org/elasticsearch/client/node/NodeClient.java
@@ -42,17 +42,17 @@ public class NodeClient extends AbstractClient {
private final NodeAdminClient admin;
- private final ImmutableMap actions;
+ private final ImmutableMap actions;
@Inject
public NodeClient(Settings settings, ThreadPool threadPool, NodeAdminClient admin, Map actions) {
this.settings = settings;
this.threadPool = threadPool;
this.admin = admin;
- MapBuilder actionsBuilder = new MapBuilder<>();
+ MapBuilder actionsBuilder = new MapBuilder<>();
for (Map.Entry entry : actions.entrySet()) {
- if (entry.getKey() instanceof Action) {
- actionsBuilder.put((Action) entry.getKey(), entry.getValue());
+ if (entry.getKey() instanceof ClientAction) {
+ actionsBuilder.put((ClientAction) entry.getKey(), entry.getValue());
}
}
this.actions = actionsBuilder.immutableMap();
@@ -81,14 +81,14 @@ public class NodeClient extends AbstractClient {
@SuppressWarnings("unchecked")
@Override
public > ActionFuture execute(Action action, Request request) {
- TransportAction transportAction = actions.get(action);
+ TransportAction transportAction = actions.get((ClientAction)action);
return transportAction.execute(request);
}
@SuppressWarnings("unchecked")
@Override
public > void execute(Action action, Request request, ActionListener listener) {
- TransportAction transportAction = actions.get(action);
+ TransportAction transportAction = actions.get((ClientAction)action);
transportAction.execute(request, listener);
}
}
diff --git a/src/main/java/org/elasticsearch/client/node/NodeClusterAdminClient.java b/src/main/java/org/elasticsearch/client/node/NodeClusterAdminClient.java
index 83c4e1c3c1f..cbc4890051d 100644
--- a/src/main/java/org/elasticsearch/client/node/NodeClusterAdminClient.java
+++ b/src/main/java/org/elasticsearch/client/node/NodeClusterAdminClient.java
@@ -27,7 +27,6 @@ import org.elasticsearch.client.ClusterAdminClient;
import org.elasticsearch.client.support.AbstractClusterAdminClient;
import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.inject.Inject;
-import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import java.util.Map;
@@ -42,7 +41,7 @@ public class NodeClusterAdminClient extends AbstractClusterAdminClient implement
private final ImmutableMap actions;
@Inject
- public NodeClusterAdminClient(Settings settings, ThreadPool threadPool, Map actions) {
+ public NodeClusterAdminClient(ThreadPool threadPool, Map actions) {
this.threadPool = threadPool;
MapBuilder actionsBuilder = new MapBuilder<>();
for (Map.Entry entry : actions.entrySet()) {
@@ -61,14 +60,14 @@ public class NodeClusterAdminClient extends AbstractClusterAdminClient implement
@SuppressWarnings("unchecked")
@Override
public > ActionFuture execute(Action action, Request request) {
- TransportAction transportAction = actions.get(action);
+ TransportAction transportAction = actions.get((ClusterAction)action);
return transportAction.execute(request);
}
@SuppressWarnings("unchecked")
@Override
public > void execute(Action action, Request request, ActionListener listener) {
- TransportAction transportAction = actions.get(action);
+ TransportAction transportAction = actions.get((ClusterAction)action);
transportAction.execute(request, listener);
}
}
diff --git a/src/main/java/org/elasticsearch/client/node/NodeIndicesAdminClient.java b/src/main/java/org/elasticsearch/client/node/NodeIndicesAdminClient.java
index f378cbb8d4d..e715559e61f 100644
--- a/src/main/java/org/elasticsearch/client/node/NodeIndicesAdminClient.java
+++ b/src/main/java/org/elasticsearch/client/node/NodeIndicesAdminClient.java
@@ -27,7 +27,6 @@ import org.elasticsearch.client.IndicesAdminClient;
import org.elasticsearch.client.support.AbstractIndicesAdminClient;
import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.inject.Inject;
-import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import java.util.Map;
@@ -39,15 +38,15 @@ public class NodeIndicesAdminClient extends AbstractIndicesAdminClient implement
private final ThreadPool threadPool;
- private final ImmutableMap actions;
+ private final ImmutableMap actions;
@Inject
- public NodeIndicesAdminClient(Settings settings, ThreadPool threadPool, Map actions) {
+ public NodeIndicesAdminClient(ThreadPool threadPool, Map actions) {
this.threadPool = threadPool;
- MapBuilder actionsBuilder = new MapBuilder<>();
+ MapBuilder actionsBuilder = new MapBuilder<>();
for (Map.Entry entry : actions.entrySet()) {
if (entry.getKey() instanceof IndicesAction) {
- actionsBuilder.put((Action) entry.getKey(), entry.getValue());
+ actionsBuilder.put((IndicesAction) entry.getKey(), entry.getValue());
}
}
this.actions = actionsBuilder.immutableMap();
@@ -61,14 +60,14 @@ public class NodeIndicesAdminClient extends AbstractIndicesAdminClient implement
@SuppressWarnings("unchecked")
@Override
public > ActionFuture execute(Action action, Request request) {
- TransportAction transportAction = actions.get(action);
+ TransportAction transportAction = actions.get((IndicesAction)action);
return transportAction.execute(request);
}
@SuppressWarnings("unchecked")
@Override
public > void execute(Action action, Request request, ActionListener listener) {
- TransportAction transportAction = actions.get(action);
+ TransportAction transportAction = actions.get((IndicesAction)action);
transportAction.execute(request, listener);
}
}