|
9 | 9 | import org.elasticsearch.action.ActionListener; |
10 | 10 | import org.elasticsearch.action.ActionType; |
11 | 11 | import org.elasticsearch.action.support.ActionFilters; |
| 12 | +import org.elasticsearch.action.support.ChannelActionListener; |
12 | 13 | import org.elasticsearch.action.support.local.TransportLocalClusterStateAction; |
13 | 14 | import org.elasticsearch.cluster.ClusterState; |
14 | 15 | import org.elasticsearch.cluster.block.ClusterBlockException; |
15 | 16 | import org.elasticsearch.cluster.block.ClusterBlockLevel; |
16 | 17 | import org.elasticsearch.cluster.service.ClusterService; |
17 | 18 | import org.elasticsearch.common.util.concurrent.EsExecutors; |
| 19 | +import org.elasticsearch.core.UpdateForV10; |
18 | 20 | import org.elasticsearch.injection.guice.Inject; |
19 | 21 | import org.elasticsearch.tasks.Task; |
20 | 22 | import org.elasticsearch.transport.TransportService; |
21 | 23 |
|
22 | 24 | public class TransportGetBasicStatusAction extends TransportLocalClusterStateAction<GetBasicStatusRequest, GetBasicStatusResponse> { |
23 | 25 | public static final ActionType<GetBasicStatusResponse> TYPE = new ActionType<>("cluster:admin/xpack/license/basic_status"); |
24 | 26 |
|
| 27 | + /** |
| 28 | + * Prior to 9.3 this was a TransportMasterNodeReadAction so for BwC it must be registered with the TransportService until |
| 29 | + * we no longer need to support calling this action remotely. |
| 30 | + */ |
| 31 | + @UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION) |
| 32 | + @SuppressWarnings("this-escape") |
25 | 33 | @Inject |
26 | 34 | public TransportGetBasicStatusAction(TransportService transportService, ClusterService clusterService, ActionFilters actionFilters) { |
27 | 35 | super(TYPE.name(), actionFilters, transportService.getTaskManager(), clusterService, EsExecutors.DIRECT_EXECUTOR_SERVICE); |
| 36 | + |
| 37 | + transportService.registerRequestHandler( |
| 38 | + actionName, |
| 39 | + executor, |
| 40 | + false, |
| 41 | + true, |
| 42 | + GetBasicStatusRequest::new, |
| 43 | + (request, channel, task) -> executeDirect(task, request, new ChannelActionListener<>(channel)) |
| 44 | + ); |
28 | 45 | } |
29 | 46 |
|
30 | 47 | @Override |
|
0 commit comments