aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/AsyncSocketServlet.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 11:08:32 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 11:08:32 -0700
commitddbe4d7de6ae7590e2b927066312597efa129393 (patch)
tree777882e24ce5488b4cfc8a4d6f11119abcbeb7a3 /src/main/java/org/traccar/api/AsyncSocketServlet.java
parent182656b6dc1fb5d167bb752c16ecf633add001a8 (diff)
downloadtrackermap-server-ddbe4d7de6ae7590e2b927066312597efa129393.tar.gz
trackermap-server-ddbe4d7de6ae7590e2b927066312597efa129393.tar.bz2
trackermap-server-ddbe4d7de6ae7590e2b927066312597efa129393.zip
Remove positions from manager
Diffstat (limited to 'src/main/java/org/traccar/api/AsyncSocketServlet.java')
-rw-r--r--src/main/java/org/traccar/api/AsyncSocketServlet.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/api/AsyncSocketServlet.java b/src/main/java/org/traccar/api/AsyncSocketServlet.java
index 7c532179b..7d9fdf0ed 100644
--- a/src/main/java/org/traccar/api/AsyncSocketServlet.java
+++ b/src/main/java/org/traccar/api/AsyncSocketServlet.java
@@ -22,6 +22,7 @@ import org.traccar.Context;
import org.traccar.api.resource.SessionResource;
import org.traccar.config.Keys;
import org.traccar.session.ConnectionManager;
+import org.traccar.storage.Storage;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -33,11 +34,13 @@ public class AsyncSocketServlet extends JettyWebSocketServlet {
private final ObjectMapper objectMapper;
private final ConnectionManager connectionManager;
+ private final Storage storage;
@Inject
- public AsyncSocketServlet(ObjectMapper objectMapper, ConnectionManager connectionManager) {
+ public AsyncSocketServlet(ObjectMapper objectMapper, ConnectionManager connectionManager, Storage storage) {
this.objectMapper = objectMapper;
this.connectionManager = connectionManager;
+ this.storage = storage;
}
@Override
@@ -46,7 +49,7 @@ public class AsyncSocketServlet extends JettyWebSocketServlet {
factory.setCreator((req, resp) -> {
if (req.getSession() != null) {
long userId = (Long) ((HttpSession) req.getSession()).getAttribute(SessionResource.USER_ID_KEY);
- return new AsyncSocket(objectMapper, connectionManager, userId);
+ return new AsyncSocket(objectMapper, connectionManager, storage, userId);
} else {
return null;
}