From 256a9c430c91c6abd5fe82b13475f3fdf3a1596c Mon Sep 17 00:00:00 2001 From: "Ricardo L. Stephen" Date: Tue, 26 May 2020 18:28:49 -0700 Subject: [PATCH] Store REST routes as fields --- .../config/PerformanceAnalyzerConfigAction.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/config/PerformanceAnalyzerConfigAction.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/config/PerformanceAnalyzerConfigAction.java index c8d54a86..17a6903e 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/config/PerformanceAnalyzerConfigAction.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/config/PerformanceAnalyzerConfigAction.java @@ -49,6 +49,10 @@ public class PerformanceAnalyzerConfigAction extends BaseRestHandler { private static PerformanceAnalyzerConfigAction instance = null; private boolean isInitialized = false; private boolean featureEanbledDefaultValue = true; + private static final List ROUTES = unmodifiableList(asList( + new Route(org.elasticsearch.rest.RestRequest.Method.GET, "/_opendistro/_performanceanalyzer/config"), + new Route(org.elasticsearch.rest.RestRequest.Method.POST, "/_opendistro/_performanceanalyzer/config") + )); public static PerformanceAnalyzerConfigAction getInstance() { return instance; @@ -68,10 +72,7 @@ public PerformanceAnalyzerConfigAction(RestController controller) { @Override public List routes() { - return unmodifiableList(asList( - new Route(org.elasticsearch.rest.RestRequest.Method.GET, "/_opendistro/_performanceanalyzer/config"), - new Route(org.elasticsearch.rest.RestRequest.Method.POST, "/_opendistro/_performanceanalyzer/config") - )); + return ROUTES; } @Override