|
91 | 91 | import java.io.IOException;
|
92 | 92 | import java.time.Clock;
|
93 | 93 | import java.util.ArrayList;
|
94 |
| -import java.util.Arrays; |
95 | 94 | import java.util.Collection;
|
96 | 95 | import java.util.List;
|
97 | 96 | import java.util.function.LongSupplier;
|
@@ -121,7 +120,7 @@ protected Clock getClock() {
|
121 | 120 |
|
122 | 121 | @Override
|
123 | 122 | public List<Setting<?>> getSettings() {
|
124 |
| - return Arrays.asList( |
| 123 | + return List.of( |
125 | 124 | LifecycleSettings.LIFECYCLE_POLL_INTERVAL_SETTING,
|
126 | 125 | LifecycleSettings.LIFECYCLE_NAME_SETTING,
|
127 | 126 | LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE_SETTING,
|
@@ -204,7 +203,7 @@ public List<NamedXContentRegistry.Entry> getNamedXContent() {
|
204 | 203 | }
|
205 | 204 |
|
206 | 205 | private static List<NamedXContentRegistry.Entry> xContentEntries() {
|
207 |
| - return Arrays.asList( |
| 206 | + return List.of( |
208 | 207 | // Custom Metadata
|
209 | 208 | new NamedXContentRegistry.Entry(
|
210 | 209 | Metadata.Custom.class,
|
@@ -260,52 +259,38 @@ public List<RestHandler> getRestHandlers(
|
260 | 259 | Supplier<DiscoveryNodes> nodesInCluster,
|
261 | 260 | Predicate<NodeFeature> clusterSupportsFeature
|
262 | 261 | ) {
|
263 |
| - List<RestHandler> handlers = new ArrayList<>(); |
264 |
| - |
265 |
| - handlers.addAll( |
266 |
| - Arrays.asList( |
267 |
| - // add ILM rest handlers |
268 |
| - new RestPutLifecycleAction(), |
269 |
| - new RestGetLifecycleAction(), |
270 |
| - new RestDeleteLifecycleAction(), |
271 |
| - new RestExplainLifecycleAction(), |
272 |
| - new RestRemoveIndexLifecyclePolicyAction(), |
273 |
| - new RestMoveToStepAction(), |
274 |
| - new RestRetryAction(), |
275 |
| - new RestStopAction(), |
276 |
| - new RestStartILMAction(), |
277 |
| - new RestGetStatusAction(), |
278 |
| - new RestMigrateToDataTiersAction() |
279 |
| - ) |
| 262 | + return List.of( |
| 263 | + new RestPutLifecycleAction(), |
| 264 | + new RestGetLifecycleAction(), |
| 265 | + new RestDeleteLifecycleAction(), |
| 266 | + new RestExplainLifecycleAction(), |
| 267 | + new RestRemoveIndexLifecyclePolicyAction(), |
| 268 | + new RestMoveToStepAction(), |
| 269 | + new RestRetryAction(), |
| 270 | + new RestStopAction(), |
| 271 | + new RestStartILMAction(), |
| 272 | + new RestGetStatusAction(), |
| 273 | + new RestMigrateToDataTiersAction() |
280 | 274 | );
|
281 |
| - return handlers; |
282 | 275 | }
|
283 | 276 |
|
284 | 277 | @Override
|
285 | 278 | public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
286 |
| - var ilmUsageAction = new ActionHandler<>(XPackUsageFeatureAction.INDEX_LIFECYCLE, IndexLifecycleUsageTransportAction.class); |
287 |
| - var ilmInfoAction = new ActionHandler<>(XPackInfoFeatureAction.INDEX_LIFECYCLE, IndexLifecycleInfoTransportAction.class); |
288 |
| - var migrateToDataTiersAction = new ActionHandler<>(MigrateToDataTiersAction.INSTANCE, TransportMigrateToDataTiersAction.class); |
289 |
| - List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>(); |
290 |
| - actions.add(ilmUsageAction); |
291 |
| - actions.add(ilmInfoAction); |
292 |
| - actions.add(migrateToDataTiersAction); |
293 |
| - actions.addAll( |
294 |
| - Arrays.asList( |
295 |
| - // add ILM actions |
296 |
| - new ActionHandler<>(ILMActions.PUT, TransportPutLifecycleAction.class), |
297 |
| - new ActionHandler<>(GetLifecycleAction.INSTANCE, TransportGetLifecycleAction.class), |
298 |
| - new ActionHandler<>(DeleteLifecycleAction.INSTANCE, TransportDeleteLifecycleAction.class), |
299 |
| - new ActionHandler<>(ExplainLifecycleAction.INSTANCE, TransportExplainLifecycleAction.class), |
300 |
| - new ActionHandler<>(RemoveIndexLifecyclePolicyAction.INSTANCE, TransportRemoveIndexLifecyclePolicyAction.class), |
301 |
| - new ActionHandler<>(ILMActions.MOVE_TO_STEP, TransportMoveToStepAction.class), |
302 |
| - new ActionHandler<>(ILMActions.RETRY, TransportRetryAction.class), |
303 |
| - new ActionHandler<>(ILMActions.START, TransportStartILMAction.class), |
304 |
| - new ActionHandler<>(ILMActions.STOP, TransportStopILMAction.class), |
305 |
| - new ActionHandler<>(GetStatusAction.INSTANCE, TransportGetStatusAction.class) |
306 |
| - ) |
| 279 | + return List.of( |
| 280 | + new ActionHandler<>(XPackUsageFeatureAction.INDEX_LIFECYCLE, IndexLifecycleUsageTransportAction.class), |
| 281 | + new ActionHandler<>(XPackInfoFeatureAction.INDEX_LIFECYCLE, IndexLifecycleInfoTransportAction.class), |
| 282 | + new ActionHandler<>(MigrateToDataTiersAction.INSTANCE, TransportMigrateToDataTiersAction.class), |
| 283 | + new ActionHandler<>(ILMActions.PUT, TransportPutLifecycleAction.class), |
| 284 | + new ActionHandler<>(GetLifecycleAction.INSTANCE, TransportGetLifecycleAction.class), |
| 285 | + new ActionHandler<>(DeleteLifecycleAction.INSTANCE, TransportDeleteLifecycleAction.class), |
| 286 | + new ActionHandler<>(ExplainLifecycleAction.INSTANCE, TransportExplainLifecycleAction.class), |
| 287 | + new ActionHandler<>(RemoveIndexLifecyclePolicyAction.INSTANCE, TransportRemoveIndexLifecyclePolicyAction.class), |
| 288 | + new ActionHandler<>(ILMActions.MOVE_TO_STEP, TransportMoveToStepAction.class), |
| 289 | + new ActionHandler<>(ILMActions.RETRY, TransportRetryAction.class), |
| 290 | + new ActionHandler<>(ILMActions.START, TransportStartILMAction.class), |
| 291 | + new ActionHandler<>(ILMActions.STOP, TransportStopILMAction.class), |
| 292 | + new ActionHandler<>(GetStatusAction.INSTANCE, TransportGetStatusAction.class) |
307 | 293 | );
|
308 |
| - return actions; |
309 | 294 | }
|
310 | 295 |
|
311 | 296 | List<ReservedClusterStateHandler<?>> reservedClusterStateHandlers() {
|
|
0 commit comments