From 54c54703d66e8991472c1f7476ba4acb424b27d9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 30 Jun 2015 09:41:41 +1200 Subject: Move commands related classes --- src/org/traccar/BaseProtocol.java | 6 +-- src/org/traccar/Protocol.java | 2 +- src/org/traccar/command/CommandTemplate.java | 8 ++++ src/org/traccar/command/CommandType.java | 28 +++++++++++ .../traccar/command/CommandValueConversion.java | 5 ++ src/org/traccar/command/Duration.java | 38 +++++++++++++++ src/org/traccar/command/FixPositioningCommand.java | 25 ++++++++++ src/org/traccar/command/GpsCommand.java | 27 +++++++++++ src/org/traccar/command/NoParameterCommand.java | 11 +++++ src/org/traccar/command/StringCommandTemplate.java | 54 +++++++++++++++++++++ src/org/traccar/database/ActiveDevice.java | 2 +- src/org/traccar/http/CommandsServlet.java | 4 +- src/org/traccar/http/commands/CommandType.java | 28 ----------- src/org/traccar/http/commands/Duration.java | 38 --------------- .../http/commands/FixPositioningCommand.java | 25 ---------- src/org/traccar/http/commands/GpsCommand.java | 27 ----------- .../traccar/http/commands/NoParameterCommand.java | 11 ----- src/org/traccar/protocol/ApelProtocol.java | 3 -- src/org/traccar/protocol/AplicomProtocol.java | 3 -- src/org/traccar/protocol/Ardi01Protocol.java | 3 -- src/org/traccar/protocol/AtrackProtocol.java | 3 -- src/org/traccar/protocol/AutoFon45Protocol.java | 3 -- src/org/traccar/protocol/AutoFonProtocol.java | 3 -- src/org/traccar/protocol/Avl301Protocol.java | 3 -- src/org/traccar/protocol/BceProtocol.java | 3 -- src/org/traccar/protocol/BoxProtocol.java | 3 -- src/org/traccar/protocol/CalAmpProtocol.java | 3 -- src/org/traccar/protocol/CarTrackProtocol.java | 3 -- src/org/traccar/protocol/CarscopProtocol.java | 3 -- src/org/traccar/protocol/CastelProtocol.java | 3 -- src/org/traccar/protocol/CellocatorProtocol.java | 3 -- src/org/traccar/protocol/EasyTrackProtocol.java | 3 -- src/org/traccar/protocol/EelinkProtocol.java | 3 -- src/org/traccar/protocol/EnforaProtocol.java | 3 -- src/org/traccar/protocol/Ev603Protocol.java | 3 -- src/org/traccar/protocol/FreedomProtocol.java | 3 -- src/org/traccar/protocol/GalileoProtocol.java | 3 -- src/org/traccar/protocol/GatorProtocol.java | 3 -- src/org/traccar/protocol/Gl100Protocol.java | 3 -- src/org/traccar/protocol/Gl200Protocol.java | 3 -- src/org/traccar/protocol/GlobalSatProtocol.java | 3 -- src/org/traccar/protocol/GoSafeProtocol.java | 3 -- src/org/traccar/protocol/GotopProtocol.java | 3 -- src/org/traccar/protocol/Gps103Protocol.java | 14 +++--- src/org/traccar/protocol/GpsGateProtocol.java | 3 -- src/org/traccar/protocol/Gt02Protocol.java | 3 -- src/org/traccar/protocol/Gt06Protocol.java | 6 +-- src/org/traccar/protocol/H02Protocol.java | 3 -- src/org/traccar/protocol/HaicomProtocol.java | 3 -- src/org/traccar/protocol/IntellitracProtocol.java | 3 -- src/org/traccar/protocol/Jt600Protocol.java | 3 -- src/org/traccar/protocol/KhdProtocol.java | 3 -- src/org/traccar/protocol/LaipacProtocol.java | 3 -- src/org/traccar/protocol/M2mProtocol.java | 3 -- src/org/traccar/protocol/ManPowerProtocol.java | 3 -- src/org/traccar/protocol/MaxonProtocol.java | 3 -- src/org/traccar/protocol/MegastekProtocol.java | 3 -- src/org/traccar/protocol/MeiligaoProtocol.java | 3 -- src/org/traccar/protocol/MeitrackProtocol.java | 3 -- src/org/traccar/protocol/MiniFinderProtocol.java | 3 -- src/org/traccar/protocol/Mta6Protocol.java | 3 -- src/org/traccar/protocol/MtxProtocol.java | 3 -- src/org/traccar/protocol/MxtProtocol.java | 3 -- src/org/traccar/protocol/NavigilProtocol.java | 3 -- src/org/traccar/protocol/NavisProtocol.java | 3 -- src/org/traccar/protocol/NoranProtocol.java | 3 -- src/org/traccar/protocol/OrionProtocol.java | 3 -- src/org/traccar/protocol/OsmAndProtocol.java | 3 -- src/org/traccar/protocol/PiligrimProtocol.java | 3 -- src/org/traccar/protocol/ProgressProtocol.java | 3 -- src/org/traccar/protocol/Pt3000Protocol.java | 3 -- src/org/traccar/protocol/Pt502Protocol.java | 3 -- src/org/traccar/protocol/RitiProtocol.java | 3 -- src/org/traccar/protocol/RuptelaProtocol.java | 3 -- src/org/traccar/protocol/SanavProtocol.java | 3 -- src/org/traccar/protocol/SkypatrolProtocol.java | 3 -- src/org/traccar/protocol/Stl060Protocol.java | 3 -- src/org/traccar/protocol/SuntechProtocol.java | 3 -- src/org/traccar/protocol/T55Protocol.java | 3 -- src/org/traccar/protocol/TelikProtocol.java | 3 -- src/org/traccar/protocol/TeltonikaProtocol.java | 3 -- src/org/traccar/protocol/Tk102Protocol.java | 3 -- src/org/traccar/protocol/Tk103Protocol.java | 3 -- src/org/traccar/protocol/Tlt2hProtocol.java | 3 -- src/org/traccar/protocol/TopflytechProtocol.java | 3 -- src/org/traccar/protocol/TotemProtocol.java | 3 -- src/org/traccar/protocol/Tr20Protocol.java | 3 -- src/org/traccar/protocol/Tr900Protocol.java | 4 -- src/org/traccar/protocol/TrackboxProtocol.java | 3 -- src/org/traccar/protocol/TramigoProtocol.java | 3 -- src/org/traccar/protocol/TytanProtocol.java | 3 -- src/org/traccar/protocol/UlbotechProtocol.java | 3 -- src/org/traccar/protocol/V680Protocol.java | 3 -- src/org/traccar/protocol/VisiontekProtocol.java | 3 -- src/org/traccar/protocol/WialonProtocol.java | 3 -- src/org/traccar/protocol/WondexProtocol.java | 3 -- src/org/traccar/protocol/XirgoProtocol.java | 3 -- src/org/traccar/protocol/Xt013Protocol.java | 3 -- src/org/traccar/protocol/Xt7Protocol.java | 3 -- src/org/traccar/protocol/YwtProtocol.java | 3 -- .../traccar/protocol/commands/CommandTemplate.java | 8 ---- .../protocol/commands/CommandValueConversion.java | 5 -- .../protocol/commands/StringCommandTemplate.java | 56 ---------------------- 103 files changed, 213 insertions(+), 459 deletions(-) create mode 100644 src/org/traccar/command/CommandTemplate.java create mode 100644 src/org/traccar/command/CommandType.java create mode 100644 src/org/traccar/command/CommandValueConversion.java create mode 100644 src/org/traccar/command/Duration.java create mode 100644 src/org/traccar/command/FixPositioningCommand.java create mode 100644 src/org/traccar/command/GpsCommand.java create mode 100644 src/org/traccar/command/NoParameterCommand.java create mode 100644 src/org/traccar/command/StringCommandTemplate.java delete mode 100644 src/org/traccar/http/commands/CommandType.java delete mode 100644 src/org/traccar/http/commands/Duration.java delete mode 100644 src/org/traccar/http/commands/FixPositioningCommand.java delete mode 100644 src/org/traccar/http/commands/GpsCommand.java delete mode 100644 src/org/traccar/http/commands/NoParameterCommand.java delete mode 100644 src/org/traccar/protocol/commands/CommandTemplate.java delete mode 100644 src/org/traccar/protocol/commands/CommandValueConversion.java delete mode 100644 src/org/traccar/protocol/commands/StringCommandTemplate.java diff --git a/src/org/traccar/BaseProtocol.java b/src/org/traccar/BaseProtocol.java index 94dd46ac4..b345d3658 100644 --- a/src/org/traccar/BaseProtocol.java +++ b/src/org/traccar/BaseProtocol.java @@ -16,9 +16,9 @@ package org.traccar; import org.traccar.database.ActiveDevice; -import org.traccar.http.commands.CommandType; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.GpsCommand; +import org.traccar.command.CommandType; +import org.traccar.command.CommandTemplate; +import org.traccar.command.GpsCommand; import java.util.HashMap; import java.util.Map; diff --git a/src/org/traccar/Protocol.java b/src/org/traccar/Protocol.java index e283deb86..08d75a0ea 100644 --- a/src/org/traccar/Protocol.java +++ b/src/org/traccar/Protocol.java @@ -1,7 +1,7 @@ package org.traccar; import org.traccar.database.ActiveDevice; -import org.traccar.http.commands.GpsCommand; +import org.traccar.command.GpsCommand; import java.util.List; diff --git a/src/org/traccar/command/CommandTemplate.java b/src/org/traccar/command/CommandTemplate.java new file mode 100644 index 000000000..cdc9be7ab --- /dev/null +++ b/src/org/traccar/command/CommandTemplate.java @@ -0,0 +1,8 @@ +package org.traccar.command; + +import org.traccar.database.ActiveDevice; +import org.traccar.command.GpsCommand; + +public interface CommandTemplate { + Object applyTo(ActiveDevice activeDevice, T command); +} diff --git a/src/org/traccar/command/CommandType.java b/src/org/traccar/command/CommandType.java new file mode 100644 index 000000000..b5f6393b6 --- /dev/null +++ b/src/org/traccar/command/CommandType.java @@ -0,0 +1,28 @@ +package org.traccar.command; + +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 commandClass; + + CommandType(Class 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/command/CommandValueConversion.java b/src/org/traccar/command/CommandValueConversion.java new file mode 100644 index 000000000..5c8b75313 --- /dev/null +++ b/src/org/traccar/command/CommandValueConversion.java @@ -0,0 +1,5 @@ +package org.traccar.command; + +public interface CommandValueConversion { + public String convert(T value); +} diff --git a/src/org/traccar/command/Duration.java b/src/org/traccar/command/Duration.java new file mode 100644 index 000000000..a2ed2c991 --- /dev/null +++ b/src/org/traccar/command/Duration.java @@ -0,0 +1,38 @@ +package org.traccar.command; + +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/command/FixPositioningCommand.java b/src/org/traccar/command/FixPositioningCommand.java new file mode 100644 index 000000000..1304e1f3f --- /dev/null +++ b/src/org/traccar/command/FixPositioningCommand.java @@ -0,0 +1,25 @@ +package org.traccar.command; + +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 getReplacements() { + Map replacements = new HashMap(); + 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/command/GpsCommand.java b/src/org/traccar/command/GpsCommand.java new file mode 100644 index 000000000..7097c4807 --- /dev/null +++ b/src/org/traccar/command/GpsCommand.java @@ -0,0 +1,27 @@ +package org.traccar.command; + +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 getReplacements(); +} diff --git a/src/org/traccar/command/NoParameterCommand.java b/src/org/traccar/command/NoParameterCommand.java new file mode 100644 index 000000000..afb0f3aee --- /dev/null +++ b/src/org/traccar/command/NoParameterCommand.java @@ -0,0 +1,11 @@ +package org.traccar.command; + +import java.util.HashMap; +import java.util.Map; + +public class NoParameterCommand extends GpsCommand { + @Override + public Map getReplacements() { + return new HashMap(); + } +} diff --git a/src/org/traccar/command/StringCommandTemplate.java b/src/org/traccar/command/StringCommandTemplate.java new file mode 100644 index 000000000..12470d441 --- /dev/null +++ b/src/org/traccar/command/StringCommandTemplate.java @@ -0,0 +1,54 @@ +package org.traccar.command; + +import org.traccar.database.ActiveDevice; + +import java.util.HashMap; +import java.util.Map; + +public class StringCommandTemplate implements CommandTemplate { + + private String messageTemplate; + private Map, CommandValueConversion> converters = new HashMap, CommandValueConversion>(); + + public StringCommandTemplate(String template, Object... replacements) { + this.messageTemplate = String.format(template, replacements); + } + + @Override + public Object applyTo(ActiveDevice activeDevice, T command) { + String currentMessage = messageTemplate; + currentMessage = this.replace(currentMessage, GpsCommand.UNIQUE_ID, activeDevice.getUniqueId()); + + Map replacements = command.getReplacements(); + + for (Map.Entry entry : replacements.entrySet()) { + currentMessage = this.replace(currentMessage, entry.getKey(), entry.getValue()); + } + + return currentMessage; + } + + public CommandTemplate addConverter(Class type, CommandValueConversion converter) { + converters.put(type, converter); + return this; + } + + protected CommandValueConversion getConverter(Class type) { + return converters.containsKey(type) ? converters.get(type) : idConverter(); + } + + private CommandValueConversion idConverter() { + return new CommandValueConversion() { + @Override + public String convert(Object value) { + return value.toString(); + } + }; + } + + private String replace(String currentMessage, String key, Object value) { + String replacementValue = getConverter(value.getClass()).convert(value); + return currentMessage.replace("[" + key + "]", replacementValue); + } + +} diff --git a/src/org/traccar/database/ActiveDevice.java b/src/org/traccar/database/ActiveDevice.java index 29f2b47d2..58c5d210d 100644 --- a/src/org/traccar/database/ActiveDevice.java +++ b/src/org/traccar/database/ActiveDevice.java @@ -2,7 +2,7 @@ package org.traccar.database; import org.jboss.netty.channel.Channel; import org.traccar.Protocol; -import org.traccar.http.commands.GpsCommand; +import org.traccar.command.GpsCommand; import java.net.SocketAddress; 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 commandClass; - - CommandType(Class 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 getReplacements() { - Map replacements = new HashMap(); - 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 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 getReplacements() { - return new HashMap(); - } -} diff --git a/src/org/traccar/protocol/ApelProtocol.java b/src/org/traccar/protocol/ApelProtocol.java index 0911b6dfd..ae1af1243 100644 --- a/src/org/traccar/protocol/ApelProtocol.java +++ b/src/org/traccar/protocol/ApelProtocol.java @@ -20,12 +20,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class ApelProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/AplicomProtocol.java b/src/org/traccar/protocol/AplicomProtocol.java index 89d562ccc..8aae9554a 100644 --- a/src/org/traccar/protocol/AplicomProtocol.java +++ b/src/org/traccar/protocol/AplicomProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class AplicomProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Ardi01Protocol.java b/src/org/traccar/protocol/Ardi01Protocol.java index 52d380850..3bbb489f9 100644 --- a/src/org/traccar/protocol/Ardi01Protocol.java +++ b/src/org/traccar/protocol/Ardi01Protocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Ardi01Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/AtrackProtocol.java b/src/org/traccar/protocol/AtrackProtocol.java index 9e2850735..356f7fc28 100644 --- a/src/org/traccar/protocol/AtrackProtocol.java +++ b/src/org/traccar/protocol/AtrackProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class AtrackProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/AutoFon45Protocol.java b/src/org/traccar/protocol/AutoFon45Protocol.java index 674d3d190..cceb3e476 100644 --- a/src/org/traccar/protocol/AutoFon45Protocol.java +++ b/src/org/traccar/protocol/AutoFon45Protocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class AutoFon45Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/AutoFonProtocol.java b/src/org/traccar/protocol/AutoFonProtocol.java index 38bb77695..dc2830edb 100644 --- a/src/org/traccar/protocol/AutoFonProtocol.java +++ b/src/org/traccar/protocol/AutoFonProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class AutoFonProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Avl301Protocol.java b/src/org/traccar/protocol/Avl301Protocol.java index 4d953f7bb..10ec5ae22 100644 --- a/src/org/traccar/protocol/Avl301Protocol.java +++ b/src/org/traccar/protocol/Avl301Protocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Avl301Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/BceProtocol.java b/src/org/traccar/protocol/BceProtocol.java index e339c0316..06154c1c7 100644 --- a/src/org/traccar/protocol/BceProtocol.java +++ b/src/org/traccar/protocol/BceProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class BceProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/BoxProtocol.java b/src/org/traccar/protocol/BoxProtocol.java index c7f8625d1..7e5f83ebe 100644 --- a/src/org/traccar/protocol/BoxProtocol.java +++ b/src/org/traccar/protocol/BoxProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class BoxProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/CalAmpProtocol.java b/src/org/traccar/protocol/CalAmpProtocol.java index 63d46defd..ccfd47cc4 100644 --- a/src/org/traccar/protocol/CalAmpProtocol.java +++ b/src/org/traccar/protocol/CalAmpProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class CalAmpProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/CarTrackProtocol.java b/src/org/traccar/protocol/CarTrackProtocol.java index c0ecd8e04..e202ab65a 100644 --- a/src/org/traccar/protocol/CarTrackProtocol.java +++ b/src/org/traccar/protocol/CarTrackProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class CarTrackProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/CarscopProtocol.java b/src/org/traccar/protocol/CarscopProtocol.java index 34f761cfe..1ac3e5e9f 100644 --- a/src/org/traccar/protocol/CarscopProtocol.java +++ b/src/org/traccar/protocol/CarscopProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class CarscopProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/CastelProtocol.java b/src/org/traccar/protocol/CastelProtocol.java index 08e2c9785..604ff4ecb 100644 --- a/src/org/traccar/protocol/CastelProtocol.java +++ b/src/org/traccar/protocol/CastelProtocol.java @@ -21,12 +21,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class CastelProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/CellocatorProtocol.java b/src/org/traccar/protocol/CellocatorProtocol.java index 417985db8..22564d44f 100644 --- a/src/org/traccar/protocol/CellocatorProtocol.java +++ b/src/org/traccar/protocol/CellocatorProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class CellocatorProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/EasyTrackProtocol.java b/src/org/traccar/protocol/EasyTrackProtocol.java index c5172c880..5a0a65ca2 100644 --- a/src/org/traccar/protocol/EasyTrackProtocol.java +++ b/src/org/traccar/protocol/EasyTrackProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class EasyTrackProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/EelinkProtocol.java b/src/org/traccar/protocol/EelinkProtocol.java index 705c188a2..9579954f8 100644 --- a/src/org/traccar/protocol/EelinkProtocol.java +++ b/src/org/traccar/protocol/EelinkProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class EelinkProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/EnforaProtocol.java b/src/org/traccar/protocol/EnforaProtocol.java index 5ca724fb3..3d8c11fcf 100644 --- a/src/org/traccar/protocol/EnforaProtocol.java +++ b/src/org/traccar/protocol/EnforaProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class EnforaProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Ev603Protocol.java b/src/org/traccar/protocol/Ev603Protocol.java index 75f910e46..8e00b534f 100644 --- a/src/org/traccar/protocol/Ev603Protocol.java +++ b/src/org/traccar/protocol/Ev603Protocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Ev603Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/FreedomProtocol.java b/src/org/traccar/protocol/FreedomProtocol.java index 66cf73a16..22d7792bc 100644 --- a/src/org/traccar/protocol/FreedomProtocol.java +++ b/src/org/traccar/protocol/FreedomProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class FreedomProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/GalileoProtocol.java b/src/org/traccar/protocol/GalileoProtocol.java index 02563950c..762bf0075 100644 --- a/src/org/traccar/protocol/GalileoProtocol.java +++ b/src/org/traccar/protocol/GalileoProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class GalileoProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/GatorProtocol.java b/src/org/traccar/protocol/GatorProtocol.java index 014dbf683..e2626b5ab 100644 --- a/src/org/traccar/protocol/GatorProtocol.java +++ b/src/org/traccar/protocol/GatorProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class GatorProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Gl100Protocol.java b/src/org/traccar/protocol/Gl100Protocol.java index 66e87e58b..9867c653a 100644 --- a/src/org/traccar/protocol/Gl100Protocol.java +++ b/src/org/traccar/protocol/Gl100Protocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Gl100Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Gl200Protocol.java b/src/org/traccar/protocol/Gl200Protocol.java index a2870db47..f007001c0 100644 --- a/src/org/traccar/protocol/Gl200Protocol.java +++ b/src/org/traccar/protocol/Gl200Protocol.java @@ -23,11 +23,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Gl200Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/GlobalSatProtocol.java b/src/org/traccar/protocol/GlobalSatProtocol.java index f6db634e7..10db8e313 100644 --- a/src/org/traccar/protocol/GlobalSatProtocol.java +++ b/src/org/traccar/protocol/GlobalSatProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class GlobalSatProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/GoSafeProtocol.java b/src/org/traccar/protocol/GoSafeProtocol.java index 0837f0762..d49e3133f 100644 --- a/src/org/traccar/protocol/GoSafeProtocol.java +++ b/src/org/traccar/protocol/GoSafeProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class GoSafeProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/GotopProtocol.java b/src/org/traccar/protocol/GotopProtocol.java index f5fa512b1..5cec8f73c 100644 --- a/src/org/traccar/protocol/GotopProtocol.java +++ b/src/org/traccar/protocol/GotopProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class GotopProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Gps103Protocol.java b/src/org/traccar/protocol/Gps103Protocol.java index e47b76f4b..84275a556 100644 --- a/src/org/traccar/protocol/Gps103Protocol.java +++ b/src/org/traccar/protocol/Gps103Protocol.java @@ -23,13 +23,13 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.http.commands.CommandType; -import org.traccar.http.commands.Duration; -import org.traccar.http.commands.FixPositioningCommand; -import org.traccar.http.commands.GpsCommand; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.protocol.commands.CommandValueConversion; -import org.traccar.protocol.commands.StringCommandTemplate; +import org.traccar.command.CommandType; +import org.traccar.command.Duration; +import org.traccar.command.FixPositioningCommand; +import org.traccar.command.GpsCommand; +import org.traccar.command.CommandTemplate; +import org.traccar.command.CommandValueConversion; +import org.traccar.command.StringCommandTemplate; import java.util.List; import java.util.Map; diff --git a/src/org/traccar/protocol/GpsGateProtocol.java b/src/org/traccar/protocol/GpsGateProtocol.java index 38e7bd777..9f07550e4 100644 --- a/src/org/traccar/protocol/GpsGateProtocol.java +++ b/src/org/traccar/protocol/GpsGateProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class GpsGateProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Gt02Protocol.java b/src/org/traccar/protocol/Gt02Protocol.java index 03f0856b4..e03727b4d 100644 --- a/src/org/traccar/protocol/Gt02Protocol.java +++ b/src/org/traccar/protocol/Gt02Protocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Gt02Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Gt06Protocol.java b/src/org/traccar/protocol/Gt06Protocol.java index 38c461b52..d4bd48288 100644 --- a/src/org/traccar/protocol/Gt06Protocol.java +++ b/src/org/traccar/protocol/Gt06Protocol.java @@ -23,9 +23,9 @@ import org.traccar.BaseProtocol; import org.traccar.TrackerServer; import org.traccar.database.ActiveDevice; import org.traccar.helper.Crc; -import org.traccar.http.commands.CommandType; -import org.traccar.http.commands.NoParameterCommand; -import org.traccar.protocol.commands.CommandTemplate; +import org.traccar.command.CommandType; +import org.traccar.command.NoParameterCommand; +import org.traccar.command.CommandTemplate; import java.util.List; import java.util.Map; diff --git a/src/org/traccar/protocol/H02Protocol.java b/src/org/traccar/protocol/H02Protocol.java index 730f27f0d..739b8a562 100644 --- a/src/org/traccar/protocol/H02Protocol.java +++ b/src/org/traccar/protocol/H02Protocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class H02Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/HaicomProtocol.java b/src/org/traccar/protocol/HaicomProtocol.java index 5e5968a7b..de9e3ebb1 100644 --- a/src/org/traccar/protocol/HaicomProtocol.java +++ b/src/org/traccar/protocol/HaicomProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class HaicomProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/IntellitracProtocol.java b/src/org/traccar/protocol/IntellitracProtocol.java index d50bca75c..c06585547 100644 --- a/src/org/traccar/protocol/IntellitracProtocol.java +++ b/src/org/traccar/protocol/IntellitracProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class IntellitracProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Jt600Protocol.java b/src/org/traccar/protocol/Jt600Protocol.java index 63d0f5385..3207986bf 100644 --- a/src/org/traccar/protocol/Jt600Protocol.java +++ b/src/org/traccar/protocol/Jt600Protocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Jt600Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/KhdProtocol.java b/src/org/traccar/protocol/KhdProtocol.java index f4e32bfab..be89df580 100644 --- a/src/org/traccar/protocol/KhdProtocol.java +++ b/src/org/traccar/protocol/KhdProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class KhdProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/LaipacProtocol.java b/src/org/traccar/protocol/LaipacProtocol.java index 65f47980c..fff7b1c32 100644 --- a/src/org/traccar/protocol/LaipacProtocol.java +++ b/src/org/traccar/protocol/LaipacProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class LaipacProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/M2mProtocol.java b/src/org/traccar/protocol/M2mProtocol.java index 49cfa3668..1fac9118c 100644 --- a/src/org/traccar/protocol/M2mProtocol.java +++ b/src/org/traccar/protocol/M2mProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class M2mProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/ManPowerProtocol.java b/src/org/traccar/protocol/ManPowerProtocol.java index 5e988ed34..4fc194963 100644 --- a/src/org/traccar/protocol/ManPowerProtocol.java +++ b/src/org/traccar/protocol/ManPowerProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class ManPowerProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MaxonProtocol.java b/src/org/traccar/protocol/MaxonProtocol.java index e38dc98f0..587c3f014 100644 --- a/src/org/traccar/protocol/MaxonProtocol.java +++ b/src/org/traccar/protocol/MaxonProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class MaxonProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MegastekProtocol.java b/src/org/traccar/protocol/MegastekProtocol.java index df8abb539..2a61dfb22 100644 --- a/src/org/traccar/protocol/MegastekProtocol.java +++ b/src/org/traccar/protocol/MegastekProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class MegastekProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MeiligaoProtocol.java b/src/org/traccar/protocol/MeiligaoProtocol.java index 82afb05f3..36e1adb6d 100644 --- a/src/org/traccar/protocol/MeiligaoProtocol.java +++ b/src/org/traccar/protocol/MeiligaoProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class MeiligaoProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MeitrackProtocol.java b/src/org/traccar/protocol/MeitrackProtocol.java index f612873ba..bcc224a94 100644 --- a/src/org/traccar/protocol/MeitrackProtocol.java +++ b/src/org/traccar/protocol/MeitrackProtocol.java @@ -20,12 +20,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class MeitrackProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MiniFinderProtocol.java b/src/org/traccar/protocol/MiniFinderProtocol.java index 9bb8cf95d..cd159c8b7 100644 --- a/src/org/traccar/protocol/MiniFinderProtocol.java +++ b/src/org/traccar/protocol/MiniFinderProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class MiniFinderProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Mta6Protocol.java b/src/org/traccar/protocol/Mta6Protocol.java index 7281c4f1d..7d4ea68f7 100644 --- a/src/org/traccar/protocol/Mta6Protocol.java +++ b/src/org/traccar/protocol/Mta6Protocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.http.HttpResponseEncoder; import org.traccar.BaseProtocol; import org.traccar.Context; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Mta6Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MtxProtocol.java b/src/org/traccar/protocol/MtxProtocol.java index eedcc37a3..4fba981a5 100644 --- a/src/org/traccar/protocol/MtxProtocol.java +++ b/src/org/traccar/protocol/MtxProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class MtxProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/MxtProtocol.java b/src/org/traccar/protocol/MxtProtocol.java index 4c62a1833..95223932c 100644 --- a/src/org/traccar/protocol/MxtProtocol.java +++ b/src/org/traccar/protocol/MxtProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.http.commands.CommandType; -import org.traccar.protocol.commands.CommandTemplate; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class MxtProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/NavigilProtocol.java b/src/org/traccar/protocol/NavigilProtocol.java index 95d02f401..6d64761fc 100644 --- a/src/org/traccar/protocol/NavigilProtocol.java +++ b/src/org/traccar/protocol/NavigilProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class NavigilProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/NavisProtocol.java b/src/org/traccar/protocol/NavisProtocol.java index fb5609fcb..691a3d08c 100644 --- a/src/org/traccar/protocol/NavisProtocol.java +++ b/src/org/traccar/protocol/NavisProtocol.java @@ -20,12 +20,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class NavisProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/NoranProtocol.java b/src/org/traccar/protocol/NoranProtocol.java index 99d863e69..6c16fe6bc 100644 --- a/src/org/traccar/protocol/NoranProtocol.java +++ b/src/org/traccar/protocol/NoranProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class NoranProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/OrionProtocol.java b/src/org/traccar/protocol/OrionProtocol.java index d720da0fc..4113c4314 100644 --- a/src/org/traccar/protocol/OrionProtocol.java +++ b/src/org/traccar/protocol/OrionProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class OrionProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/OsmAndProtocol.java b/src/org/traccar/protocol/OsmAndProtocol.java index 449ffdf0e..1e60ae807 100644 --- a/src/org/traccar/protocol/OsmAndProtocol.java +++ b/src/org/traccar/protocol/OsmAndProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.http.HttpRequestDecoder; import org.jboss.netty.handler.codec.http.HttpResponseEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class OsmAndProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/PiligrimProtocol.java b/src/org/traccar/protocol/PiligrimProtocol.java index 56b0a5751..0478835d9 100644 --- a/src/org/traccar/protocol/PiligrimProtocol.java +++ b/src/org/traccar/protocol/PiligrimProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.http.HttpRequestDecoder; import org.jboss.netty.handler.codec.http.HttpResponseEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class PiligrimProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/ProgressProtocol.java b/src/org/traccar/protocol/ProgressProtocol.java index ab313a499..35bdf9c9b 100644 --- a/src/org/traccar/protocol/ProgressProtocol.java +++ b/src/org/traccar/protocol/ProgressProtocol.java @@ -20,12 +20,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class ProgressProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Pt3000Protocol.java b/src/org/traccar/protocol/Pt3000Protocol.java index 82804d892..bde8e7709 100644 --- a/src/org/traccar/protocol/Pt3000Protocol.java +++ b/src/org/traccar/protocol/Pt3000Protocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Pt3000Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Pt502Protocol.java b/src/org/traccar/protocol/Pt502Protocol.java index ca9f79a63..165d53c2d 100644 --- a/src/org/traccar/protocol/Pt502Protocol.java +++ b/src/org/traccar/protocol/Pt502Protocol.java @@ -20,12 +20,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class Pt502Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/RitiProtocol.java b/src/org/traccar/protocol/RitiProtocol.java index d643884ef..e968032ca 100644 --- a/src/org/traccar/protocol/RitiProtocol.java +++ b/src/org/traccar/protocol/RitiProtocol.java @@ -20,12 +20,9 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class RitiProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/RuptelaProtocol.java b/src/org/traccar/protocol/RuptelaProtocol.java index 9c8f9b00f..d9ce4430b 100644 --- a/src/org/traccar/protocol/RuptelaProtocol.java +++ b/src/org/traccar/protocol/RuptelaProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class RuptelaProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/SanavProtocol.java b/src/org/traccar/protocol/SanavProtocol.java index 7fddbb155..29c0533ea 100644 --- a/src/org/traccar/protocol/SanavProtocol.java +++ b/src/org/traccar/protocol/SanavProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class SanavProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/SkypatrolProtocol.java b/src/org/traccar/protocol/SkypatrolProtocol.java index 2664d291f..2791ba082 100644 --- a/src/org/traccar/protocol/SkypatrolProtocol.java +++ b/src/org/traccar/protocol/SkypatrolProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class SkypatrolProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Stl060Protocol.java b/src/org/traccar/protocol/Stl060Protocol.java index a4c7a9f4f..49e59e240 100644 --- a/src/org/traccar/protocol/Stl060Protocol.java +++ b/src/org/traccar/protocol/Stl060Protocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Stl060Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/SuntechProtocol.java b/src/org/traccar/protocol/SuntechProtocol.java index bd22675ed..630cab971 100644 --- a/src/org/traccar/protocol/SuntechProtocol.java +++ b/src/org/traccar/protocol/SuntechProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class SuntechProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/T55Protocol.java b/src/org/traccar/protocol/T55Protocol.java index 5987221c1..21f1d3e6c 100644 --- a/src/org/traccar/protocol/T55Protocol.java +++ b/src/org/traccar/protocol/T55Protocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class T55Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TelikProtocol.java b/src/org/traccar/protocol/TelikProtocol.java index 25320d4c7..b6b5ba14d 100644 --- a/src/org/traccar/protocol/TelikProtocol.java +++ b/src/org/traccar/protocol/TelikProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class TelikProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TeltonikaProtocol.java b/src/org/traccar/protocol/TeltonikaProtocol.java index 3a317110e..859b2a08c 100644 --- a/src/org/traccar/protocol/TeltonikaProtocol.java +++ b/src/org/traccar/protocol/TeltonikaProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class TeltonikaProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Tk102Protocol.java b/src/org/traccar/protocol/Tk102Protocol.java index 3c21e00e2..4e1d067f9 100644 --- a/src/org/traccar/protocol/Tk102Protocol.java +++ b/src/org/traccar/protocol/Tk102Protocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Tk102Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Tk103Protocol.java b/src/org/traccar/protocol/Tk103Protocol.java index 8391fcb4f..b14264091 100644 --- a/src/org/traccar/protocol/Tk103Protocol.java +++ b/src/org/traccar/protocol/Tk103Protocol.java @@ -23,11 +23,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Tk103Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Tlt2hProtocol.java b/src/org/traccar/protocol/Tlt2hProtocol.java index a2f1122a7..d1a8ee735 100644 --- a/src/org/traccar/protocol/Tlt2hProtocol.java +++ b/src/org/traccar/protocol/Tlt2hProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Tlt2hProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TopflytechProtocol.java b/src/org/traccar/protocol/TopflytechProtocol.java index e50983dc8..42fa36c10 100644 --- a/src/org/traccar/protocol/TopflytechProtocol.java +++ b/src/org/traccar/protocol/TopflytechProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class TopflytechProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TotemProtocol.java b/src/org/traccar/protocol/TotemProtocol.java index 1bb57dd45..cbc35a664 100644 --- a/src/org/traccar/protocol/TotemProtocol.java +++ b/src/org/traccar/protocol/TotemProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class TotemProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Tr20Protocol.java b/src/org/traccar/protocol/Tr20Protocol.java index 3b0267c50..8c5a27ae2 100644 --- a/src/org/traccar/protocol/Tr20Protocol.java +++ b/src/org/traccar/protocol/Tr20Protocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Tr20Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Tr900Protocol.java b/src/org/traccar/protocol/Tr900Protocol.java index 56fb850f2..4db0a2239 100644 --- a/src/org/traccar/protocol/Tr900Protocol.java +++ b/src/org/traccar/protocol/Tr900Protocol.java @@ -22,13 +22,9 @@ import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; -import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Tr900Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TrackboxProtocol.java b/src/org/traccar/protocol/TrackboxProtocol.java index 4c1b6afa3..68554394e 100644 --- a/src/org/traccar/protocol/TrackboxProtocol.java +++ b/src/org/traccar/protocol/TrackboxProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class TrackboxProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TramigoProtocol.java b/src/org/traccar/protocol/TramigoProtocol.java index 7e7f71565..48892a78e 100644 --- a/src/org/traccar/protocol/TramigoProtocol.java +++ b/src/org/traccar/protocol/TramigoProtocol.java @@ -19,12 +19,9 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.nio.ByteOrder; import java.util.List; -import java.util.Map; public class TramigoProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/TytanProtocol.java b/src/org/traccar/protocol/TytanProtocol.java index 09b2b2fba..50918652a 100644 --- a/src/org/traccar/protocol/TytanProtocol.java +++ b/src/org/traccar/protocol/TytanProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class TytanProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/UlbotechProtocol.java b/src/org/traccar/protocol/UlbotechProtocol.java index 7a92f6f51..d0413ecbe 100644 --- a/src/org/traccar/protocol/UlbotechProtocol.java +++ b/src/org/traccar/protocol/UlbotechProtocol.java @@ -19,11 +19,8 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class UlbotechProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/V680Protocol.java b/src/org/traccar/protocol/V680Protocol.java index 2b8960c92..a89f77edd 100644 --- a/src/org/traccar/protocol/V680Protocol.java +++ b/src/org/traccar/protocol/V680Protocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class V680Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/VisiontekProtocol.java b/src/org/traccar/protocol/VisiontekProtocol.java index 792cdf8a3..53d02c478 100644 --- a/src/org/traccar/protocol/VisiontekProtocol.java +++ b/src/org/traccar/protocol/VisiontekProtocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class VisiontekProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/WialonProtocol.java b/src/org/traccar/protocol/WialonProtocol.java index f3dd22941..6fe924c2d 100644 --- a/src/org/traccar/protocol/WialonProtocol.java +++ b/src/org/traccar/protocol/WialonProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class WialonProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/WondexProtocol.java b/src/org/traccar/protocol/WondexProtocol.java index 3552ba62e..169c6cb43 100644 --- a/src/org/traccar/protocol/WondexProtocol.java +++ b/src/org/traccar/protocol/WondexProtocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class WondexProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/XirgoProtocol.java b/src/org/traccar/protocol/XirgoProtocol.java index 32423cca1..83c373175 100644 --- a/src/org/traccar/protocol/XirgoProtocol.java +++ b/src/org/traccar/protocol/XirgoProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class XirgoProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Xt013Protocol.java b/src/org/traccar/protocol/Xt013Protocol.java index 0eadd39f2..14e0d3b9f 100644 --- a/src/org/traccar/protocol/Xt013Protocol.java +++ b/src/org/traccar/protocol/Xt013Protocol.java @@ -21,11 +21,8 @@ import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; import org.jboss.netty.handler.codec.string.StringDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Xt013Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/Xt7Protocol.java b/src/org/traccar/protocol/Xt7Protocol.java index d6d7a864f..da19b6e2d 100644 --- a/src/org/traccar/protocol/Xt7Protocol.java +++ b/src/org/traccar/protocol/Xt7Protocol.java @@ -20,11 +20,8 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class Xt7Protocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/YwtProtocol.java b/src/org/traccar/protocol/YwtProtocol.java index ed6224007..e9cdb1615 100644 --- a/src/org/traccar/protocol/YwtProtocol.java +++ b/src/org/traccar/protocol/YwtProtocol.java @@ -22,11 +22,8 @@ import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; -import org.traccar.protocol.commands.CommandTemplate; -import org.traccar.http.commands.CommandType; import java.util.List; -import java.util.Map; public class YwtProtocol extends BaseProtocol { diff --git a/src/org/traccar/protocol/commands/CommandTemplate.java b/src/org/traccar/protocol/commands/CommandTemplate.java deleted file mode 100644 index 5d461b276..000000000 --- a/src/org/traccar/protocol/commands/CommandTemplate.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.traccar.protocol.commands; - -import org.traccar.database.ActiveDevice; -import org.traccar.http.commands.GpsCommand; - -public interface CommandTemplate { - Object applyTo(ActiveDevice activeDevice, T command); -} diff --git a/src/org/traccar/protocol/commands/CommandValueConversion.java b/src/org/traccar/protocol/commands/CommandValueConversion.java deleted file mode 100644 index cfbf3ce5a..000000000 --- a/src/org/traccar/protocol/commands/CommandValueConversion.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.traccar.protocol.commands; - -public interface CommandValueConversion { - public String convert(T value); -} diff --git a/src/org/traccar/protocol/commands/StringCommandTemplate.java b/src/org/traccar/protocol/commands/StringCommandTemplate.java deleted file mode 100644 index 2ac0ce9a8..000000000 --- a/src/org/traccar/protocol/commands/StringCommandTemplate.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.traccar.protocol.commands; - -import org.traccar.database.ActiveDevice; -import org.traccar.http.commands.GpsCommand; -import org.traccar.protocol.commands.CommandValueConversion; - -import java.util.HashMap; -import java.util.Map; - -public class StringCommandTemplate implements CommandTemplate { - - private String messageTemplate; - private Map, CommandValueConversion> converters = new HashMap, CommandValueConversion>(); - - public StringCommandTemplate(String template, Object... replacements) { - this.messageTemplate = String.format(template, replacements); - } - - @Override - public Object applyTo(ActiveDevice activeDevice, T command) { - String currentMessage = messageTemplate; - currentMessage = this.replace(currentMessage, GpsCommand.UNIQUE_ID, activeDevice.getUniqueId()); - - Map replacements = command.getReplacements(); - - for (Map.Entry entry : replacements.entrySet()) { - currentMessage = this.replace(currentMessage, entry.getKey(), entry.getValue()); - } - - return currentMessage; - } - - public CommandTemplate addConverter(Class type, CommandValueConversion converter) { - converters.put(type, converter); - return this; - } - - protected CommandValueConversion getConverter(Class type) { - return converters.containsKey(type) ? converters.get(type) : idConverter(); - } - - private CommandValueConversion idConverter() { - return new CommandValueConversion() { - @Override - public String convert(Object value) { - return value.toString(); - } - }; - } - - private String replace(String currentMessage, String key, Object value) { - String replacementValue = getConverter(value.getClass()).convert(value); - return currentMessage.replace("[" + key + "]", replacementValue); - } - -} -- cgit v1.2.3