aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/ServerManager.java12
-rw-r--r--src/org/traccar/api/resource/CommandTypeResource.java (renamed from src/org/traccar/api/resource/SupportedCommandResource.java)10
-rw-r--r--src/org/traccar/model/CommandType.java (renamed from src/org/traccar/model/SupportedCommand.java)2
-rw-r--r--src/org/traccar/web/WebServer.java4
4 files changed, 14 insertions, 14 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 5e59851f7..cf49b3e2c 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -15,7 +15,7 @@
*/
package org.traccar;
-import org.traccar.model.SupportedCommand;
+import org.traccar.model.CommandType;
import java.io.File;
import java.net.URI;
@@ -98,16 +98,16 @@ public class ServerManager {
}
}
- public Collection<SupportedCommand> getProtocolSuppportedCommands(String protocol) {
- List<SupportedCommand> result = new ArrayList<>();
+ public Collection<CommandType> getProtocolCommandTypes(String protocol) {
+ List<CommandType> result = new ArrayList<>();
if (protocol != null) {
BaseProtocol baseProtocol = protocols.get(protocol);
if (baseProtocol != null) {
for (String commandKey : baseProtocol.getSupportedCommands()) {
- SupportedCommand supportedCommand = new SupportedCommand();
- supportedCommand.setKey(commandKey);
- result.add(supportedCommand);
+ CommandType commandType = new CommandType();
+ commandType.setKey(commandKey);
+ result.add(commandType);
}
}
}
diff --git a/src/org/traccar/api/resource/SupportedCommandResource.java b/src/org/traccar/api/resource/CommandTypeResource.java
index 1d5ce8595..9f9ecf249 100644
--- a/src/org/traccar/api/resource/SupportedCommandResource.java
+++ b/src/org/traccar/api/resource/CommandTypeResource.java
@@ -18,7 +18,7 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.model.Position;
-import org.traccar.model.SupportedCommand;
+import org.traccar.model.CommandType;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@@ -30,17 +30,17 @@ import java.sql.SQLException;
import java.util.Collection;
import java.util.Collections;
-@Path("supportedcommands")
+@Path("commandtypes")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
-public class SupportedCommandResource extends BaseResource {
+public class CommandTypeResource extends BaseResource {
@GET
- public Collection<SupportedCommand> get(@QueryParam("deviceId") long deviceId) throws SQLException {
+ 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().getProtocolSuppportedCommands(lastPosition.getProtocol());
+ return Context.getServerManager().getProtocolCommandTypes(lastPosition.getProtocol());
} else {
return Collections.EMPTY_LIST;
}
diff --git a/src/org/traccar/model/SupportedCommand.java b/src/org/traccar/model/CommandType.java
index 59a24d033..057dda4c5 100644
--- a/src/org/traccar/model/SupportedCommand.java
+++ b/src/org/traccar/model/CommandType.java
@@ -15,7 +15,7 @@
*/
package org.traccar.model;
-public class SupportedCommand {
+public class CommandType {
private String key;
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index bcb0442f6..8144af0b6 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -43,7 +43,7 @@ import org.traccar.api.resource.UserResource;
import org.traccar.api.resource.GroupResource;
import org.traccar.api.resource.DeviceResource;
import org.traccar.api.resource.PositionResource;
-import org.traccar.api.resource.SupportedCommandResource;
+import org.traccar.api.resource.CommandTypeResource;
import org.traccar.helper.Log;
import javax.naming.InitialContext;
@@ -148,7 +148,7 @@ public class WebServer {
resourceConfig.register(CorsResponseFilter.class);
resourceConfig.registerClasses(ServerResource.class, SessionResource.class, CommandResource.class,
GroupPermissionResource.class, DevicePermissionResource.class, UserResource.class,
- GroupResource.class, DeviceResource.class, PositionResource.class, SupportedCommandResource.class);
+ GroupResource.class, DeviceResource.class, PositionResource.class, CommandTypeResource.class);
servletHandler.addServlet(new ServletHolder(new ServletContainer(resourceConfig)), "/*");
handlers.addHandler(servletHandler);