Merge pull request elastic/elasticsearch#4071 from rjernst/less_generics
Remove generics from ActionRequest Original commit: elastic/x-pack-elasticsearch@8b9d9fb947
This commit is contained in:
commit
3a03ccf548
|
@ -39,7 +39,7 @@ public class Licensing implements ActionPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||||
if (isTribeNode) {
|
if (isTribeNode) {
|
||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,8 +357,8 @@ public class XPackPlugin extends Plugin implements ScriptPlugin, ActionPlugin, I
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||||
List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> actions = new ArrayList<>();
|
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
|
||||||
actions.add(new ActionHandler<>(XPackInfoAction.INSTANCE, TransportXPackInfoAction.class));
|
actions.add(new ActionHandler<>(XPackInfoAction.INSTANCE, TransportXPackInfoAction.class));
|
||||||
actions.add(new ActionHandler<>(XPackUsageAction.INSTANCE, TransportXPackUsageAction.class));
|
actions.add(new ActionHandler<>(XPackUsageAction.INSTANCE, TransportXPackUsageAction.class));
|
||||||
actions.addAll(licensing.getActions());
|
actions.addAll(licensing.getActions());
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class XPackInfoRequest extends ActionRequest<XPackInfoRequest> {
|
public class XPackInfoRequest extends ActionRequest {
|
||||||
|
|
||||||
public enum Category {
|
public enum Category {
|
||||||
BUILD, LICENSE, FEATURES;
|
BUILD, LICENSE, FEATURES;
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class Graph extends Plugin implements ActionPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||||
if (false == enabled) {
|
if (false == enabled) {
|
||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||||
* Holds the criteria required to guide the exploration of connected terms which
|
* Holds the criteria required to guide the exploration of connected terms which
|
||||||
* can be returned as a graph.
|
* can be returned as a graph.
|
||||||
*/
|
*/
|
||||||
public class GraphExploreRequest extends ActionRequest<GraphExploreRequest> implements IndicesRequest.Replaceable {
|
public class GraphExploreRequest extends ActionRequest implements IndicesRequest.Replaceable {
|
||||||
|
|
||||||
public static final String NO_HOPS_ERROR_MESSAGE = "Graph explore request must have at least one hop";
|
public static final String NO_HOPS_ERROR_MESSAGE = "Graph explore request must have at least one hop";
|
||||||
public static final String NO_VERTICES_ERROR_MESSAGE = "Graph explore hop must have at least one VertexRequest";
|
public static final String NO_VERTICES_ERROR_MESSAGE = "Graph explore hop must have at least one VertexRequest";
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class Monitoring implements ActionPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||||
if (false == enabled || tribeNode) {
|
if (false == enabled || tribeNode) {
|
||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
* type and id of the final document to be indexed. A {@link MonitoringBulkDoc} can also hold its own index/type/id values but there's no
|
* type and id of the final document to be indexed. A {@link MonitoringBulkDoc} can also hold its own index/type/id values but there's no
|
||||||
* guarantee that these information will be effectively used.
|
* guarantee that these information will be effectively used.
|
||||||
*/
|
*/
|
||||||
public class MonitoringBulkRequest extends ActionRequest<MonitoringBulkRequest> {
|
public class MonitoringBulkRequest extends ActionRequest {
|
||||||
|
|
||||||
final List<MonitoringBulkDoc> docs = new ArrayList<>();
|
final List<MonitoringBulkDoc> docs = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class InternalClient extends FilterClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends
|
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends
|
||||||
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
||||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||||
|
|
||||||
|
|
|
@ -469,7 +469,7 @@ public class Security implements ActionPlugin, IngestPlugin, NetworkPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||||
if (enabled == false) {
|
if (enabled == false) {
|
||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* A request delete a role from the security index
|
* A request delete a role from the security index
|
||||||
*/
|
*/
|
||||||
public class DeleteRoleRequest extends ActionRequest<DeleteRoleRequest> implements WriteRequest<DeleteRoleRequest> {
|
public class DeleteRoleRequest extends ActionRequest implements WriteRequest<DeleteRoleRequest> {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;
|
private RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* Request to retrieve roles from the security index
|
* Request to retrieve roles from the security index
|
||||||
*/
|
*/
|
||||||
public class GetRolesRequest extends ActionRequest<GetRolesRequest> {
|
public class GetRolesRequest extends ActionRequest {
|
||||||
|
|
||||||
private String[] names = Strings.EMPTY_ARRAY;
|
private String[] names = Strings.EMPTY_ARRAY;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* Request object for adding a role to the security index
|
* Request object for adding a role to the security index
|
||||||
*/
|
*/
|
||||||
public class PutRoleRequest extends ActionRequest<PutRoleRequest> implements WriteRequest<PutRoleRequest> {
|
public class PutRoleRequest extends ActionRequest implements WriteRequest<PutRoleRequest> {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String[] clusterPrivileges = Strings.EMPTY_ARRAY;
|
private String[] clusterPrivileges = Strings.EMPTY_ARRAY;
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
|
|
||||||
public class AuthenticateRequest extends ActionRequest<AuthenticateRequest> implements UserRequest {
|
public class AuthenticateRequest extends ActionRequest implements UserRequest {
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* Request to change a user's password.
|
* Request to change a user's password.
|
||||||
*/
|
*/
|
||||||
public class ChangePasswordRequest extends ActionRequest<ChangePasswordRequest>
|
public class ChangePasswordRequest extends ActionRequest
|
||||||
implements UserRequest, WriteRequest<ChangePasswordRequest> {
|
implements UserRequest, WriteRequest<ChangePasswordRequest> {
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* A request to delete a native user.
|
* A request to delete a native user.
|
||||||
*/
|
*/
|
||||||
public class DeleteUserRequest extends ActionRequest<DeleteUserRequest> implements UserRequest, WriteRequest<DeleteUserRequest> {
|
public class DeleteUserRequest extends ActionRequest implements UserRequest, WriteRequest<DeleteUserRequest> {
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
private RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;
|
private RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* Request to retrieve a native user.
|
* Request to retrieve a native user.
|
||||||
*/
|
*/
|
||||||
public class GetUsersRequest extends ActionRequest<GetUsersRequest> implements UserRequest {
|
public class GetUsersRequest extends ActionRequest implements UserRequest {
|
||||||
|
|
||||||
private String[] usernames;
|
private String[] usernames;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* Request object to put a native user.
|
* Request object to put a native user.
|
||||||
*/
|
*/
|
||||||
public class PutUserRequest extends ActionRequest<PutUserRequest> implements UserRequest, WriteRequest<PutUserRequest> {
|
public class PutUserRequest extends ActionRequest implements UserRequest, WriteRequest<PutUserRequest> {
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
private String[] roles;
|
private String[] roles;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||||
/**
|
/**
|
||||||
* The request that allows to set a user as enabled or disabled
|
* The request that allows to set a user as enabled or disabled
|
||||||
*/
|
*/
|
||||||
public class SetEnabledRequest extends ActionRequest<SetEnabledRequest> implements UserRequest, WriteRequest<SetEnabledRequest> {
|
public class SetEnabledRequest extends ActionRequest implements UserRequest, WriteRequest<SetEnabledRequest> {
|
||||||
|
|
||||||
private Boolean enabled;
|
private Boolean enabled;
|
||||||
private String username;
|
private String username;
|
||||||
|
|
|
@ -395,7 +395,7 @@ public class SecurityIndexSearcherWrapper extends IndexSearcherWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Client client = new FilterClient(original.getClient()) {
|
Client client = new FilterClient(original.getClient()) {
|
||||||
@Override
|
@Override
|
||||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse,
|
protected <Request extends ActionRequest, Response extends ActionResponse,
|
||||||
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>>
|
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>>
|
||||||
void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||||
throw new IllegalStateException("role queries are not allowed to execute additional requests");
|
throw new IllegalStateException("role queries are not allowed to execute additional requests");
|
||||||
|
|
|
@ -395,7 +395,7 @@ public class Watcher implements ActionPlugin, ScriptPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||||
if (false == enabled) {
|
if (false == enabled) {
|
||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.elasticsearch.action;
|
||||||
|
|
||||||
import org.elasticsearch.action.support.IndicesOptions;
|
import org.elasticsearch.action.support.IndicesOptions;
|
||||||
|
|
||||||
public class MockIndicesRequest extends ActionRequest<MockIndicesRequest> implements IndicesRequest {
|
public class MockIndicesRequest extends ActionRequest implements IndicesRequest {
|
||||||
|
|
||||||
private final String[] indices;
|
private final String[] indices;
|
||||||
private final IndicesOptions indicesOptions;
|
private final IndicesOptions indicesOptions;
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class InternalClientTests extends ESTestCase {
|
||||||
public void testContextIsPreserved() throws IOException, InterruptedException {
|
public void testContextIsPreserved() throws IOException, InterruptedException {
|
||||||
FilterClient dummy = new FilterClient(Settings.EMPTY, threadPool, null) {
|
FilterClient dummy = new FilterClient(Settings.EMPTY, threadPool, null) {
|
||||||
@Override
|
@Override
|
||||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends
|
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends
|
||||||
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder>
|
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder>
|
||||||
action, Request request,
|
action, Request request,
|
||||||
ActionListener<Response> listener) {
|
ActionListener<Response> listener) {
|
||||||
|
@ -96,7 +96,7 @@ public class InternalClientTests extends ESTestCase {
|
||||||
public void testContextIsPreservedOnError() throws IOException, InterruptedException {
|
public void testContextIsPreservedOnError() throws IOException, InterruptedException {
|
||||||
FilterClient dummy = new FilterClient(Settings.EMPTY, threadPool, null) {
|
FilterClient dummy = new FilterClient(Settings.EMPTY, threadPool, null) {
|
||||||
@Override
|
@Override
|
||||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends
|
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends
|
||||||
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder>
|
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder>
|
||||||
action, Request request,
|
action, Request request,
|
||||||
ActionListener<Response> listener) {
|
ActionListener<Response> listener) {
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class SecurityTemplateServiceTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends
|
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends
|
||||||
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
||||||
Action<Request, Response, RequestBuilder> action, Request request
|
Action<Request, Response, RequestBuilder> action, Request request
|
||||||
, ActionListener<Response> listener) {
|
, ActionListener<Response> listener) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class IndexAuditTrailMutedTests extends ESTestCase {
|
||||||
super(Settings.EMPTY, null, transportClient, null);
|
super(Settings.EMPTY, null, transportClient, null);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends
|
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends
|
||||||
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
||||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||||
clientCalled.set(true);
|
clientCalled.set(true);
|
||||||
|
|
Loading…
Reference in New Issue