Fixed WebAPI registration

This commit is contained in:
Rsl1122 2017-09-26 20:01:08 +03:00
parent 5506e66e35
commit 7dcbac3fa7
2 changed files with 23 additions and 11 deletions

View File

@ -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()
);
}
/**

View File

@ -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);
}