aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-01-15 16:29:07 -0800
committerAnton Tananaev <anton@traccar.org>2024-01-15 16:29:07 -0800
commit72cfe80fb23bb5e1d2aec2f2d2b4cfcd3662a82d (patch)
treeefa860d9667f8937aa416c9b2f1aba3bd96de0fa /src/main/java/org/traccar/session
parenta531585474ca9ee7437d2a5b1698d1cf5f507a09 (diff)
downloadtrackermap-server-72cfe80fb23bb5e1d2aec2f2d2b4cfcd3662a82d.tar.gz
trackermap-server-72cfe80fb23bb5e1d2aec2f2d2b4cfcd3662a82d.tar.bz2
trackermap-server-72cfe80fb23bb5e1d2aec2f2d2b4cfcd3662a82d.zip
Configurable show unknown logs
Diffstat (limited to 'src/main/java/org/traccar/session')
-rw-r--r--src/main/java/org/traccar/session/ConnectionManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java
index a598260aa..1461c66ea 100644
--- a/src/main/java/org/traccar/session/ConnectionManager.java
+++ b/src/main/java/org/traccar/session/ConnectionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2023 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2024 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,6 +63,7 @@ public class ConnectionManager implements BroadcastInterface {
private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionManager.class);
private final long deviceTimeout;
+ private final boolean showUnknownDevices;
private final Map<Long, DeviceSession> sessionsByDeviceId = new ConcurrentHashMap<>();
private final Map<SocketAddress, Map<String, DeviceSession>> sessionsByEndpoint = new ConcurrentHashMap<>();
@@ -95,6 +96,7 @@ public class ConnectionManager implements BroadcastInterface {
this.broadcastService = broadcastService;
this.deviceLookupService = deviceLookupService;
deviceTimeout = config.getLong(Keys.STATUS_TIMEOUT);
+ showUnknownDevices = config.getBoolean(Keys.WEB_SHOW_UNKNOWN_DEVICES);
broadcastService.registerListener(this);
}
@@ -344,7 +346,7 @@ public class ConnectionManager implements BroadcastInterface {
var sessions = sessionsByEndpoint.getOrDefault(record.getAddress(), Map.of());
if (sessions.isEmpty()) {
String unknownUniqueId = unknownByEndpoint.get(record.getAddress());
- if (unknownUniqueId != null) {
+ if (unknownUniqueId != null && showUnknownDevices) {
record.setUniqueId(unknownUniqueId);
listeners.values().stream()
.flatMap(Set::stream)