aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DeviceManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r--src/org/traccar/database/DeviceManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java
index 5d123f9b8..3b7e5c617 100644
--- a/src/org/traccar/database/DeviceManager.java
+++ b/src/org/traccar/database/DeviceManager.java
@@ -33,6 +33,7 @@ import org.traccar.helper.Log;
import org.traccar.model.Command;
import org.traccar.model.CommandType;
import org.traccar.model.Device;
+import org.traccar.model.DeviceState;
import org.traccar.model.DeviceTotalDistance;
import org.traccar.model.Group;
import org.traccar.model.Position;
@@ -52,6 +53,8 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
private final Map<Long, Position> positions = new ConcurrentHashMap<>();
+ private final Map<Long, DeviceState> deviceStates = new ConcurrentHashMap<>();
+
private boolean fallbackToText;
public DeviceManager(DataManager dataManager) {
@@ -387,4 +390,13 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
}
return result;
}
+
+ public DeviceState getDeviceState(long deviceId) {
+ return deviceStates.get(deviceId);
+ }
+
+ public void setDeviceState(long deviceId, DeviceState deviceState) {
+ deviceStates.put(deviceId, deviceState);
+ }
+
}