diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-17 12:35:16 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-17 12:35:16 +1300 |
commit | 843a370660646499c3007256be953506567f23fb (patch) | |
tree | bb912568b1dad621271a2016ba946634e8e93306 /src/org/traccar/database/DataManager.java | |
parent | 60343748265c7fdc228bc7078d2defb877bf66e1 (diff) | |
download | traccar-server-843a370660646499c3007256be953506567f23fb.tar.gz traccar-server-843a370660646499c3007256be953506567f23fb.tar.bz2 traccar-server-843a370660646499c3007256be953506567f23fb.zip |
Add linking and unlinking of devices
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index e249a7591..af2dd559a 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -321,6 +321,14 @@ public class DataManager implements IdentityManager { AsyncServlet.sessionRefreshUser(userId); } + public void unlinkDevice(long userId, long deviceId) throws SQLException { + QueryBuilder.create(dataSource, getQuery("database.unlinkDevice")) + .setLong("userId", userId) + .setLong("deviceId", deviceId) + .executeUpdate(); + AsyncServlet.sessionRefreshUser(userId); + } + public Collection<Position> getPositions(long userId, long deviceId, Date from, Date to) throws SQLException { return QueryBuilder.create(dataSource, getQuery("database.selectPositions")) .setLong("deviceId", deviceId) |