aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabor Somogyi <Gabor_Somogyi@epam.com>2016-05-04 12:49:23 +0200
committerGabor Somogyi <Gabor_Somogyi@epam.com>2016-05-04 12:49:23 +0200
commit1cc86f7df5704aa19d1af643c5fbf852a301858b (patch)
tree28ffae07132f57c2cdd7fd065b2315f4fb7cd7fd /src
parent1a605980b1a120614ccaeb56faac37b05a81a4e9 (diff)
downloadtrackermap-server-1cc86f7df5704aa19d1af643c5fbf852a301858b.tar.gz
trackermap-server-1cc86f7df5704aa19d1af643c5fbf852a301858b.tar.bz2
trackermap-server-1cc86f7df5704aa19d1af643c5fbf852a301858b.zip
SupportedCommand model removed
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/ServerManager.java12
-rw-r--r--src/org/traccar/api/resource/DeviceResource.java5
-rw-r--r--src/org/traccar/api/resource/SupportedCommandResource.java3
-rw-r--r--src/org/traccar/model/SupportedCommand.java39
-rw-r--r--src/org/traccar/web/WebServer.java1
5 files changed, 4 insertions, 56 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 1fc145869..73c21599f 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -15,8 +15,6 @@
*/
package org.traccar;
-import org.traccar.model.SupportedCommand;
-
import java.io.File;
import java.net.URI;
import java.net.URL;
@@ -92,17 +90,13 @@ public class ServerManager {
}
}
- public Collection<SupportedCommand> getProtocolSuppportedCommands(String protocol) {
- ArrayList<SupportedCommand> result = new ArrayList<>();
+ public Collection<String> getProtocolSuppportedCommands(String protocol) {
+ ArrayList<String> result = new ArrayList<>();
if (protocol != null) {
BaseProtocol baseProtocol = protocols.get(protocol);
for (String commandKey : baseProtocol.getSupportedCommands()) {
- SupportedCommand supportedCommand = new SupportedCommand();
- supportedCommand.setKey(commandKey);
- String commandName = "command" + commandKey.substring(0, 1).toUpperCase() + commandKey.substring(1);
- supportedCommand.setName(commandName);
- result.add(supportedCommand);
+ result.add(commandKey);
}
}
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java
index f7494aa6a..5c58d3b32 100644
--- a/src/org/traccar/api/resource/DeviceResource.java
+++ b/src/org/traccar/api/resource/DeviceResource.java
@@ -19,7 +19,6 @@ import org.traccar.Context;
import org.traccar.api.BaseResource;
import java.sql.SQLException;
-import java.util.ArrayList;
import java.util.Collection;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -33,11 +32,7 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.traccar.helper.Log;
-import org.traccar.model.Command;
import org.traccar.model.Device;
-import org.traccar.model.Position;
-import org.traccar.model.SupportedCommand;
@Path("devices")
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/org/traccar/api/resource/SupportedCommandResource.java b/src/org/traccar/api/resource/SupportedCommandResource.java
index bf4fd4969..097acaa4f 100644
--- a/src/org/traccar/api/resource/SupportedCommandResource.java
+++ b/src/org/traccar/api/resource/SupportedCommandResource.java
@@ -18,7 +18,6 @@ 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 javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
@@ -32,7 +31,7 @@ import java.util.Collections;
public class SupportedCommandResource extends BaseResource {
@GET
- public Collection<SupportedCommand> get(@QueryParam("deviceId") long deviceId) throws SQLException {
+ public Collection<String> get(@QueryParam("deviceId") long deviceId) throws SQLException {
Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
Position lastPosition = Context.getConnectionManager().getLastPosition(deviceId);
if (lastPosition != null) {
diff --git a/src/org/traccar/model/SupportedCommand.java b/src/org/traccar/model/SupportedCommand.java
deleted file mode 100644
index a8f31ab30..000000000
--- a/src/org/traccar/model/SupportedCommand.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2016 Gabor Somogyi (gabor.g.somogyi@gmail.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.traccar.model;
-
-public class SupportedCommand {
-
- private String key;
-
- public String getKey() {
- return key;
- }
-
- public void setKey(String key) {
- this.key = key;
- }
-
- private String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 3862d1384..46add3a75 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -43,7 +43,6 @@ import org.traccar.api.ResourceErrorHandler;
import org.traccar.api.SecurityRequestFilter;
import org.traccar.api.resource.*;
import org.traccar.helper.Log;
-import org.traccar.model.SupportedCommand;
public class WebServer {