diff options
author | Abyss777 <abyss@fox5.ru> | 2016-06-23 16:17:25 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-06-23 16:17:25 +0500 |
commit | bd2e0fdc6fe222316e9e740aa265b6d132d407b6 (patch) | |
tree | 0e146fde0b2a7556c380a4b715cb88e42b97d8cb /src/org/traccar/web/WebServer.java | |
parent | a445733519b4b38b52b03fbb63a55c7270cb9221 (diff) | |
download | trackermap-server-bd2e0fdc6fe222316e9e740aa265b6d132d407b6.tar.gz trackermap-server-bd2e0fdc6fe222316e9e740aa265b6d132d407b6.tar.bz2 trackermap-server-bd2e0fdc6fe222316e9e740aa265b6d132d407b6.zip |
Added possibility to disable event and geofence subsystems
Diffstat (limited to 'src/org/traccar/web/WebServer.java')
-rw-r--r-- | src/org/traccar/web/WebServer.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index c06ee5d35..2fa5c1a80 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -29,6 +29,7 @@ import org.glassfish.jersey.jackson.JacksonFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; import org.traccar.Config; +import org.traccar.Context; import org.traccar.api.AsyncSocketServlet; import org.traccar.api.CorsResponseFilter; import org.traccar.api.ObjectMapperProvider; @@ -154,8 +155,14 @@ public class WebServer { resourceConfig.registerClasses(ServerResource.class, SessionResource.class, CommandResource.class, GroupPermissionResource.class, DevicePermissionResource.class, UserResource.class, GroupResource.class, DeviceResource.class, PositionResource.class, - CommandTypeResource.class, EventResource.class, GeofenceResource.class, - DeviceGeofenceResource.class, GeofencePermissionResource.class, GroupGeofenceResource.class); + CommandTypeResource.class); + if (Context.getConfig().getBoolean("event.enable")) { + resourceConfig.registerClasses(EventResource.class); + } + if (Context.getConfig().getBoolean("geofence.enable")) { + resourceConfig.registerClasses(GeofenceResource.class, DeviceGeofenceResource.class, + GeofencePermissionResource.class, GroupGeofenceResource.class); + } servletHandler.addServlet(new ServletHolder(new ServletContainer(resourceConfig)), "/*"); handlers.addHandler(servletHandler); |