diff options
author | Abyss777 <abyss@fox5.ru> | 2016-10-19 18:35:28 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-10-19 18:35:28 +0500 |
commit | 17f5a899a08b992507b574eeb4047b1f6bfa8629 (patch) | |
tree | 38044c918384b21e9533452d6a408f0935c96a1e /src/org/traccar/database/DataManager.java | |
parent | c613143105d9f7c898dd3fb236d683b76cf8a42c (diff) | |
download | trackermap-server-17f5a899a08b992507b574eeb4047b1f6bfa8629.tar.gz trackermap-server-17f5a899a08b992507b574eeb4047b1f6bfa8629.tar.bz2 trackermap-server-17f5a899a08b992507b574eeb4047b1f6bfa8629.zip |
- Filter events on server side
- Use common path for templates
- Filter events about geofences that user do not have access (minor security fix)
- Removed unused function
- Visual templates improvements
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 58d16d7f5..e98e1429c 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -20,7 +20,6 @@ import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.sql.SQLException; -import java.util.Calendar; import java.util.Collection; import java.util.Date; @@ -332,22 +331,14 @@ public class DataManager { .executeUpdate()); } - public Collection<Event> getEvents(long deviceId, String type, Date from, Date to) throws SQLException { + public Collection<Event> getEvents(long deviceId, Date from, Date to) throws SQLException { return QueryBuilder.create(dataSource, getQuery("database.selectEvents")) .setLong("deviceId", deviceId) - .setString("type", type) .setDate("from", from) .setDate("to", to) .executeQuery(Event.class); } - public Collection<Event> getLastEvents(long deviceId, String type, int interval) throws SQLException { - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.SECOND, -interval); - Date from = calendar.getTime(); - return getEvents(deviceId, type, from, new Date()); - } - public Collection<Geofence> getGeofences() throws SQLException { return QueryBuilder.create(dataSource, getQuery("database.selectGeofencesAll")) .executeQuery(Geofence.class); |