aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/session')
-rw-r--r--src/main/java/org/traccar/session/cache/CacheManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java
index bb9b4c995..89b25af2f 100644
--- a/src/main/java/org/traccar/session/cache/CacheManager.java
+++ b/src/main/java/org/traccar/session/cache/CacheManager.java
@@ -136,14 +136,15 @@ public class CacheManager implements BroadcastInterface {
}
}
- public Stream<Notification> getDeviceNotifications(long deviceId) {
+ public Set<Notification> getDeviceNotifications(long deviceId) {
try {
lock.readLock().lock();
var direct = graph.getObjects(Device.class, deviceId, Notification.class, Set.of(Group.class), true)
.map(BaseModel::getId)
.collect(Collectors.toUnmodifiableSet());
return graph.getObjects(Device.class, deviceId, Notification.class, Set.of(Group.class, User.class), true)
- .filter(notification -> notification.getAlways() || direct.contains(notification.getId()));
+ .filter(notification -> notification.getAlways() || direct.contains(notification.getId()))
+ .collect(Collectors.toUnmodifiableSet());
} finally {
lock.readLock().unlock();
}