From 7dcbac3fa7200c8a60b8e755594c2d18adb38106 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 26 Sep 2017 20:01:08 +0300 Subject: [PATCH] Fixed WebAPI registration --- .../plan/systems/webserver/WebServer.java | 28 +++++++++++-------- .../webserver/webapi/WebAPIManager.java | 6 ++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/WebServer.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/WebServer.java index 8591bea0b..ef5dfa366 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/WebServer.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/WebServer.java @@ -54,18 +54,24 @@ public class WebServer { } private void registerWebAPIs() { - webAPI.registerNewAPI(new AnalyzeWebAPI()); - webAPI.registerNewAPI(new ConfigurationWebAPI()); - webAPI.registerNewAPI(new InspectWebAPI()); - webAPI.registerNewAPI(new IsOnlineWebAPI()); - webAPI.registerNewAPI(new PingWebAPI()); - webAPI.registerNewAPI(new RequestInspectPluginsTabBukkitWebAPI()); + webAPI.registerNewAPI( + new AnalysisReadyWebAPI(), + new AnalyzeWebAPI(), + new ConfigurationWebAPI(), + new InspectWebAPI(), + new IsOnlineWebAPI(), + new RequestInspectPluginsTabBukkitWebAPI(), + new PingWebAPI() + ); - webAPI.registerNewAPI(new IsCachedWebAPI()); - webAPI.registerNewAPI(new PostHtmlWebAPI()); - webAPI.registerNewAPI(new PostInspectPluginsTabWebAPI()); - webAPI.registerNewAPI(new RequestPluginsTabWebAPI()); - webAPI.registerNewAPI(new PostOriginalBukkitSettingsWebAPI()); + webAPI.registerNewAPI( + new IsCachedWebAPI(), + new PostHtmlWebAPI(), + new PostInspectPluginsTabWebAPI(), + new PostNetworkPageContentWebAPI(), + new PostOriginalBukkitSettingsWebAPI(), + new RequestPluginsTabWebAPI() + ); } /** diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java index 6bee7af28..23baaf46d 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/webapi/WebAPIManager.java @@ -21,6 +21,12 @@ public class WebAPIManager { registry = new HashMap<>(); } + public void registerNewAPI(WebAPI... api) { + for (WebAPI webAPI : api) { + registerNewAPI(webAPI); + } + } + public void registerNewAPI(WebAPI api) { registry.put(api.getClass().getSimpleName().toLowerCase(), api); }