Remove generics from ActionRequest

x-plugins side of elastic/elasticsearchelastic/elasticsearch#21556

Original commit: elastic/x-pack-elasticsearch@a8e8873c84
This commit is contained in:
Ryan Ernst 2016-11-14 15:36:46 -08:00
parent 23e6cab7f1
commit f2c4d1f4da
24 changed files with 26 additions and 26 deletions

View File

@ -39,7 +39,7 @@ public class Licensing implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
if (isTribeNode) {
return emptyList();
}

View File

@ -357,8 +357,8 @@ public class XPackPlugin extends Plugin implements ScriptPlugin, ActionPlugin, I
}
@Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> actions = new ArrayList<>();
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionHandler<>(XPackInfoAction.INSTANCE, TransportXPackInfoAction.class));
actions.add(new ActionHandler<>(XPackUsageAction.INSTANCE, TransportXPackUsageAction.class));
actions.addAll(licensing.getActions());

View File

@ -14,7 +14,7 @@ import java.io.IOException;
import java.util.EnumSet;
import java.util.Locale;
public class XPackInfoRequest extends ActionRequest<XPackInfoRequest> {
public class XPackInfoRequest extends ActionRequest {
public enum Category {
BUILD, LICENSE, FEATURES;

View File

@ -42,7 +42,7 @@ public class Graph extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
if (false == enabled) {
return emptyList();
}

View File

@ -29,7 +29,7 @@ import java.util.List;
* Holds the criteria required to guide the exploration of connected terms which
* 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_VERTICES_ERROR_MESSAGE = "Graph explore hop must have at least one VertexRequest";

View File

@ -125,7 +125,7 @@ public class Monitoring implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
if (false == enabled || tribeNode) {
return emptyList();
}

View File

@ -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
* 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<>();

View File

@ -62,7 +62,7 @@ public class InternalClient extends FilterClient {
}
@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> action, Request request, ActionListener<Response> listener) {

View File

@ -469,7 +469,7 @@ public class Security implements ActionPlugin, IngestPlugin, NetworkPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
if (enabled == false) {
return emptyList();
}

View File

@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* 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 RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;

View File

@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* 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;

View File

@ -28,7 +28,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* 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[] clusterPrivileges = Strings.EMPTY_ARRAY;

View File

@ -15,7 +15,7 @@ import java.io.IOException;
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;

View File

@ -22,7 +22,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* Request to change a user's password.
*/
public class ChangePasswordRequest extends ActionRequest<ChangePasswordRequest>
public class ChangePasswordRequest extends ActionRequest
implements UserRequest, WriteRequest<ChangePasswordRequest> {
private String username;

View File

@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* 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 RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;

View File

@ -18,7 +18,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* Request to retrieve a native user.
*/
public class GetUsersRequest extends ActionRequest<GetUsersRequest> implements UserRequest {
public class GetUsersRequest extends ActionRequest implements UserRequest {
private String[] usernames;

View File

@ -24,7 +24,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* 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[] roles;

View File

@ -21,7 +21,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/**
* 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 String username;

View File

@ -395,7 +395,7 @@ public class SecurityIndexSearcherWrapper extends IndexSearcherWrapper {
throws IOException {
Client client = new FilterClient(original.getClient()) {
@Override
protected <Request extends ActionRequest<Request>, Response extends ActionResponse,
protected <Request extends ActionRequest, Response extends ActionResponse,
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>>
void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
throw new IllegalStateException("role queries are not allowed to execute additional requests");

View File

@ -395,7 +395,7 @@ public class Watcher implements ActionPlugin, ScriptPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
if (false == enabled) {
return emptyList();
}

View File

@ -7,7 +7,7 @@ package org.elasticsearch.action;
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 IndicesOptions indicesOptions;

View File

@ -43,7 +43,7 @@ public class InternalClientTests extends ESTestCase {
public void testContextIsPreserved() throws IOException, InterruptedException {
FilterClient dummy = new FilterClient(Settings.EMPTY, threadPool, null) {
@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>
action, Request request,
ActionListener<Response> listener) {
@ -96,7 +96,7 @@ public class InternalClientTests extends ESTestCase {
public void testContextIsPreservedOnError() throws IOException, InterruptedException {
FilterClient dummy = new FilterClient(Settings.EMPTY, threadPool, null) {
@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>
action, Request request,
ActionListener<Response> listener) {

View File

@ -73,7 +73,7 @@ public class SecurityTemplateServiceTests extends ESTestCase {
}
@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> action, Request request
, ActionListener<Response> listener) {

View File

@ -66,7 +66,7 @@ public class IndexAuditTrailMutedTests extends ESTestCase {
super(Settings.EMPTY, null, transportClient, null);
}
@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> action, Request request, ActionListener<Response> listener) {
clientCalled.set(true);