aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
authorGábor Somogyi <gabor.g.somogyi@gmail.com>2016-05-08 13:06:25 +0200
committerGábor Somogyi <gabor.g.somogyi@gmail.com>2016-05-08 13:29:18 +0200
commit301f2d314f446410da78615ac76ce0c07571d445 (patch)
tree71c96669b970bb8315388cc01db21e00b743796d /src/org/traccar/api
parent37bc675580c640d4fa7968fee575544fb3a550e3 (diff)
downloadtraccar-server-301f2d314f446410da78615ac76ce0c07571d445.tar.gz
traccar-server-301f2d314f446410da78615ac76ce0c07571d445.tar.bz2
traccar-server-301f2d314f446410da78615ac76ce0c07571d445.zip
Review fixes
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/resource/CommandTypeResource.java9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/org/traccar/api/resource/CommandTypeResource.java b/src/org/traccar/api/resource/CommandTypeResource.java
index 9f9ecf249..ce27f5241 100644
--- a/src/org/traccar/api/resource/CommandTypeResource.java
+++ b/src/org/traccar/api/resource/CommandTypeResource.java
@@ -17,7 +17,6 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
-import org.traccar.model.Position;
import org.traccar.model.CommandType;
import javax.ws.rs.Consumes;
@@ -28,7 +27,6 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.sql.SQLException;
import java.util.Collection;
-import java.util.Collections;
@Path("commandtypes")
@Produces(MediaType.APPLICATION_JSON)
@@ -38,12 +36,7 @@ public class CommandTypeResource extends BaseResource {
@GET
public Collection<CommandType> get(@QueryParam("deviceId") long deviceId) throws SQLException {
Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
- Position lastPosition = Context.getConnectionManager().getLastPosition(deviceId);
- if (lastPosition != null) {
- return Context.getServerManager().getProtocolCommandTypes(lastPosition.getProtocol());
- } else {
- return Collections.EMPTY_LIST;
- }
+ return Context.getConnectionManager().getActiveDevice(deviceId).getCommandTypes();
}
}