aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session/cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/session/cache')
-rw-r--r--src/main/java/org/traccar/session/cache/CacheManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java
index 102a31ecd..6ea0f252d 100644
--- a/src/main/java/org/traccar/session/cache/CacheManager.java
+++ b/src/main/java/org/traccar/session/cache/CacheManager.java
@@ -105,6 +105,13 @@ public class CacheManager {
}
}
+ public Driver findDriverByUniqueId(long deviceId, String driverUniqueId) {
+ return getDeviceObjects(deviceId, Driver.class).stream()
+ .filter(driver -> driver.getUniqueId().equals(driverUniqueId))
+ .findFirst()
+ .orElse(null);
+ }
+
public void addDevice(long deviceId) throws StorageException {
try {
lock.writeLock().lock();