aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java15
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)