aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/WebServer.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-16 11:24:54 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-16 11:24:54 +1200
commit30f10f12d32915d74e36b4bf336e4e2d7ac3aada (patch)
tree995c926096db04c6b3e90b58bcb6a6f7db1bb322 /src/org/traccar/web/WebServer.java
parentfdd2fdf77cc5152986e26abf79f348b23b24ca64 (diff)
downloadtrackermap-server-30f10f12d32915d74e36b4bf336e4e2d7ac3aada.tar.gz
trackermap-server-30f10f12d32915d74e36b4bf336e4e2d7ac3aada.tar.bz2
trackermap-server-30f10f12d32915d74e36b4bf336e4e2d7ac3aada.zip
Remove old web API service
Diffstat (limited to 'src/org/traccar/web/WebServer.java')
-rw-r--r--src/org/traccar/web/WebServer.java29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 973f6a0a5..f1a282567 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,19 +76,15 @@ public class WebServer {
this.dataSource = dataSource;
initServer();
+ initApi();
+ if (config.getBoolean("web.console")) {
+ initConsole();
+ }
switch (config.getString("web.type", "new")) {
- case "api":
- initOldApi();
- break;
case "old":
- initOldApi();
initOldWebApp();
break;
default:
- initApi();
- if (config.getBoolean("web.console")) {
- initConsole();
- }
initWebApp();
break;
}
@@ -151,21 +147,6 @@ public class WebServer {
handlers.addHandler(servletHandler);
}
- private void initOldApi() {
- ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
- servletHandler.setContextPath("/api");
- servletHandler.getSessionHandler().setSessionManager(sessionManager);
-
- servletHandler.addServlet(new ServletHolder(new AsyncServlet()), "/async/*");
- servletHandler.addServlet(new ServletHolder(new ServerServlet()), "/server/*");
- servletHandler.addServlet(new ServletHolder(new UserServlet()), "/user/*");
- servletHandler.addServlet(new ServletHolder(new DeviceServlet()), "/device/*");
- servletHandler.addServlet(new ServletHolder(new PositionServlet()), "/position/*");
- servletHandler.addServlet(new ServletHolder(new CommandServlet()), "/command/*");
- servletHandler.addServlet(new ServletHolder(new MainServlet()), "/*");
- handlers.addHandler(servletHandler);
- }
-
private void initConsole() {
ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
servletHandler.setContextPath("/console");