aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-02-19 11:53:08 -0800
committerAnton Tananaev <anton@traccar.org>2024-02-19 11:53:14 -0800
commitefd9e261791942334dbf4a911883a1b2b791f282 (patch)
tree8aa830282cd64b9b3a28e858865a8783b1eea3bc /src/main/java/org/traccar/session
parent26548bb534de6c9944ece5a2aa5216da83cb8819 (diff)
downloadtrackermap-server-efd9e261791942334dbf4a911883a1b2b791f282.tar.gz
trackermap-server-efd9e261791942334dbf4a911883a1b2b791f282.tar.bz2
trackermap-server-efd9e261791942334dbf4a911883a1b2b791f282.zip
Streamline model name access
Diffstat (limited to 'src/main/java/org/traccar/session')
-rw-r--r--src/main/java/org/traccar/session/ConnectionManager.java2
-rw-r--r--src/main/java/org/traccar/session/DeviceSession.java9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java
index 121b876c5..42dcf5ce9 100644
--- a/src/main/java/org/traccar/session/ConnectionManager.java
+++ b/src/main/java/org/traccar/session/ConnectionManager.java
@@ -147,7 +147,7 @@ public class ConnectionManager implements BroadcastInterface {
}
DeviceSession deviceSession = new DeviceSession(
- device.getId(), device.getUniqueId(), protocol, channel, remoteAddress);
+ device.getId(), device.getUniqueId(), device.getModel(), protocol, channel, remoteAddress);
endpointSessions.put(device.getUniqueId(), deviceSession);
sessionsByEndpoint.put(remoteAddress, endpointSessions);
sessionsByDeviceId.put(device.getId(), deviceSession);
diff --git a/src/main/java/org/traccar/session/DeviceSession.java b/src/main/java/org/traccar/session/DeviceSession.java
index 009f90f5a..f124ca7f9 100644
--- a/src/main/java/org/traccar/session/DeviceSession.java
+++ b/src/main/java/org/traccar/session/DeviceSession.java
@@ -29,14 +29,17 @@ public class DeviceSession {
private final long deviceId;
private final String uniqueId;
+ private final String model;
private final Protocol protocol;
private final Channel channel;
private final SocketAddress remoteAddress;
public DeviceSession(
- long deviceId, String uniqueId, Protocol protocol, Channel channel, SocketAddress remoteAddress) {
+ long deviceId, String uniqueId, String model,
+ Protocol protocol, Channel channel, SocketAddress remoteAddress) {
this.deviceId = deviceId;
this.uniqueId = uniqueId;
+ this.model = model;
this.protocol = protocol;
this.channel = channel;
this.remoteAddress = remoteAddress;
@@ -50,6 +53,10 @@ public class DeviceSession {
return uniqueId;
}
+ public String getModel() {
+ return model;
+ }
+
public Channel getChannel() {
return channel;
}