aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/http
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-30 09:41:41 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-30 09:41:41 +1200
commit54c54703d66e8991472c1f7476ba4acb424b27d9 (patch)
treeb43f2f0225b7722a1543a973a568ee2854e7b413 /src/org/traccar/http
parentc646926a7fb0e66407c1ed7aa18daa1c9fc41cd8 (diff)
downloadtrackermap-server-54c54703d66e8991472c1f7476ba4acb424b27d9.tar.gz
trackermap-server-54c54703d66e8991472c1f7476ba4acb424b27d9.tar.bz2
trackermap-server-54c54703d66e8991472c1f7476ba4acb424b27d9.zip
Move commands related classes
Diffstat (limited to 'src/org/traccar/http')
-rw-r--r--src/org/traccar/http/CommandsServlet.java4
-rw-r--r--src/org/traccar/http/commands/CommandType.java28
-rw-r--r--src/org/traccar/http/commands/Duration.java38
-rw-r--r--src/org/traccar/http/commands/FixPositioningCommand.java25
-rw-r--r--src/org/traccar/http/commands/GpsCommand.java27
-rw-r--r--src/org/traccar/http/commands/NoParameterCommand.java11
6 files changed, 2 insertions, 131 deletions
diff --git a/src/org/traccar/http/CommandsServlet.java b/src/org/traccar/http/CommandsServlet.java
index 3e3ab9086..f68a7a74e 100644
--- a/src/org/traccar/http/CommandsServlet.java
+++ b/src/org/traccar/http/CommandsServlet.java
@@ -2,8 +2,8 @@ package org.traccar.http;
import org.traccar.Context;
import org.traccar.database.ActiveDevice;
-import org.traccar.http.commands.CommandType;
-import org.traccar.http.commands.GpsCommand;
+import org.traccar.command.CommandType;
+import org.traccar.command.GpsCommand;
import javax.json.Json;
import javax.json.JsonObject;
diff --git a/src/org/traccar/http/commands/CommandType.java b/src/org/traccar/http/commands/CommandType.java
deleted file mode 100644
index 12610dbcc..000000000
--- a/src/org/traccar/http/commands/CommandType.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.traccar.http.commands;
-
-import org.traccar.model.Factory;
-
-public enum CommandType implements Factory {
- STOP_POSITIONING(NoParameterCommand.class),
- FIX_POSITIONING(FixPositioningCommand.class),
- STOP_ENGINE(NoParameterCommand.class),
- RESUME_ENGINE(NoParameterCommand.class);
-
-
- private Class<? extends GpsCommand> commandClass;
-
- CommandType(Class<? extends GpsCommand> commandClass) {
- this.commandClass = commandClass;
- }
-
- @Override
- public Object create() {
- try {
- return commandClass.newInstance();
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/src/org/traccar/http/commands/Duration.java b/src/org/traccar/http/commands/Duration.java
deleted file mode 100644
index e50f0c23e..000000000
--- a/src/org/traccar/http/commands/Duration.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.traccar.http.commands;
-
-public class Duration {
-
- public enum TimeUnit {
- SECOND("s"), MINUTE("m"), HOUR("h");
-
- private final String commandFormat;
-
- TimeUnit(String commandFormat) {
- this.commandFormat = commandFormat;
- }
-
- public String getCommandFormat() {
- return commandFormat;
- }
- }
-
-
- private TimeUnit unit;
- private int value;
-
- public TimeUnit getUnit() {
- return unit;
- }
-
- public void setUnit(TimeUnit unit) {
- this.unit = unit;
- }
-
- public int getValue() {
- return value;
- }
-
- public void setValue(int value) {
- this.value = value;
- }
-}
diff --git a/src/org/traccar/http/commands/FixPositioningCommand.java b/src/org/traccar/http/commands/FixPositioningCommand.java
deleted file mode 100644
index f3b25acbc..000000000
--- a/src/org/traccar/http/commands/FixPositioningCommand.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.traccar.http.commands;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class FixPositioningCommand extends GpsCommand {
- public static final String FREQUENCY = "frequency";
-
- private Duration data;
-
- @Override
- public Map<String, Object> getReplacements() {
- Map<String, Object> replacements = new HashMap<String, Object>();
- replacements.put(FREQUENCY, data);
- return replacements;
- }
-
- public Duration getData() {
- return data;
- }
-
- public void setData(Duration data) {
- this.data = data;
- }
-}
diff --git a/src/org/traccar/http/commands/GpsCommand.java b/src/org/traccar/http/commands/GpsCommand.java
deleted file mode 100644
index 604bf832f..000000000
--- a/src/org/traccar/http/commands/GpsCommand.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.traccar.http.commands;
-
-import java.util.Map;
-
-public abstract class GpsCommand {
- public static final String UNIQUE_ID = "uniqueId";
- private String uniqueId;
- private CommandType type;
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public CommandType getType() {
- return type;
- }
-
- public void setType(CommandType type) {
- this.type = type;
- }
-
- public abstract Map<String, Object> getReplacements();
-}
diff --git a/src/org/traccar/http/commands/NoParameterCommand.java b/src/org/traccar/http/commands/NoParameterCommand.java
deleted file mode 100644
index fee3c8097..000000000
--- a/src/org/traccar/http/commands/NoParameterCommand.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.traccar.http.commands;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class NoParameterCommand extends GpsCommand {
- @Override
- public Map<String, Object> getReplacements() {
- return new HashMap<String, Object>();
- }
-}