Skip to content

Commit

Permalink
Revert "Make MappedActionFilter its own interface (#107960)"
Browse files Browse the repository at this point in the history
This reverts commit 4dcf371.
  • Loading branch information
nielsbauman committed May 2, 2024
1 parent c8a8282 commit f9a5f1a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
Expand Up @@ -8,31 +8,6 @@

package org.elasticsearch.action.support;

import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.tasks.Task;

/**
* An action filter that is run only for a single action.
*
* Note: This is an independent interface from {@link ActionFilter} so that it does not
* have an order. The relative order of executed MappedActionFilter with the same action name
* is undefined.
*/
public interface MappedActionFilter {
/** Return the name of the action for which this filter should be run */
public interface MappedActionFilter extends ActionFilter {
String actionName();

/**
* Enables filtering the execution of an action on the request side, either by sending a response through the
* {@link ActionListener} or by continuing the execution through the given {@link ActionFilterChain chain}
*/
<Request extends ActionRequest, Response extends ActionResponse> void apply(
Task task,
String action,
Request request,
ActionListener<Response> listener,
ActionFilterChain<Request, Response> chain
);
}
Expand Up @@ -59,6 +59,11 @@ public String actionName() {
return "dummyAction";
}

@Override
public int order() {
return 0;
}

@Override
public <Request extends ActionRequest, Response extends ActionResponse> void apply(
Task task,
Expand Down Expand Up @@ -95,6 +100,11 @@ public String actionName() {
return "dummyAction";
}

@Override
public int order() {
return 0;
}

@Override
public <Request extends ActionRequest, Response extends ActionResponse> void apply(
Task task,
Expand All @@ -113,6 +123,11 @@ public String actionName() {
return "dummyAction";
}

@Override
public int order() {
return 0;
}

@Override
public <Request extends ActionRequest, Response extends ActionResponse> void apply(
Task task,
Expand Down Expand Up @@ -149,6 +164,11 @@ public String actionName() {
return "dummyAction";
}

@Override
public int order() {
return 0;
}

@Override
public <Request extends ActionRequest, Response extends ActionResponse> void apply(
Task task,
Expand Down
Expand Up @@ -31,6 +31,11 @@ protected ApiFilteringActionFilter(ThreadContext threadContext, String actionNam
this.responseClass = responseClass;
}

@Override
public int order() {
return 0;
}

@Override
public final String actionName() {
return actionName;
Expand Down

0 comments on commit f9a5f1a

Please sign in to comment.