aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-14 18:50:48 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-14 18:50:48 -0700
commit0d5c7606c73d84aab44f69936ab62afa0b68939b (patch)
tree4e9cbebe1ddcd3e3b75a15bee8e23d05374ca434 /src/main/java/org/traccar/session
parent415ba3ddb0f770b829c997beb3e575ffb6e195ec (diff)
downloadtrackermap-server-0d5c7606c73d84aab44f69936ab62afa0b68939b.tar.gz
trackermap-server-0d5c7606c73d84aab44f69936ab62afa0b68939b.tar.bz2
trackermap-server-0d5c7606c73d84aab44f69936ab62afa0b68939b.zip
Refactor notification manager
Diffstat (limited to 'src/main/java/org/traccar/session')
-rw-r--r--src/main/java/org/traccar/session/ConnectionManager.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java
index ab3c36734..dc714379b 100644
--- a/src/main/java/org/traccar/session/ConnectionManager.java
+++ b/src/main/java/org/traccar/session/ConnectionManager.java
@@ -25,6 +25,7 @@ import org.traccar.Main;
import org.traccar.Protocol;
import org.traccar.config.Config;
import org.traccar.config.Keys;
+import org.traccar.database.NotificationManager;
import org.traccar.handler.events.MotionEventHandler;
import org.traccar.handler.events.OverspeedEventHandler;
import org.traccar.model.Device;
@@ -63,6 +64,7 @@ public class ConnectionManager {
private final Config config;
private final CacheManager cacheManager;
private final Storage storage;
+ private final NotificationManager notificationManager;
private final Timer timer;
private final Map<Long, Set<UpdateListener>> listeners = new ConcurrentHashMap<>();
@@ -70,10 +72,12 @@ public class ConnectionManager {
@Inject
public ConnectionManager(
- Config config, CacheManager cacheManager, Storage storage, Timer timer) {
+ Config config, CacheManager cacheManager, Storage storage,
+ NotificationManager notificationManager, Timer timer) {
this.config = config;
this.cacheManager = cacheManager;
this.storage = storage;
+ this.notificationManager = notificationManager;
this.timer = timer;
deviceTimeout = config.getLong(Keys.STATUS_TIMEOUT) * 1000;
updateDeviceState = config.getBoolean(Keys.STATUS_UPDATE_DEVICE_STATE);
@@ -163,7 +167,6 @@ public class ConnectionManager {
if (defaultGroupId != 0) {
Context.getPermissionsManager().refreshDeviceAndGroupPermissions();
- Context.getPermissionsManager().refreshAllExtendedPermissions();
}
return device;
@@ -236,7 +239,7 @@ public class ConnectionManager {
break;
}
events.put(new Event(eventType, deviceId), null);
- Context.getNotificationManager().updateEvents(events);
+ notificationManager.updateEvents(events);
}
Timeout timeout = timeouts.remove(deviceId);