aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/NotificationManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-20 08:56:29 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-20 09:52:27 +0500
commitafb9a199f57824ec06c993b6028c35b616f64885 (patch)
tree1ab2531846dc1ff4c9b5e0d6d71ebcec231aff89 /src/org/traccar/database/NotificationManager.java
parenta9478ded48de140d47d17def1ee5329267fe6088 (diff)
downloadtrackermap-server-afb9a199f57824ec06c993b6028c35b616f64885.tar.gz
trackermap-server-afb9a199f57824ec06c993b6028c35b616f64885.tar.bz2
trackermap-server-afb9a199f57824ec06c993b6028c35b616f64885.zip
Combine permission resources and reuse common database functions
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-rw-r--r--src/org/traccar/database/NotificationManager.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java
index 11d5a9aca..0987f255b 100644
--- a/src/org/traccar/database/NotificationManager.java
+++ b/src/org/traccar/database/NotificationManager.java
@@ -49,7 +49,7 @@ public class NotificationManager {
public void updateEvent(Event event, Position position) {
try {
- dataManager.addEvent(event);
+ dataManager.addObject(event);
} catch (SQLException error) {
Log.warning(error);
}
@@ -105,7 +105,7 @@ public class NotificationManager {
notificationsLock.writeLock().lock();
try {
userNotifications.clear();
- for (Notification notification : dataManager.getNotifications()) {
+ for (Notification notification : dataManager.getObjects(Notification.class)) {
getUserNotificationsUnsafe(notification.getUserId()).add(notification);
}
} finally {
@@ -139,7 +139,7 @@ public class NotificationManager {
|| cachedNotification.getSms() != notification.getSms()) {
if (!notification.getWeb() && !notification.getMail() && !notification.getSms()) {
try {
- dataManager.removeNotification(cachedNotification);
+ dataManager.removeObject(Notification.class, cachedNotification.getId());
} catch (SQLException error) {
Log.warning(error);
}
@@ -160,7 +160,7 @@ public class NotificationManager {
notificationsLock.writeLock().unlock();
}
try {
- dataManager.updateNotification(cachedNotification);
+ dataManager.updateObject(cachedNotification);
} catch (SQLException error) {
Log.warning(error);
}
@@ -170,7 +170,7 @@ public class NotificationManager {
}
} else if (notification.getWeb() || notification.getMail() || notification.getSms()) {
try {
- dataManager.addNotification(notification);
+ dataManager.addObject(notification);
} catch (SQLException error) {
Log.warning(error);
}