diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-01 15:20:05 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-01 15:20:05 +1300 |
commit | ef2ae4103726dae12a0153886219d4ac43d20ae0 (patch) | |
tree | 79291f74ce2631a4a9a176b7e510028e534a23d4 /src/org/traccar/database/DataManager.java | |
parent | c6692703c8099577cb86c3eace5d8d1bc11f212d (diff) | |
parent | 53f70085891cdb0feae56df8990c1245091352a1 (diff) | |
download | trackermap-server-ef2ae4103726dae12a0153886219d4ac43d20ae0.tar.gz trackermap-server-ef2ae4103726dae12a0153886219d4ac43d20ae0.tar.bz2 trackermap-server-ef2ae4103726dae12a0153886219d4ac43d20ae0.zip |
Merge branch 'rest' into master
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index da87c6c27..978f08ef3 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -277,12 +277,19 @@ public class DataManager implements IdentityManager { } } + @Deprecated public void removeUser(User user) throws SQLException { QueryBuilder.create(dataSource, getQuery("database.deleteUser")) .setObject(user) .executeUpdate(); } + public void removeUser(long userId) throws SQLException { + QueryBuilder.create(dataSource, getQuery("database.deleteUser")) + .setLong("id", userId) + .executeUpdate(); + } + public Collection<Permission> getPermissions() throws SQLException { return QueryBuilder.create(dataSource, getQuery("database.getPermissionsAll")) .executeQuery(new Permission()); @@ -317,6 +324,7 @@ public class DataManager implements IdentityManager { .executeUpdate(); } + @Deprecated public void removeDevice(Device device) throws SQLException { QueryBuilder.create(dataSource, getQuery("database.deleteDevice")) .setObject(device) @@ -324,6 +332,13 @@ public class DataManager implements IdentityManager { AsyncServlet.sessionRefreshDevice(device.getId()); } + public void removeDevice(long deviceId) throws SQLException { + QueryBuilder.create(dataSource, getQuery("database.deleteDevice")) + .setLong("id", deviceId) + .executeUpdate(); + AsyncServlet.sessionRefreshDevice(deviceId); + } + public void linkDevice(long userId, long deviceId) throws SQLException { QueryBuilder.create(dataSource, getQuery("database.linkDevice")) .setLong("userId", userId) |