diff options
author | Abyss777 <abyss@fox5.ru> | 2016-06-26 00:51:33 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-06-26 00:51:33 +0500 |
commit | a25e7bd56c128fb2a1c673abf735b3e64706f9a8 (patch) | |
tree | a99d2cde526f97082d7bc95531772b6835064fcd /src/org/traccar/database/DataManager.java | |
parent | 67f46c80d3b5e34440a2644f52b81dddfbaba5fa (diff) | |
download | trackermap-server-a25e7bd56c128fb2a1c673abf735b3e64706f9a8.tar.gz trackermap-server-a25e7bd56c128fb2a1c673abf735b3e64706f9a8.tar.bz2 trackermap-server-a25e7bd56c128fb2a1c673abf735b3e64706f9a8.zip |
Added notifications via email
Added notifications settings
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 860bf1b84..031703023 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -52,6 +52,7 @@ import org.traccar.model.Geofence; import org.traccar.model.Group; import org.traccar.model.GroupGeofence; import org.traccar.model.GroupPermission; +import org.traccar.model.Notification; import org.traccar.model.Position; import org.traccar.model.Server; import org.traccar.model.User; @@ -644,4 +645,27 @@ public class DataManager implements IdentityManager { .setLong("geofenceId", geofenceId) .executeUpdate(); } + + public Collection<Notification> getNotifications() throws SQLException { + return QueryBuilder.create(dataSource, getQuery("database.selectNotifications")) + .executeQuery(Notification.class); + } + + public void addNotification(Notification notification) throws SQLException { + notification.setId(QueryBuilder.create(dataSource, getQuery("database.insertNotification"), true) + .setObject(notification) + .executeUpdate()); + } + + public void updateNotification(Notification notification) throws SQLException { + QueryBuilder.create(dataSource, getQuery("database.updateNotification")) + .setObject(notification) + .executeUpdate(); + } + + public void removeNotification(Notification notification) throws SQLException { + QueryBuilder.create(dataSource, getQuery("database.deleteNotification")) + .setLong("id", notification.getId()) + .executeUpdate(); + } } |