aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-20 10:45:52 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-20 10:45:52 +0500
commit32a7fe7eb22d435906b65f91c37751ece4fea828 (patch)
tree988ea8c712656e913672fb85de992f353c51c16b /src/org/traccar/api/resource
parent8e4d44e045c6e0c800b3b353f6f55c64d731428c (diff)
downloadtrackermap-server-32a7fe7eb22d435906b65f91c37751ece4fea828.tar.gz
trackermap-server-32a7fe7eb22d435906b65f91c37751ece4fea828.tar.bz2
trackermap-server-32a7fe7eb22d435906b65f91c37751ece4fea828.zip
- Move groups related actions to DeviceManager
- Removed cache updates from getXxxxById
Diffstat (limited to 'src/org/traccar/api/resource')
-rw-r--r--src/org/traccar/api/resource/GroupResource.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/api/resource/GroupResource.java b/src/org/traccar/api/resource/GroupResource.java
index 957f39ebe..eec28e325 100644
--- a/src/org/traccar/api/resource/GroupResource.java
+++ b/src/org/traccar/api/resource/GroupResource.java
@@ -43,20 +43,20 @@ public class GroupResource extends BaseResource {
@QueryParam("all") boolean all, @QueryParam("userId") long userId) throws SQLException {
if (all) {
Context.getPermissionsManager().checkAdmin(getUserId());
- return Context.getDataManager().getAllGroups();
+ return Context.getDeviceManager().getAllGroups();
} else {
if (userId == 0) {
userId = getUserId();
}
Context.getPermissionsManager().checkUser(getUserId(), userId);
- return Context.getDataManager().getGroups(userId);
+ return Context.getDeviceManager().getGroups(userId);
}
}
@POST
public Response add(Group entity) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
- Context.getDataManager().addGroup(entity);
+ Context.getDeviceManager().addGroup(entity);
Context.getDataManager().linkGroup(getUserId(), entity.getId());
Context.getPermissionsManager().refresh();
if (Context.getGeofenceManager() != null) {
@@ -70,7 +70,7 @@ public class GroupResource extends BaseResource {
public Response update(@PathParam("id") long id, Group entity) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getPermissionsManager().checkGroup(getUserId(), id);
- Context.getDataManager().updateGroup(entity);
+ Context.getDeviceManager().updateGroup(entity);
if (Context.getGeofenceManager() != null) {
Context.getGeofenceManager().refresh();
}
@@ -82,7 +82,7 @@ public class GroupResource extends BaseResource {
public Response remove(@PathParam("id") long id) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getPermissionsManager().checkGroup(getUserId(), id);
- Context.getDataManager().removeGroup(id);
+ Context.getDeviceManager().removeGroup(id);
Context.getPermissionsManager().refresh();
if (Context.getGeofenceManager() != null) {
Context.getGeofenceManager().refresh();