From 1948e0f63202dddca607dcb51fa9a92a83e49154 Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Fri, 10 Oct 2014 19:23:21 -0400 Subject: Eliminated the need for hardcoded protocol strings in the src/org/traccar/protocol/*ProtocolDecoder.java files. --- src/org/traccar/BaseProtocolDecoder.java | 25 ++ src/org/traccar/ServerManager.java | 292 ++++++++++----------- src/org/traccar/protocol/ApelProtocolDecoder.java | 6 +- .../traccar/protocol/AplicomProtocolDecoder.java | 6 +- .../traccar/protocol/AtrackProtocolDecoder.java | 6 +- src/org/traccar/protocol/BoxProtocolDecoder.java | 6 +- .../traccar/protocol/CarTrackProtocolDecoder.java | 6 +- .../traccar/protocol/CarscopProtocolDecoder.java | 6 +- .../protocol/CellocatorProtocolDecoder.java | 6 +- .../traccar/protocol/EasyTrackProtocolDecoder.java | 6 +- .../traccar/protocol/EelinkProtocolDecoder.java | 6 +- .../traccar/protocol/EnforaProtocolDecoder.java | 6 +- src/org/traccar/protocol/Ev603ProtocolDecoder.java | 6 +- .../traccar/protocol/FreedomProtocolDecoder.java | 6 +- .../traccar/protocol/GalileoProtocolDecoder.java | 8 +- src/org/traccar/protocol/GatorProtocolDecoder.java | 6 +- src/org/traccar/protocol/Gl100ProtocolDecoder.java | 6 +- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 6 +- .../traccar/protocol/GlobalSatProtocolDecoder.java | 25 +- src/org/traccar/protocol/GotopProtocolDecoder.java | 6 +- .../traccar/protocol/Gps103ProtocolDecoder.java | 6 +- .../traccar/protocol/GpsGateProtocolDecoder.java | 6 +- src/org/traccar/protocol/Gt02ProtocolDecoder.java | 6 +- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 10 +- src/org/traccar/protocol/H02ProtocolDecoder.java | 8 +- .../traccar/protocol/HaicomProtocolDecoder.java | 6 +- .../protocol/IntellitracProtocolDecoder.java | 6 +- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 8 +- src/org/traccar/protocol/KhdProtocolDecoder.java | 6 +- .../traccar/protocol/LaipacProtocolDecoder.java | 6 +- src/org/traccar/protocol/M2mProtocolDecoder.java | 6 +- .../traccar/protocol/ManPowerProtocolDecoder.java | 6 +- src/org/traccar/protocol/MaxonProtocolDecoder.java | 4 + .../traccar/protocol/MegastekProtocolDecoder.java | 6 +- .../traccar/protocol/MeiligaoProtocolDecoder.java | 10 +- .../traccar/protocol/MeitrackProtocolDecoder.java | 8 +- .../protocol/MiniFinderProtocolDecoder.java | 6 +- src/org/traccar/protocol/Mta6ProtocolDecoder.java | 10 +- .../traccar/protocol/NavigilProtocolDecoder.java | 16 +- src/org/traccar/protocol/NavisProtocolDecoder.java | 6 +- src/org/traccar/protocol/NoranProtocolDecoder.java | 6 +- src/org/traccar/protocol/OrionProtocolDecoder.java | 6 +- .../traccar/protocol/OsmAndProtocolDecoder.java | 6 +- .../traccar/protocol/PiligrimProtocolDecoder.java | 6 +- .../traccar/protocol/ProgressProtocolDecoder.java | 6 +- .../traccar/protocol/Pt3000ProtocolDecoder.java | 6 +- src/org/traccar/protocol/Pt502ProtocolDecoder.java | 6 +- src/org/traccar/protocol/RitiProtocolDecoder.java | 6 +- .../traccar/protocol/RuptelaProtocolDecoder.java | 6 +- src/org/traccar/protocol/SanavProtocolDecoder.java | 6 +- .../traccar/protocol/SkypatrolProtocolDecoder.java | 6 +- .../traccar/protocol/Stl060ProtocolDecoder.java | 6 +- .../traccar/protocol/SuntechProtocolDecoder.java | 6 +- src/org/traccar/protocol/SyrusProtocolDecoder.java | 7 +- src/org/traccar/protocol/T55ProtocolDecoder.java | 12 +- src/org/traccar/protocol/TelikProtocolDecoder.java | 6 +- .../traccar/protocol/TeltonikaProtocolDecoder.java | 6 +- src/org/traccar/protocol/Tk102ProtocolDecoder.java | 6 +- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 6 +- src/org/traccar/protocol/Tlt2hProtocolDecoder.java | 6 +- .../protocol/TopflytechProtocolDecoder.java | 6 +- src/org/traccar/protocol/TotemProtocolDecoder.java | 6 +- src/org/traccar/protocol/Tr20ProtocolDecoder.java | 6 +- .../traccar/protocol/TrackboxProtocolDecoder.java | 6 +- src/org/traccar/protocol/V680ProtocolDecoder.java | 6 +- .../traccar/protocol/VisiontekProtocolDecoder.java | 6 +- .../traccar/protocol/WialonProtocolDecoder.java | 6 +- .../traccar/protocol/WondexProtocolDecoder.java | 6 +- .../traccar/protocol/Xexun2ProtocolDecoder.java | 6 +- src/org/traccar/protocol/XexunProtocolDecoder.java | 6 +- src/org/traccar/protocol/Xt7ProtocolDecoder.java | 6 +- src/org/traccar/protocol/YwtProtocolDecoder.java | 6 +- 72 files changed, 557 insertions(+), 234 deletions(-) diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index e23367278..3976ba9e8 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -31,6 +31,7 @@ public abstract class BaseProtocolDecoder extends OneToOneDecoder { private ServerManager serverManager; private DataManager dataManager; + private final String protocol; public final void setDataManager(DataManager dataManager) { this.dataManager = dataManager; @@ -48,14 +49,38 @@ public abstract class BaseProtocolDecoder extends OneToOneDecoder { return serverManager; } + public final String getProtocol() { + return protocol; + } + public BaseProtocolDecoder() { + protocol = null; } public BaseProtocolDecoder(ServerManager serverManager) { + // Only used by test classes now + assert (serverManager == null) : + "BaseProtocolDecoder() initialized with non-NULL serverManager"; + if (serverManager != null) { this.serverManager = serverManager; dataManager = serverManager.getDataManager(); } + + protocol = null; + } + + public BaseProtocolDecoder(ServerManager serverManager, String protocol) { + assert (serverManager != null) : + "BaseProtocolDecoder() initialized with NULL serverManager"; + + assert (protocol != null) : + "BaseProtocolDecoder() initialized with NULL protocol"; + + this.serverManager = serverManager; + this.protocol = protocol; + + dataManager = serverManager.getDataManager(); } @Override diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 33d364cc4..9edb1cf5e 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -228,20 +228,20 @@ public class ServerManager { return false; } - private void initXexunServer(String protocol) throws SQLException { + private void initXexunServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new XexunFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new XexunProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new XexunProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGps103Server(String protocol) throws SQLException { + private void initGps103Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -255,7 +255,7 @@ public class ServerManager { ChannelBuffers.wrappedBuffer(delimiter3))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this, protocol)); } }); serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @@ -263,13 +263,13 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTk103Server(String protocol) throws SQLException { + private void initTk103Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -279,7 +279,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(ServerManager.this, protocol)); } }); serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @@ -287,13 +287,13 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGl100Server(String protocol) throws SQLException { + private void initGl100Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -303,13 +303,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gl100ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Gl100ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGl200Server(String protocol) throws SQLException { + private void initGl200Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -322,13 +322,13 @@ public class ServerManager { ChannelBuffers.wrappedBuffer(delimiter2))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initT55Server(String protocol) throws SQLException { + private void initT55Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -338,13 +338,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new T55ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new T55ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initXexun2Server(String protocol) throws SQLException { + private void initXexun2Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -353,50 +353,50 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTotemServer(String protocol) throws SQLException { + private void initTotemServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new TotemFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TotemProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new TotemProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initEnforaServer(String protocol) throws SQLException { + private void initEnforaServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 0, 2, -2, 2)); - pipeline.addLast("objectDecoder", new EnforaProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new EnforaProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initMeiligaoServer(String protocol) throws SQLException { + private void initMeiligaoServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new MeiligaoFrameDecoder()); - pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initMaxonServer(String protocol) throws SQLException { + private void initMaxonServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -406,13 +406,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new MaxonProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new MaxonProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initSuntechServer(String protocol) throws SQLException { + private void initSuntechServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -421,19 +421,19 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SuntechProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new SuntechProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initProgressServer(String protocol) throws SQLException { + private void initProgressServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0)); - pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -441,31 +441,31 @@ public class ServerManager { } } - private void initH02Server(String protocol) throws SQLException { + private void initH02Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new H02FrameDecoder()); - pipeline.addLast("objectDecoder", new H02ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new H02ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initJt600Server(String protocol) throws SQLException { + private void initJt600Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Jt600FrameDecoder()); - pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initEv603Server(String protocol) throws SQLException { + private void initEv603Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -474,13 +474,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Ev603ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Ev603ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initV680Server(String protocol) throws SQLException { + private void initV680Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -489,20 +489,20 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new V680ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new V680ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initPt502Server(String protocol) throws SQLException { + private void initPt502Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Pt502FrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -510,7 +510,7 @@ public class ServerManager { } } - private void initTr20Server(String protocol) throws SQLException { + private void initTr20Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -520,19 +520,19 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tr20ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Tr20ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initNavisServer(String protocol) throws SQLException { + private void initNavisServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(4 * 1024, 12, 2, 2, 0)); - pipeline.addLast("objectDecoder", new NavisProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new NavisProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -540,14 +540,14 @@ public class ServerManager { } } - private void initMeitrackServer(String protocol) throws SQLException { + private void initMeitrackServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new MeitrackFrameDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -555,42 +555,42 @@ public class ServerManager { } } - private void initSkypatrolServer(String protocol) throws SQLException { + private void initSkypatrolServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGt02Server(String protocol) throws SQLException { + private void initGt02Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0)); - pipeline.addLast("objectDecoder", new Gt02ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Gt02ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGt06Server(String protocol) throws SQLException { + private void initGt06Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Gt06FrameDecoder()); - pipeline.addLast("objectDecoder", new Gt06ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Gt06ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initMegastekServer(String protocol) throws SQLException { + private void initMegastekServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -598,19 +598,19 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new MegastekProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new MegastekProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initNavigilServer(String protocol) throws SQLException { + private void initNavigilServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new NavigilFrameDecoder()); - pipeline.addLast("objectDecoder", new NavigilProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new NavigilProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -618,7 +618,7 @@ public class ServerManager { } } - private void initGpsGateServer(String protocol) throws SQLException { + private void initGpsGateServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -628,51 +628,51 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GpsGateProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new GpsGateProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTeltonikaServer(String protocol) throws SQLException { + private void initTeltonikaServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new TeltonikaFrameDecoder()); - pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initMta6Server(String protocol) throws SQLException { + private void initMta6Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(ServerManager.this, false)); + pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(ServerManager.this, protocol, false)); } }); } } - private void initMta6CanServer(String protocol) throws SQLException { + private void initMta6CanServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(ServerManager.this, true)); + pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(ServerManager.this, protocol, true)); } }); } } - private void initTlt2hServer(String protocol) throws SQLException { + private void initTlt2hServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -682,13 +682,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(32 * 1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initSyrusServer(String protocol) throws SQLException { + private void initSyrusServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -698,32 +698,32 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, true)); + pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, protocol, true)); } }); } } - private void initWondexServer(String protocol) throws SQLException { + private void initWondexServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new WondexFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new WondexProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new WondexProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initCellocatorServer(String protocol) throws SQLException { + private void initCellocatorServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new CellocatorFrameDecoder()); - pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -731,13 +731,13 @@ public class ServerManager { } } - private void initGalileoServer(String protocol) throws SQLException { + private void initGalileoServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new GalileoFrameDecoder()); - pipeline.addLast("objectDecoder", new GalileoProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new GalileoProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -745,7 +745,7 @@ public class ServerManager { } } - private void initYwtServer(String protocol) throws SQLException { + private void initYwtServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -755,13 +755,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new YwtProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new YwtProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTk102Server(String protocol) throws SQLException { + private void initTk102Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -771,13 +771,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initIntellitracServer(String protocol) throws SQLException { + private void initIntellitracServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -785,25 +785,25 @@ public class ServerManager { pipeline.addLast("frameDecoder", new IntellitracFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new IntellitracProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new IntellitracProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initXt7Server(String protocol) throws SQLException { + private void initXt7Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 20, 1, 5, 0)); - pipeline.addLast("objectDecoder", new Xt7ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Xt7ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initWialonServer(String protocol) throws SQLException { + private void initWialonServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -811,13 +811,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new WialonProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new WialonProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initCarscopServer(String protocol) throws SQLException { + private void initCarscopServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -827,19 +827,19 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new CarscopProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new CarscopProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initApelServer(String protocol) throws SQLException { + private void initApelServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0)); - pipeline.addLast("objectDecoder", new ApelProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new ApelProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -847,7 +847,7 @@ public class ServerManager { } } - private void initManPowerServer(String protocol) throws SQLException { + private void initManPowerServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -857,13 +857,13 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new ManPowerProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new ManPowerProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGlobalSatServer(String protocol) throws SQLException { + private void initGlobalSatServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -873,25 +873,25 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GlobalSatProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new GlobalSatProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initAtrackServer(String protocol) throws SQLException { + private void initAtrackServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new AtrackFrameDecoder()); - pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initPt3000Server(String protocol) throws SQLException { + private void initPt3000Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -901,25 +901,25 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Pt3000ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Pt3000ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initRuptelaServer(String protocol) throws SQLException { + private void initRuptelaServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 0, 2, 2, 0)); - pipeline.addLast("objectDecoder", new RuptelaProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new RuptelaProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTopflytechServer(String protocol) throws SQLException { + private void initTopflytechServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -928,13 +928,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initLaipacServer(String protocol) throws SQLException { + private void initLaipacServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -942,25 +942,25 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new LaipacProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new LaipacProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initAplicomServer(String protocol) throws SQLException { + private void initAplicomServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new AplicomFrameDecoder()); - pipeline.addLast("objectDecoder", new AplicomProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new AplicomProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGotopServer(String protocol) throws SQLException { + private void initGotopServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -969,13 +969,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GotopProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new GotopProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initSanavServer(String protocol) throws SQLException { + private void initSanavServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -984,29 +984,29 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SanavProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new SanavProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initGatorServer(String protocol) throws SQLException { + private void initGatorServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("objectDecoder", new GatorProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new GatorProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initNoranServer(String protocol) throws SQLException { + private void initNoranServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("objectDecoder", new NoranProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new NoranProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -1014,32 +1014,32 @@ public class ServerManager { } } - private void initM2mServer(String protocol) throws SQLException { + private void initM2mServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(23)); - pipeline.addLast("objectDecoder", new M2mProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new M2mProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initOsmAndServer(String protocol) throws SQLException { + private void initOsmAndServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new OsmAndProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new OsmAndProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initEasyTrackServer(String protocol) throws SQLException { + private void initEasyTrackServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1048,37 +1048,37 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTaipServer(String protocol) throws SQLException { + private void initTaipServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, false)); + pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, protocol, false)); } }); } } - private void initKhdServer(String protocol) throws SQLException { + private void initKhdServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 3, 2)); - pipeline.addLast("objectDecoder", new KhdProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new KhdProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initPiligrimServer(String protocol) throws SQLException { + private void initPiligrimServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1086,26 +1086,26 @@ public class ServerManager { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpAggregator", new HttpChunkAggregator(16384)); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new PiligrimProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new PiligrimProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initStl060Server(String protocol) throws SQLException { + private void initStl060Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Stl060FrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Stl060ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new Stl060ProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initCarTrackServer(String protocol) throws SQLException { + private void initCarTrackServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1114,13 +1114,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new CarTrackProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new CarTrackProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initMiniFinderServer(String protocol) throws SQLException { + private void initMiniFinderServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1129,13 +1129,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new MiniFinderProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new MiniFinderProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initHaicomServer(String protocol) throws SQLException { + private void initHaicomServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1144,25 +1144,25 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new HaicomProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new HaicomProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initEelinkServer(String protocol) throws SQLException { + private void initEelinkServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2)); - pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initBoxServer(String protocol) throws SQLException { + private void initBoxServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1171,26 +1171,26 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new BoxProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new BoxProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initFreedomServer(String protocol) throws SQLException { + private void initFreedomServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new FreedomProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new FreedomProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTelikServer(String protocol) throws SQLException { + private void initTelikServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1199,13 +1199,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TelikProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new TelikProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initTrackboxServer(String protocol) throws SQLException { + private void initTrackboxServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1213,13 +1213,13 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TrackboxProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new TrackboxProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initVisiontekServer(String protocol) throws SQLException { + private void initVisiontekServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override @@ -1228,19 +1228,19 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(ServerManager.this, protocol)); } }); } } - private void initOrionServer(String protocol) throws SQLException { + private void initOrionServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new OrionFrameDecoder()); - pipeline.addLast("objectDecoder", new OrionProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new OrionProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -1248,13 +1248,13 @@ public class ServerManager { } } - private void initRitiServer(String protocol) throws SQLException { + private void initRitiServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 105, 2, 3, 0)); - pipeline.addLast("objectDecoder", new RitiProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new RitiProtocolDecoder(ServerManager.this, protocol)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java index 54b112b59..954006807 100644 --- a/src/org/traccar/protocol/ApelProtocolDecoder.java +++ b/src/org/traccar/protocol/ApelProtocolDecoder.java @@ -42,6 +42,10 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public ApelProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + /* * Message types */ @@ -165,7 +169,7 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { for (int j = 0; j < recordCount; j++) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("apel"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); // Message index diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index 21a3127d1..468e4a5fc 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -31,6 +31,10 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public AplicomProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final long IMEI_BASE_TC65_V20 = 0x1437207000000L; private static final long IMEI_BASE_TC65_V28 = 358244010000000L; private static final long IMEI_BASE_TC65I_V11 = 0x14143B4000000L; @@ -124,7 +128,7 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("aplicom"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); try { position.setDeviceId(getDataManager().getDeviceByImei(imei).getId()); } catch(Exception error) { diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index 3dbd214d9..7edafa057 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -35,6 +35,10 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public AtrackProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final int MSG_HEARTBEAT = 0x1A; private static final int MSG_DATA = 0x10; @@ -96,7 +100,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("atrack"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Date and time position.setTime(new Date(buf.readUnsignedInt() * 1000)); // gps time diff --git a/src/org/traccar/protocol/BoxProtocolDecoder.java b/src/org/traccar/protocol/BoxProtocolDecoder.java index 239b0aac5..4184ee0e2 100644 --- a/src/org/traccar/protocol/BoxProtocolDecoder.java +++ b/src/org/traccar/protocol/BoxProtocolDecoder.java @@ -35,6 +35,10 @@ public class BoxProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public BoxProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "L," + "(\\d{2})(\\d{2})(\\d{2})" + // Date @@ -79,7 +83,7 @@ public class BoxProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("box"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java index 559a5ccc1..aa02ba044 100644 --- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java @@ -34,6 +34,10 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public CarTrackProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\$\\$" + // Header "(\\d+)\\?*" + // Device ID @@ -70,7 +74,7 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("cartrack"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Get device by unique identifier diff --git a/src/org/traccar/protocol/CarscopProtocolDecoder.java b/src/org/traccar/protocol/CarscopProtocolDecoder.java index 9748b2e09..6683a463f 100644 --- a/src/org/traccar/protocol/CarscopProtocolDecoder.java +++ b/src/org/traccar/protocol/CarscopProtocolDecoder.java @@ -35,6 +35,10 @@ public class CarscopProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public CarscopProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + // Very similar to TK103 protocol static private Pattern pattern = Pattern.compile( "\\*.*" + @@ -80,7 +84,7 @@ public class CarscopProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("carscop"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); index = 1; // Time diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index 7e55a6865..8cce47bd5 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -34,6 +34,10 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public CellocatorProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private String readImei(ChannelBuffer buf) { int b = buf.readUnsignedByte(); StringBuilder imei = new StringBuilder(); @@ -103,7 +107,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { // Parse location if (type == MSG_CLIENT_STATUS) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("cellocator"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Device identifier try { diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index 4b0080267..87a0135eb 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -33,6 +33,10 @@ public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public EasyTrackProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + //ET,358155100003016,HB,A,0d081e,07381e,8038ee09,03d2e9be,004f,0000,40c00000,0f,100,0000,00037c,29 static private Pattern pattern = Pattern.compile( "\\*..," + // Manufacturer @@ -74,7 +78,7 @@ public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("easytrack"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 00c74f7f3..97c2821b5 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -36,6 +36,10 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public EelinkProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private String readImei(ChannelBuffer buf) { int b = buf.readUnsignedByte(); StringBuilder imei = new StringBuilder(); @@ -105,7 +109,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("eelink"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("index", index); // Location diff --git a/src/org/traccar/protocol/EnforaProtocolDecoder.java b/src/org/traccar/protocol/EnforaProtocolDecoder.java index eec724e30..0509b0c6d 100644 --- a/src/org/traccar/protocol/EnforaProtocolDecoder.java +++ b/src/org/traccar/protocol/EnforaProtocolDecoder.java @@ -36,6 +36,10 @@ public class EnforaProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public EnforaProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "GPRMC," + "(\\d{2})(\\d{2})(\\d{2}).(\\d+)," + // Time (HHMMSS.SS) @@ -94,7 +98,7 @@ public class EnforaProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("enfora"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Get device by IMEI diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java index a57a0e79b..c73067b0c 100644 --- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java @@ -36,6 +36,10 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ super(serverManager); } + public Ev603ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "!A," + // Type "(\\d{2})\\/(\\d{2})\\/(\\d{2})," + // Date dd/mm/YY @@ -74,7 +78,7 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("ev603"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Date diff --git a/src/org/traccar/protocol/FreedomProtocolDecoder.java b/src/org/traccar/protocol/FreedomProtocolDecoder.java index 7e86d285f..0acff7f22 100644 --- a/src/org/traccar/protocol/FreedomProtocolDecoder.java +++ b/src/org/traccar/protocol/FreedomProtocolDecoder.java @@ -33,6 +33,10 @@ public class FreedomProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public FreedomProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "IMEI," + "(\\d+)," + // IMEI @@ -56,7 +60,7 @@ public class FreedomProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("freedom"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Identification diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java index 079b76ea4..cb29a0920 100644 --- a/src/org/traccar/protocol/GalileoProtocolDecoder.java +++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java @@ -40,6 +40,10 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public GalileoProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final int TAG_IMEI = 0x03; private static final int TAG_DATE = 0x20; private static final int TAG_COORDINATES = 0x30; @@ -97,7 +101,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder { List positions = new LinkedList(); Set tags = new HashSet(); Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("galileo"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); while (buf.readerIndex() < length) { @@ -108,7 +112,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder { positions.add(position); tags.clear(); position = new Position(); - extendedInfo = new ExtendedInfoFormatter("galileo"); + extendedInfo = new ExtendedInfoFormatter(getProtocol()); } tags.add(tag); diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 15a46d375..7f93082fd 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -33,6 +33,10 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public GatorProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final int PACKET_HEARTBEAT = 0x21; private static final int PACKET_POSITION_DATA = 0x80; private static final int PACKET_ROLLCALL_RESPONSE = 0x81; @@ -66,7 +70,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gator"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Identification try { diff --git a/src/org/traccar/protocol/Gl100ProtocolDecoder.java b/src/org/traccar/protocol/Gl100ProtocolDecoder.java index 572615053..0dac5d2b3 100644 --- a/src/org/traccar/protocol/Gl100ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl100ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Gl100ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Gl100ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\+RESP:GT...," + "(\\d{15})," + // IMEI @@ -74,7 +78,7 @@ public class Gl100ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gl100"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 942d6ef10..83fd42b74 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Gl200ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\+(?:RESP|BUFF):GT...," + "[0-9a-fA-F]{6}," + // Protocol version @@ -67,7 +71,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gl200"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 5b4dc5e9b..bd56fde1f 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -36,6 +36,10 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { public GlobalSatProtocolDecoder(ServerManager serverManager) { super(serverManager); + // This is now only called by test classes. + // This will be deleted in the next commit. + assert (serverManager == null); + // Initialize format strings format0 = "TSPRXAB27GHKLMnaicz*U!"; format1 = "SARY*U!"; @@ -49,6 +53,23 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { } } } + + public GlobalSatProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + + // Initialize format strings + format0 = "TSPRXAB27GHKLMnaicz*U!"; + format1 = "SARY*U!"; + if (getServerManager() != null) { + Properties p = getServerManager().getProperties(); + if (p.containsKey(protocol + ".format0")) { + format0 = p.getProperty(protocol + ".format0"); + } + if (p.containsKey(protocol + ".format1")) { + format1 = p.getProperty(protocol + ".format1"); + } + } + } private Position decodeOriginal(Channel channel, String sentence) { @@ -83,7 +104,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { // Parse data Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("globalsat"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); for (int formatIndex = 0, valueIndex = 1; formatIndex < format.length() && valueIndex < values.length; formatIndex++) { String value = values[valueIndex]; @@ -204,7 +225,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("globalsat"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Identification diff --git a/src/org/traccar/protocol/GotopProtocolDecoder.java b/src/org/traccar/protocol/GotopProtocolDecoder.java index 826faf531..70d0063a1 100644 --- a/src/org/traccar/protocol/GotopProtocolDecoder.java +++ b/src/org/traccar/protocol/GotopProtocolDecoder.java @@ -33,6 +33,10 @@ public class GotopProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public GotopProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(\\d+)," + // IMEI "[^,]+," + // Type @@ -60,7 +64,7 @@ public class GotopProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gotop"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Get device by IMEI diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 124df4377..ca578841a 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -34,6 +34,10 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Gps103ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "imei:" + "(\\d+)," + // IMEI @@ -88,7 +92,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gps103"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java index 268f9ea8a..bc8c759c3 100644 --- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java @@ -36,6 +36,10 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public GpsGateProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + /** * Regular expressions pattern */ @@ -104,7 +108,7 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gpsgate"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java index 561377f7f..8e351f456 100644 --- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Gt02ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private String readImei(ChannelBuffer buf) { int b = buf.readUnsignedByte(); StringBuilder imei = new StringBuilder(); @@ -77,7 +81,7 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gt02"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("index", index); // Get device id diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 44702924c..f1e8585e5 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -36,12 +36,16 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { public Gt06ProtocolDecoder(ServerManager serverManager) { super(serverManager); + } + + public Gt06ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); if (serverManager != null) { Properties p = getServerManager().getProperties(); - if (p.containsKey("gt06.timezone")) { + if (p.containsKey(protocol + ".timezone")) { timeZone.setRawOffset( - Integer.valueOf(p.getProperty("gt06.timezone")) * 1000); + Integer.valueOf(p.getProperty(protocol + ".timezone")) * 1000); } } } @@ -144,7 +148,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("gt06"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Date and time Calendar time = Calendar.getInstance(timeZone); diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 51b1aff5e..f7843e2c8 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -35,6 +35,10 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { public H02ProtocolDecoder(ServerManager serverManager) { super(serverManager); } + + public H02ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } private static double readCoordinate(ChannelBuffer buf, boolean lon) { @@ -59,7 +63,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("h02"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); buf.readByte(); // marker @@ -133,7 +137,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("h02"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index 1845dc31b..199093492 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -33,6 +33,10 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public HaicomProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\$GPRS" + "(\\d+)," + // IMEI @@ -67,7 +71,7 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("haicom"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java index 53e67af3d..fe093a033 100644 --- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java +++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java @@ -33,6 +33,10 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public IntellitracProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(?:.+,)?(\\d+)," + // Device Identifier "(\\d{4})(\\d{2})(\\d{2})" + // Date (YYYYMMDD) @@ -76,7 +80,7 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("intellitrac"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Detect device diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index b8273b5a4..7f67daafe 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -36,10 +36,14 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Jt600ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private Position decodeNormalMessage(ChannelBuffer buf) throws Exception { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("jt600"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); buf.readByte(); // header @@ -158,7 +162,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("jt600"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("alert", "true"); Integer index = 1; diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java index bd21592e1..e8716ffd0 100644 --- a/src/org/traccar/protocol/KhdProtocolDecoder.java +++ b/src/org/traccar/protocol/KhdProtocolDecoder.java @@ -35,6 +35,10 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public KhdProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private String readSerialNumber(ChannelBuffer buf) { int b1 = buf.readUnsignedByte(); int b2 = buf.readUnsignedByte(); if (b2 > 0x80) b2 -= 0x80; @@ -73,7 +77,7 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("khd"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Device identification String id = readSerialNumber(buf); diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index a62a50e51..cba86f7b4 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -34,6 +34,10 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public LaipacProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\$AVRMC," + "([^,]+)," + // Identifier @@ -71,7 +75,7 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("laipac"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Identification diff --git a/src/org/traccar/protocol/M2mProtocolDecoder.java b/src/org/traccar/protocol/M2mProtocolDecoder.java index f54934536..2a0c8ebaf 100644 --- a/src/org/traccar/protocol/M2mProtocolDecoder.java +++ b/src/org/traccar/protocol/M2mProtocolDecoder.java @@ -31,6 +31,10 @@ public class M2mProtocolDecoder extends BaseProtocolDecoder { public M2mProtocolDecoder(ServerManager serverManager) { super(serverManager); } + + public M2mProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } private boolean firstPacket = true; private Long deviceId; @@ -75,7 +79,7 @@ public class M2mProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("m2m"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); // Date and time diff --git a/src/org/traccar/protocol/ManPowerProtocolDecoder.java b/src/org/traccar/protocol/ManPowerProtocolDecoder.java index d8bcdb937..57b47ce5e 100644 --- a/src/org/traccar/protocol/ManPowerProtocolDecoder.java +++ b/src/org/traccar/protocol/ManPowerProtocolDecoder.java @@ -33,6 +33,10 @@ public class ManPowerProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public ManPowerProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern pattern = Pattern.compile( "simei:" + "(\\d+)," + // IMEI @@ -64,7 +68,7 @@ public class ManPowerProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("manpower"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/MaxonProtocolDecoder.java b/src/org/traccar/protocol/MaxonProtocolDecoder.java index b6ba2fb4b..c1e9e4ec5 100644 --- a/src/org/traccar/protocol/MaxonProtocolDecoder.java +++ b/src/org/traccar/protocol/MaxonProtocolDecoder.java @@ -47,6 +47,10 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public MaxonProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + /** * Regular expressions pattern */ diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index 96b2d564d..a4e25510d 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -33,6 +33,10 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public MegastekProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern patternGPRMC = Pattern.compile( "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.\\d+," + // Time (HHMMSS.SSS) @@ -176,7 +180,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("megastek"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Parse location data if (!parseGPRMC(gprmc, position)) { diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 6221ce4e7..73b238443 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -38,6 +38,10 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public MeiligaoProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(\\d{2})(\\d{2})(\\d{2})\\.?(\\d+)?," + // Time (HHMMSS.SSS) "([AV])," + // Validity @@ -116,8 +120,8 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { private String getMeiligaoServer(Channel channel) { if (getServerManager() != null && - getServerManager().getProperties().containsKey("meiligao.server")) { - return getServerManager().getProperties().getProperty("meiligao.server"); + getServerManager().getProperties().containsKey(getProtocol() + ".server")) { + return getServerManager().getProperties().getProperty(getProtocol() + ".server"); } else { InetSocketAddress address = (InetSocketAddress) channel.getLocalAddress(); return address.getAddress().getHostAddress() + ":" + address.getPort(); @@ -160,7 +164,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("meiligao"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Custom data if (command == MSG_ALARM) { diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 166c77e60..972f69061 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -39,6 +39,10 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public MeitrackProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + //$$J163,123123123123123,AFF,0004,35,58.588926,16.180473,140928192856,A,10,27,0,161,1.2,19 //,1648894,435695,240|24|88B9|E435,0000,|||0A22|0000,00000001,,50,,,,,,,,,,,,,*70\r\n private static final Pattern pattern = Pattern.compile( @@ -81,7 +85,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("meitrack"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; @@ -182,7 +186,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { while (buf.readableBytes() >= 0x34) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("meitrack"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); // Event diff --git a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java index 2d524a23a..96057f347 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java @@ -35,6 +35,10 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public MiniFinderProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\!D," + "(\\d+)/(\\d+)/(\\d+)," + // Date @@ -78,7 +82,7 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("minifinder"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index 62fa87e68..0908a5793 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -41,8 +41,12 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { private boolean simple; - public Mta6ProtocolDecoder(ServerManager serverManager, boolean simple) { + public Mta6ProtocolDecoder(ServerManager serverManager) { super(serverManager); + } + + public Mta6ProtocolDecoder(ServerManager serverManager, String protocol, boolean simple) { + super(serverManager, protocol); this.simple = simple; } @@ -129,7 +133,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { while (buf.readable()) { Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("mta6"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); short flags = buf.readUnsignedByte(); @@ -211,7 +215,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { private Position parseFormatA1(ChannelBuffer buf, long deviceId) { Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("mta6"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); short flags = buf.readUnsignedByte(); diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index 29be1e5ad..938426297 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -33,6 +33,10 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { public NavigilProtocolDecoder(ServerManager serverManager) { super(serverManager); } + + public NavigilProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } private static final int LEAP_SECONDS_DELTA = 25; @@ -80,7 +84,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { private Position parseUnitReport(ChannelBuffer buf, long deviceId, int sequenceNumber) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setValid(true); extendedInfo.set("index", sequenceNumber); @@ -117,7 +121,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { private Position parseTg2Report(ChannelBuffer buf, long deviceId, int sequenceNumber) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setValid(true); extendedInfo.set("index", sequenceNumber); @@ -156,7 +160,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { private Position parsePositionReport(ChannelBuffer buf, long deviceId, int sequenceNumber, long timestamp) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); @@ -180,7 +184,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { private Position parsePositionReport2(ChannelBuffer buf, long deviceId, int sequenceNumber, long timestamp) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); @@ -207,7 +211,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { private Position parseSnapshot4(ChannelBuffer buf, long deviceId, int sequenceNumber) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); @@ -248,7 +252,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { private Position parseTrackingData(ChannelBuffer buf, long deviceId, int sequenceNumber, long timestamp) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 1ee28e0aa..fe4b04543 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -45,6 +45,10 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public NavisProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + // Format types public static final int F10 = 0x01; public static final int F20 = 0x02; @@ -83,7 +87,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { private ParseResult parsePosition(ChannelBuffer buf) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navis"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(databaseDeviceId); position.setAltitude(0.0); diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index 4cb35fee5..207975aec 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -36,6 +36,10 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public NoranProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final int MSG_UPLOAD_POSITION = 0x0008; private static final int MSG_CONTROL_RESPONSE = 0x8009; private static final int MSG_ALARM = 0x0003; @@ -73,7 +77,7 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("noran"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); if (type == MSG_CONTROL_RESPONSE) { buf.readUnsignedInt(); // GIS ip diff --git a/src/org/traccar/protocol/OrionProtocolDecoder.java b/src/org/traccar/protocol/OrionProtocolDecoder.java index 1846bba23..ed0e7c169 100644 --- a/src/org/traccar/protocol/OrionProtocolDecoder.java +++ b/src/org/traccar/protocol/OrionProtocolDecoder.java @@ -34,6 +34,10 @@ public class OrionProtocolDecoder extends BaseProtocolDecoder { public OrionProtocolDecoder(ServerManager serverManager) { super(serverManager); } + + public OrionProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } private static final int TYPE_USERLOG = 0; private static final int TYPE_SYSLOG = 3; @@ -88,7 +92,7 @@ public class OrionProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("orion"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); extendedInfo.set("event", buf.readUnsignedByte()); buf.readUnsignedByte(); // length diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index e150275bd..7c76ea851 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -41,6 +41,10 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { public OsmAndProtocolDecoder(ServerManager serverManager) { super(serverManager); } + + public OsmAndProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } @Override protected Object decode( @@ -58,7 +62,7 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("osmand"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Identification String id = params.get(params.containsKey("id") ? "id" : "deviceid").get(0); diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index e0947b02a..db051c39f 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -43,6 +43,10 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public PiligrimProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private void sendResponse(Channel channel, String message) { if (channel != null) { HttpResponse response = new DefaultHttpResponse( @@ -104,7 +108,7 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { if (type == MSG_GPS || type == MSG_GPS_SENSORS) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("piligrim"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); // Time diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index 85680c039..492c5afd3 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -44,6 +44,10 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public ProgressProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + /* * Message types */ @@ -128,7 +132,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { for (int j = 0; j < recordCount; j++) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("progress"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); // Message index diff --git a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java index 50b5aca02..8767b0f7c 100644 --- a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Pt3000ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Pt3000ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern pattern = Pattern.compile( "\\%(\\d+)," + // IMEI "\\$GPRMC," + @@ -62,7 +66,7 @@ public class Pt3000ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("pt3000"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index b324e3c55..c555a3690 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -34,6 +34,10 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Pt502ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( ".*\\$POS," + // Data Frame start "(\\d+)," + // Id @@ -63,7 +67,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("pt502"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index aad68a37d..1c7a0500b 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -36,6 +36,10 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public RitiProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.?\\d*," + // Time (HHMMSS.SSS) @@ -58,7 +62,7 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("riti"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); buf.skipBytes(2); // header diff --git a/src/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/org/traccar/protocol/RuptelaProtocolDecoder.java index c9f8bd392..c5d678a06 100644 --- a/src/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -34,6 +34,10 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public RuptelaProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final int COMMAND_RECORDS = 0x01; @Override @@ -64,7 +68,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { for (int i = 0; i < count; i++) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("ruptela"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); // Time diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index e60209855..d09065355 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -33,6 +33,10 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public SanavProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( ".*imei[:=]" + "(\\d+)" + // IMEI @@ -62,7 +66,7 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("sanav"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Identification diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index 4c7829bf6..5ef8a09a4 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -33,6 +33,10 @@ public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public SkypatrolProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static boolean checkBit(long mask, int bit) { long checkMask = 1 << bit; return (mask & checkMask) == checkMask; @@ -76,7 +80,7 @@ public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("skypatrol"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Status code if (checkBit(mask, 1)) { diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java index 211483aed..77d7ed3bf 100644 --- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java +++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Stl060ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( ".*\\$1," + "(\\d+)," + // IMEI @@ -67,7 +71,7 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("stl060"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java index 124b4feaf..5b5f4f136 100644 --- a/src/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java @@ -33,6 +33,10 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public SuntechProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern pattern = Pattern.compile( "S.\\d{3}(?:\\w{3})?;" + // Header "(?:[^;]+;)?" + @@ -62,7 +66,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("suntech"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); int index = 1; // Identifier diff --git a/src/org/traccar/protocol/SyrusProtocolDecoder.java b/src/org/traccar/protocol/SyrusProtocolDecoder.java index 0d61daf82..fc307d09a 100644 --- a/src/org/traccar/protocol/SyrusProtocolDecoder.java +++ b/src/org/traccar/protocol/SyrusProtocolDecoder.java @@ -37,6 +37,11 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder { this.sendResponse = sendResponse; } + public SyrusProtocolDecoder(ServerManager serverManager, String protocol, boolean sendResponse) { + super(serverManager, protocol); + this.sendResponse = sendResponse; + } + private static final Pattern pattern = Pattern.compile( "R[EP]V" + // Type "(?:\\d{2}" + // Event index @@ -132,7 +137,7 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("syrus"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index da473d994..c3128bf97 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -35,6 +35,10 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public T55ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern patternGPRMC = Pattern.compile( "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.?\\d*," + // Time (HHMMSS.SSS) @@ -143,7 +147,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("t55"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; @@ -210,7 +214,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("t55"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; @@ -262,7 +266,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("t55"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; @@ -319,7 +323,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("t55"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/TelikProtocolDecoder.java b/src/org/traccar/protocol/TelikProtocolDecoder.java index d632cc478..0f5e3794b 100644 --- a/src/org/traccar/protocol/TelikProtocolDecoder.java +++ b/src/org/traccar/protocol/TelikProtocolDecoder.java @@ -33,6 +33,10 @@ public class TelikProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public TelikProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\d{4}" + "(\\d{6})" + // Device ID @@ -62,7 +66,7 @@ public class TelikProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("telik"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index 876a1e4ff..5f7ce1638 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -37,6 +37,10 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public TeltonikaProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private void parseIdentification(Channel channel, ChannelBuffer buf) { boolean result = false; @@ -81,7 +85,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { for (int i = 0; i < count; i++) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("teltonika"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java index e142d95b5..9b1157d50 100644 --- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java @@ -35,6 +35,10 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Tk102ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern pattern = Pattern.compile( "\\[.\\d{10}.\\(\\p{Upper}+" + "(\\d{2})(\\d{2})(\\d{2})" + // Time (HHMMSS) @@ -85,7 +89,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("tk102"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index d3220368a..2309012ab 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Tk103ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(\\d+)(,)?" + // Device ID ".{4},?" + // Command @@ -82,7 +86,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("tk103"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Get device by IMEI diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index e4e6cb300..0f5bc5275 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -35,6 +35,10 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Tlt2hProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern patternHeader = Pattern.compile( "#(\\d+)#" + // IMEI "[^#]+#" + @@ -91,7 +95,7 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { parser = patternPosition.matcher(message); if (parser.matches()) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("tlt2h"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/TopflytechProtocolDecoder.java b/src/org/traccar/protocol/TopflytechProtocolDecoder.java index 58448f881..112b1e183 100644 --- a/src/org/traccar/protocol/TopflytechProtocolDecoder.java +++ b/src/org/traccar/protocol/TopflytechProtocolDecoder.java @@ -35,6 +35,10 @@ public class TopflytechProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public TopflytechProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern pattern = Pattern.compile( "\\(" + "(\\d+)" + // IMEI @@ -64,7 +68,7 @@ public class TopflytechProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("topflytech"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Identifier diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 466929777..180289b20 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -33,6 +33,10 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public TotemProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern patternFirst = Pattern.compile( "\\$\\$" + // Header "\\p{XDigit}{2}" + // Length @@ -159,7 +163,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("totem"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java index de21f4420..4d17b45fe 100644 --- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Tr20ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern patternPing = Pattern.compile( "\\%\\%[^,]+,(\\d+)"); @@ -77,7 +81,7 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("tr20"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/TrackboxProtocolDecoder.java b/src/org/traccar/protocol/TrackboxProtocolDecoder.java index 865d81e30..8f495cca8 100644 --- a/src/org/traccar/protocol/TrackboxProtocolDecoder.java +++ b/src/org/traccar/protocol/TrackboxProtocolDecoder.java @@ -35,6 +35,10 @@ public class TrackboxProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public TrackboxProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(\\d{2})(\\d{2})(\\d{2})\\.(\\d{3})," + // Time "(\\d{2})(\\d{2}\\.\\d{4})([NS])," + // Latitude (DDMM.MMMM) @@ -82,7 +86,7 @@ public class TrackboxProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); position.setDeviceId(deviceId); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("trackbox"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 25c943e57..6c8673775 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -35,6 +35,10 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public V680ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(?:#(\\d+)#" + // IMEI "([^#]*)#)?" + // User @@ -80,7 +84,7 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("v680"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; // Get device by IMEI diff --git a/src/org/traccar/protocol/VisiontekProtocolDecoder.java b/src/org/traccar/protocol/VisiontekProtocolDecoder.java index 4ca97be67..70f1ae194 100644 --- a/src/org/traccar/protocol/VisiontekProtocolDecoder.java +++ b/src/org/traccar/protocol/VisiontekProtocolDecoder.java @@ -33,6 +33,10 @@ public class VisiontekProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public VisiontekProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\$1," + "([^,]+)," + // Identifier @@ -71,7 +75,7 @@ public class VisiontekProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("visiontek"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index 93e32ced0..1f14886c4 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -37,6 +37,10 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public WialonProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "(\\d{2})(\\d{2})(\\d{2});" + // Date (DDMMYY) "(\\d{2})(\\d{2})(\\d{2});" + // Time (HHMMSS) @@ -71,7 +75,7 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("wialon"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(deviceId); Integer index = 1; diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java index a9c4ea4c1..6d404a57d 100644 --- a/src/org/traccar/protocol/WondexProtocolDecoder.java +++ b/src/org/traccar/protocol/WondexProtocolDecoder.java @@ -33,6 +33,10 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public WondexProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "[^\\d]*" + // Header "(\\d+)," + // Device Identifier @@ -65,7 +69,7 @@ public class WondexProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("wondex"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); int index = 1; // Device identifier diff --git a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java index d974ce227..bccd8a8cf 100644 --- a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java @@ -33,6 +33,10 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Xexun2ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + static private Pattern pattern = Pattern.compile( "[\r\n]*" + "(\\d+)," + // Serial @@ -72,7 +76,7 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("xexun2"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 7a0d71e64..16573dd7c 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -34,6 +34,10 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public XexunProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "GPRMC," + "(\\d{2})(\\d{2})(\\d{2}).(\\d+)," + // Time (HHMMSS.SSS) @@ -62,7 +66,7 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("xexun"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; diff --git a/src/org/traccar/protocol/Xt7ProtocolDecoder.java b/src/org/traccar/protocol/Xt7ProtocolDecoder.java index a30977263..2ee0e6b0f 100644 --- a/src/org/traccar/protocol/Xt7ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt7ProtocolDecoder.java @@ -35,6 +35,10 @@ public class Xt7ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public Xt7ProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.(\\d+)," + // Time (HHMMSS.SSS) @@ -67,7 +71,7 @@ public class Xt7ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("xt7"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); // Get device by id String id = buf.readBytes(16).toString(Charset.defaultCharset()).trim(); diff --git a/src/org/traccar/protocol/YwtProtocolDecoder.java b/src/org/traccar/protocol/YwtProtocolDecoder.java index 2b189ea7c..01cfbc8dc 100644 --- a/src/org/traccar/protocol/YwtProtocolDecoder.java +++ b/src/org/traccar/protocol/YwtProtocolDecoder.java @@ -33,6 +33,10 @@ public class YwtProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } + public YwtProtocolDecoder(ServerManager serverManager, String protocol) { + super(serverManager, protocol); + } + private static final Pattern pattern = Pattern.compile( "%(..)," + // Type "(\\d+):" + // Unit identifier @@ -81,7 +85,7 @@ public class YwtProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("ywt"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); Integer index = 1; String type = parser.group(index++); -- cgit v1.2.3 From f0790eba6f3194daf4677c27e8259f783aae3207 Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Fri, 10 Oct 2014 22:25:02 -0400 Subject: Made BaseProtocolDecoder members "final" as they should not change after construction. --- src/org/traccar/BaseProtocolDecoder.java | 34 +++++++--------------- src/org/traccar/protocol/ApelProtocolDecoder.java | 5 ++-- .../traccar/protocol/AplicomProtocolDecoder.java | 5 ++-- .../traccar/protocol/AtrackProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/BoxProtocolDecoder.java | 5 ++-- .../traccar/protocol/CarTrackProtocolDecoder.java | 5 ++-- .../traccar/protocol/CarscopProtocolDecoder.java | 5 ++-- .../protocol/CellocatorProtocolDecoder.java | 5 ++-- .../traccar/protocol/EasyTrackProtocolDecoder.java | 5 ++-- .../traccar/protocol/EelinkProtocolDecoder.java | 5 ++-- .../traccar/protocol/EnforaProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Ev603ProtocolDecoder.java | 5 ++-- .../traccar/protocol/FreedomProtocolDecoder.java | 5 ++-- .../traccar/protocol/GalileoProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/GatorProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Gl100ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 5 ++-- .../traccar/protocol/GlobalSatProtocolDecoder.java | 29 ++++-------------- src/org/traccar/protocol/GotopProtocolDecoder.java | 5 ++-- .../traccar/protocol/Gps103ProtocolDecoder.java | 5 ++-- .../traccar/protocol/GpsGateProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Gt02ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/H02ProtocolDecoder.java | 5 ++-- .../traccar/protocol/HaicomProtocolDecoder.java | 5 ++-- .../protocol/IntellitracProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/KhdProtocolDecoder.java | 5 ++-- .../traccar/protocol/LaipacProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/M2mProtocolDecoder.java | 5 ++-- .../traccar/protocol/ManPowerProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/MaxonProtocolDecoder.java | 5 ++-- .../traccar/protocol/MegastekProtocolDecoder.java | 5 ++-- .../traccar/protocol/MeiligaoProtocolDecoder.java | 5 ++-- .../traccar/protocol/MeitrackProtocolDecoder.java | 5 ++-- .../protocol/MiniFinderProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Mta6ProtocolDecoder.java | 5 ++-- .../traccar/protocol/NavigilProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/NavisProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/NoranProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/OrionProtocolDecoder.java | 5 ++-- .../traccar/protocol/OsmAndProtocolDecoder.java | 5 ++-- .../traccar/protocol/PiligrimProtocolDecoder.java | 5 ++-- .../traccar/protocol/ProgressProtocolDecoder.java | 5 ++-- .../traccar/protocol/Pt3000ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Pt502ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/RitiProtocolDecoder.java | 5 ++-- .../traccar/protocol/RuptelaProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/SanavProtocolDecoder.java | 5 ++-- .../traccar/protocol/SkypatrolProtocolDecoder.java | 5 ++-- .../traccar/protocol/Stl060ProtocolDecoder.java | 5 ++-- .../traccar/protocol/SuntechProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/SyrusProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/T55ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/TelikProtocolDecoder.java | 5 ++-- .../traccar/protocol/TeltonikaProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Tk102ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Tlt2hProtocolDecoder.java | 5 ++-- .../protocol/TopflytechProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/TotemProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Tr20ProtocolDecoder.java | 5 ++-- .../traccar/protocol/TrackboxProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/V680ProtocolDecoder.java | 5 ++-- .../traccar/protocol/VisiontekProtocolDecoder.java | 5 ++-- .../traccar/protocol/WialonProtocolDecoder.java | 5 ++-- .../traccar/protocol/WondexProtocolDecoder.java | 5 ++-- .../traccar/protocol/Xexun2ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/XexunProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/Xt7ProtocolDecoder.java | 5 ++-- src/org/traccar/protocol/YwtProtocolDecoder.java | 5 ++-- .../traccar/protocol/ApelProtocolDecoderTest.java | 3 +- .../protocol/AplicomProtocolDecoderTest.java | 3 +- .../protocol/AtrackProtocolDecoderTest.java | 3 +- .../traccar/protocol/BoxProtocolDecoderTest.java | 3 +- .../protocol/CarTrackProtocolDecoderTest.java | 3 +- .../protocol/CarscopProtocolDecoderTest.java | 3 +- .../protocol/CellocatorProtocolDecoderTest.java | 3 +- .../protocol/EasyTrackProtocolDecoderTest.java | 3 +- .../protocol/EelinkProtocolDecoderTest.java | 3 +- .../protocol/EnforaProtocolDecoderTest.java | 3 +- .../traccar/protocol/Ev603ProtocolDecoderTest.java | 3 +- .../protocol/FreedomProtocolDecoderTest.java | 3 +- .../protocol/GalileoProtocolDecoderTest.java | 3 +- .../traccar/protocol/GatorProtocolDecoderTest.java | 3 +- .../traccar/protocol/Gl100ProtocolDecoderTest.java | 3 +- .../traccar/protocol/Gl200ProtocolDecoderTest.java | 3 +- .../protocol/GlobalSatProtocolDecoderTest.java | 3 +- .../traccar/protocol/GotopProtocolDecoderTest.java | 3 +- .../protocol/Gps103ProtocolDecoderTest.java | 3 +- .../protocol/GpsGateProtocolDecoderTest.java | 3 +- .../traccar/protocol/Gt02ProtocolDecoderTest.java | 3 +- .../traccar/protocol/Gt06ProtocolDecoderTest.java | 3 +- .../traccar/protocol/H02ProtocolDecoderTest.java | 3 +- .../protocol/HaicomProtocolDecoderTest.java | 3 +- .../protocol/IntellitracProtocolDecoderTest.java | 3 +- .../traccar/protocol/Jt600ProtocolDecoderTest.java | 3 +- .../traccar/protocol/KhdProtocolDecoderTest.java | 3 +- .../protocol/LaipacProtocolDecoderTest.java | 3 +- .../traccar/protocol/M2mProtocolDecoderTest.java | 3 +- .../protocol/ManPowerProtocolDecoderTest.java | 3 +- .../protocol/MegastekProtocolDecoderTest.java | 3 +- .../protocol/MeiligaoProtocolDecoderTest.java | 3 +- .../protocol/MeitrackProtocolDecoderTest.java | 3 +- .../protocol/MiniFinderProtocolDecoderTest.java | 3 +- .../protocol/NavigilProtocolDecoderTest.java | 3 +- .../traccar/protocol/NavisProtocolDecoderTest.java | 3 +- .../traccar/protocol/NoranProtocolDecoderTest.java | 3 +- .../traccar/protocol/OrionProtocolDecoderTest.java | 3 +- .../protocol/OsmAndProtocolDecoderTest.java | 3 +- .../protocol/PiligrimProtocolDecoderTest.java | 3 +- .../protocol/Pt3000ProtocolDecoderTest.java | 3 +- .../traccar/protocol/Pt502ProtocolDecoderTest.java | 3 +- .../traccar/protocol/RitiProtocolDecoderTest.java | 3 +- .../protocol/RuptelaProtocolDecoderTest.java | 3 +- .../traccar/protocol/SanavProtocolDecoderTest.java | 3 +- .../protocol/SkypatrolProtocolDecoderTest.java | 3 +- .../protocol/Stl060ProtocolDecoderTest.java | 3 +- .../protocol/SuntechProtocolDecoderTest.java | 3 +- .../traccar/protocol/SyrusProtocolDecoderTest.java | 3 +- .../traccar/protocol/T55ProtocolDecoderTest.java | 3 +- .../traccar/protocol/TelikProtocolDecoderTest.java | 3 +- .../protocol/TeltonikaProtocolDecoderTest.java | 3 +- .../traccar/protocol/Tk102ProtocolDecoderTest.java | 3 +- .../traccar/protocol/Tk103ProtocolDecoderTest.java | 3 +- .../traccar/protocol/Tlt2hProtocolDecoderTest.java | 3 +- .../protocol/TopflytechProtocolDecoderTest.java | 3 +- .../traccar/protocol/TotemProtocolDecoderTest.java | 3 +- .../traccar/protocol/Tr20ProtocolDecoderTest.java | 3 +- .../protocol/TrackboxProtocolDecoderTest.java | 3 +- .../traccar/protocol/V680ProtocolDecoderTest.java | 3 +- .../protocol/VisiontekProtocolDecoderTest.java | 3 +- .../protocol/WialonProtocolDecoderTest.java | 3 +- .../protocol/WondexProtocolDecoderTest.java | 3 +- .../protocol/Xexun2ProtocolDecoderTest.java | 3 +- .../traccar/protocol/XexunProtocolDecoderTest.java | 3 +- .../traccar/protocol/Xt7ProtocolDecoderTest.java | 3 +- .../traccar/protocol/YwtProtocolDecoderTest.java | 3 +- 138 files changed, 290 insertions(+), 319 deletions(-) diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 3976ba9e8..e4a3448f1 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -29,22 +29,14 @@ import org.traccar.database.DataManager; */ public abstract class BaseProtocolDecoder extends OneToOneDecoder { - private ServerManager serverManager; - private DataManager dataManager; + private final ServerManager serverManager; + private final DataManager dataManager; private final String protocol; - public final void setDataManager(DataManager dataManager) { - this.dataManager = dataManager; - } - public final DataManager getDataManager() { return dataManager; } - public final void setServerManager(ServerManager serverManager) { - this.serverManager = serverManager; - } - public final ServerManager getServerManager() { return serverManager; } @@ -53,21 +45,17 @@ public abstract class BaseProtocolDecoder extends OneToOneDecoder { return protocol; } - public BaseProtocolDecoder() { - protocol = null; - } - - public BaseProtocolDecoder(ServerManager serverManager) { - // Only used by test classes now - assert (serverManager == null) : - "BaseProtocolDecoder() initialized with non-NULL serverManager"; - - if (serverManager != null) { - this.serverManager = serverManager; - dataManager = serverManager.getDataManager(); - } + public BaseProtocolDecoder(DataManager dataManager) { + // This constructor must only be used by test classes. + // There should be a way to check this at compile time. + + assert (dataManager != null) : + "BaseProtocolDecoder() initialized with NULL dataManager"; + serverManager = null; protocol = null; + + this.dataManager = dataManager; } public BaseProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java index 954006807..cad891d4b 100644 --- a/src/org/traccar/protocol/ApelProtocolDecoder.java +++ b/src/org/traccar/protocol/ApelProtocolDecoder.java @@ -27,6 +27,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -38,8 +39,8 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { private long lastIndex; private long newIndex; - public ApelProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public ApelProtocolDecoder(DataManager dataManager) { + super(dataManager); } public ApelProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index 468e4a5fc..607bc7869 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -21,14 +21,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class AplicomProtocolDecoder extends BaseProtocolDecoder { - public AplicomProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public AplicomProtocolDecoder(DataManager dataManager) { + super(dataManager); } public AplicomProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index 7edafa057..02d970f91 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -25,14 +25,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class AtrackProtocolDecoder extends BaseProtocolDecoder { - public AtrackProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public AtrackProtocolDecoder(DataManager dataManager) { + super(dataManager); } public AtrackProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/BoxProtocolDecoder.java b/src/org/traccar/protocol/BoxProtocolDecoder.java index 4184ee0e2..68989d71f 100644 --- a/src/org/traccar/protocol/BoxProtocolDecoder.java +++ b/src/org/traccar/protocol/BoxProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class BoxProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public BoxProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public BoxProtocolDecoder(DataManager dataManager) { + super(dataManager); } public BoxProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java index aa02ba044..8b55c71e9 100644 --- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java @@ -24,14 +24,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class CarTrackProtocolDecoder extends BaseProtocolDecoder { - public CarTrackProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public CarTrackProtocolDecoder(DataManager dataManager) { + super(dataManager); } public CarTrackProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/CarscopProtocolDecoder.java b/src/org/traccar/protocol/CarscopProtocolDecoder.java index 6683a463f..dfc9b6fc2 100644 --- a/src/org/traccar/protocol/CarscopProtocolDecoder.java +++ b/src/org/traccar/protocol/CarscopProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class CarscopProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public CarscopProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public CarscopProtocolDecoder(DataManager dataManager) { + super(dataManager); } public CarscopProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index 8cce47bd5..feb7d2731 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -24,14 +24,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class CellocatorProtocolDecoder extends BaseProtocolDecoder { - public CellocatorProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public CellocatorProtocolDecoder(DataManager dataManager) { + super(dataManager); } public CellocatorProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index 87a0135eb..33ff9991c 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { - public EasyTrackProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public EasyTrackProtocolDecoder(DataManager dataManager) { + super(dataManager); } public EasyTrackProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 97c2821b5..e57540a35 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -24,6 +24,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -32,8 +33,8 @@ import org.traccar.model.Position; public class EelinkProtocolDecoder extends BaseProtocolDecoder { - public EelinkProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public EelinkProtocolDecoder(DataManager dataManager) { + super(dataManager); } public EelinkProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/EnforaProtocolDecoder.java b/src/org/traccar/protocol/EnforaProtocolDecoder.java index 0509b0c6d..980f98c49 100644 --- a/src/org/traccar/protocol/EnforaProtocolDecoder.java +++ b/src/org/traccar/protocol/EnforaProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,8 +33,8 @@ import org.traccar.model.Position; public class EnforaProtocolDecoder extends BaseProtocolDecoder { - public EnforaProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public EnforaProtocolDecoder(DataManager dataManager) { + super(dataManager); } public EnforaProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java index c73067b0c..43f4f23e5 100644 --- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java @@ -24,6 +24,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -32,8 +33,8 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ private Long deviceId; - public Ev603ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Ev603ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Ev603ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/FreedomProtocolDecoder.java b/src/org/traccar/protocol/FreedomProtocolDecoder.java index 0acff7f22..7fa3e3f5c 100644 --- a/src/org/traccar/protocol/FreedomProtocolDecoder.java +++ b/src/org/traccar/protocol/FreedomProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class FreedomProtocolDecoder extends BaseProtocolDecoder { - public FreedomProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public FreedomProtocolDecoder(DataManager dataManager) { + super(dataManager); } public FreedomProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java index cb29a0920..b5aeb6ae3 100644 --- a/src/org/traccar/protocol/GalileoProtocolDecoder.java +++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java @@ -30,14 +30,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class GalileoProtocolDecoder extends BaseProtocolDecoder { - public GalileoProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public GalileoProtocolDecoder(DataManager dataManager) { + super(dataManager); } public GalileoProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 7f93082fd..9ca7a07a1 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -22,6 +22,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -29,8 +30,8 @@ import org.traccar.model.Position; public class GatorProtocolDecoder extends BaseProtocolDecoder { - public GatorProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public GatorProtocolDecoder(DataManager dataManager) { + super(dataManager); } public GatorProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Gl100ProtocolDecoder.java b/src/org/traccar/protocol/Gl100ProtocolDecoder.java index 0dac5d2b3..329a005b5 100644 --- a/src/org/traccar/protocol/Gl100ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl100ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Gl100ProtocolDecoder extends BaseProtocolDecoder { - public Gl100ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Gl100ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Gl100ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 83fd42b74..8cccc7fae 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Gl200ProtocolDecoder extends BaseProtocolDecoder { - public Gl200ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Gl200ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Gl200ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index bd56fde1f..de49d0b85 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -24,42 +24,23 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { - private String format0; - private String format1; + private String format0 = "TSPRXAB27GHKLMnaicz*U!"; + private String format1 = "SARY*U!"; - public GlobalSatProtocolDecoder(ServerManager serverManager) { - super(serverManager); - - // This is now only called by test classes. - // This will be deleted in the next commit. - assert (serverManager == null); - - // Initialize format strings - format0 = "TSPRXAB27GHKLMnaicz*U!"; - format1 = "SARY*U!"; - if (getServerManager() != null) { - Properties p = getServerManager().getProperties(); - if (p.containsKey("globalsat.format0")) { - format0 = p.getProperty("globalsat.format0"); - } - if (p.containsKey("globalsat.format1")) { - format1 = p.getProperty("globalsat.format1"); - } - } + public GlobalSatProtocolDecoder(DataManager dataManager) { + super(dataManager); } public GlobalSatProtocolDecoder(ServerManager serverManager, String protocol) { super(serverManager, protocol); - // Initialize format strings - format0 = "TSPRXAB27GHKLMnaicz*U!"; - format1 = "SARY*U!"; if (getServerManager() != null) { Properties p = getServerManager().getProperties(); if (p.containsKey(protocol + ".format0")) { diff --git a/src/org/traccar/protocol/GotopProtocolDecoder.java b/src/org/traccar/protocol/GotopProtocolDecoder.java index 70d0063a1..48ec0174d 100644 --- a/src/org/traccar/protocol/GotopProtocolDecoder.java +++ b/src/org/traccar/protocol/GotopProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class GotopProtocolDecoder extends BaseProtocolDecoder { - public GotopProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public GotopProtocolDecoder(DataManager dataManager) { + super(dataManager); } public GotopProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index ca578841a..41072c4ee 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -24,14 +24,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Gps103ProtocolDecoder extends BaseProtocolDecoder { - public Gps103ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Gps103ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Gps103ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java index bc8c759c3..1bac7fe8a 100644 --- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,8 +33,8 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public GpsGateProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public GpsGateProtocolDecoder(DataManager dataManager) { + super(dataManager); } public GpsGateProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java index 8e351f456..5c113c248 100644 --- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Gt02ProtocolDecoder extends BaseProtocolDecoder { - public Gt02ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Gt02ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Gt02ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index f1e8585e5..10fa20f65 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -24,6 +24,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -34,8 +35,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; private final TimeZone timeZone = TimeZone.getTimeZone("UTC"); - public Gt06ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Gt06ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Gt06ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index f7843e2c8..bf8c4e054 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,8 +33,8 @@ import org.traccar.model.Position; public class H02ProtocolDecoder extends BaseProtocolDecoder { - public H02ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public H02ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public H02ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index 199093492..ba179ad33 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class HaicomProtocolDecoder extends BaseProtocolDecoder { - public HaicomProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public HaicomProtocolDecoder(DataManager dataManager) { + super(dataManager); } public HaicomProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java index fe093a033..7d79cf8a2 100644 --- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java +++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class IntellitracProtocolDecoder extends BaseProtocolDecoder { - public IntellitracProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public IntellitracProtocolDecoder(DataManager dataManager) { + super(dataManager); } public IntellitracProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 7f67daafe..bbf5aa43d 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,8 +33,8 @@ import org.traccar.model.Position; public class Jt600ProtocolDecoder extends BaseProtocolDecoder { - public Jt600ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Jt600ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Jt600ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java index e8716ffd0..eb359ce54 100644 --- a/src/org/traccar/protocol/KhdProtocolDecoder.java +++ b/src/org/traccar/protocol/KhdProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -31,8 +32,8 @@ import org.traccar.model.Position; public class KhdProtocolDecoder extends BaseProtocolDecoder { - public KhdProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public KhdProtocolDecoder(DataManager dataManager) { + super(dataManager); } public KhdProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index cba86f7b4..3b30ea672 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,8 +31,8 @@ import org.traccar.model.Position; public class LaipacProtocolDecoder extends BaseProtocolDecoder { - public LaipacProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public LaipacProtocolDecoder(DataManager dataManager) { + super(dataManager); } public LaipacProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/M2mProtocolDecoder.java b/src/org/traccar/protocol/M2mProtocolDecoder.java index 2a0c8ebaf..a3ae072bb 100644 --- a/src/org/traccar/protocol/M2mProtocolDecoder.java +++ b/src/org/traccar/protocol/M2mProtocolDecoder.java @@ -22,14 +22,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class M2mProtocolDecoder extends BaseProtocolDecoder { - public M2mProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public M2mProtocolDecoder(DataManager dataManager) { + super(dataManager); } public M2mProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/ManPowerProtocolDecoder.java b/src/org/traccar/protocol/ManPowerProtocolDecoder.java index 57b47ce5e..ed177a334 100644 --- a/src/org/traccar/protocol/ManPowerProtocolDecoder.java +++ b/src/org/traccar/protocol/ManPowerProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class ManPowerProtocolDecoder extends BaseProtocolDecoder { - public ManPowerProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public ManPowerProtocolDecoder(DataManager dataManager) { + super(dataManager); } public ManPowerProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/MaxonProtocolDecoder.java b/src/org/traccar/protocol/MaxonProtocolDecoder.java index c1e9e4ec5..b85144fea 100644 --- a/src/org/traccar/protocol/MaxonProtocolDecoder.java +++ b/src/org/traccar/protocol/MaxonProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.Position; @@ -43,8 +44,8 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder { /** * Initialize */ - public MaxonProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public MaxonProtocolDecoder(DataManager dataManager) { + super(dataManager); } public MaxonProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index a4e25510d..3ad3f9494 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class MegastekProtocolDecoder extends BaseProtocolDecoder { - public MegastekProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public MegastekProtocolDecoder(DataManager dataManager) { + super(dataManager); } public MegastekProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 73b238443..2d56f6f0f 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -27,6 +27,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -34,8 +35,8 @@ import org.traccar.model.Position; public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { - public MeiligaoProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public MeiligaoProtocolDecoder(DataManager dataManager) { + super(dataManager); } public MeiligaoProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 972f69061..25190aef7 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -28,6 +28,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -35,8 +36,8 @@ import org.traccar.model.Position; public class MeitrackProtocolDecoder extends BaseProtocolDecoder { - public MeitrackProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public MeitrackProtocolDecoder(DataManager dataManager) { + super(dataManager); } public MeitrackProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java index 96057f347..6963e13d2 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public MiniFinderProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public MiniFinderProtocolDecoder(DataManager dataManager) { + super(dataManager); } public MiniFinderProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index 0908a5793..b8e1a3db1 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -32,6 +32,7 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus; import org.jboss.netty.handler.codec.http.HttpVersion; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -41,8 +42,8 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { private boolean simple; - public Mta6ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Mta6ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Mta6ProtocolDecoder(ServerManager serverManager, String protocol, boolean simple) { diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index 938426297..f34293480 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,8 +31,8 @@ import org.traccar.model.Position; public class NavigilProtocolDecoder extends BaseProtocolDecoder { - public NavigilProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public NavigilProtocolDecoder(DataManager dataManager) { + super(dataManager); } public NavigilProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index fe4b04543..e2471b23b 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -27,6 +27,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -41,8 +42,8 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { private String imei; private Long databaseDeviceId; - public NavisProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public NavisProtocolDecoder(DataManager dataManager) { + super(dataManager); } public NavisProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index 207975aec..5248eb266 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -26,14 +26,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class NoranProtocolDecoder extends BaseProtocolDecoder { - public NoranProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public NoranProtocolDecoder(DataManager dataManager) { + super(dataManager); } public NoranProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/OrionProtocolDecoder.java b/src/org/traccar/protocol/OrionProtocolDecoder.java index ed0e7c169..af5b4b706 100644 --- a/src/org/traccar/protocol/OrionProtocolDecoder.java +++ b/src/org/traccar/protocol/OrionProtocolDecoder.java @@ -25,14 +25,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class OrionProtocolDecoder extends BaseProtocolDecoder { - public OrionProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public OrionProtocolDecoder(DataManager dataManager) { + super(dataManager); } public OrionProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index 7c76ea851..6f54dc223 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -32,14 +32,15 @@ import org.jboss.netty.handler.codec.http.HttpVersion; import org.jboss.netty.handler.codec.http.QueryStringDecoder; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class OsmAndProtocolDecoder extends BaseProtocolDecoder { - public OsmAndProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public OsmAndProtocolDecoder(DataManager dataManager) { + super(dataManager); } public OsmAndProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index db051c39f..5336102a9 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -33,14 +33,15 @@ import org.jboss.netty.handler.codec.http.HttpVersion; import org.jboss.netty.handler.codec.http.QueryStringDecoder; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class PiligrimProtocolDecoder extends BaseProtocolDecoder { - public PiligrimProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public PiligrimProtocolDecoder(DataManager dataManager) { + super(dataManager); } public PiligrimProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index 492c5afd3..89431b8f9 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -27,6 +27,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -40,8 +41,8 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { private long lastIndex; private long newIndex; - public ProgressProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public ProgressProtocolDecoder(DataManager dataManager) { + super(dataManager); } public ProgressProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java index 8767b0f7c..0b750e97a 100644 --- a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Pt3000ProtocolDecoder extends BaseProtocolDecoder { - public Pt3000ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Pt3000ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Pt3000ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index c555a3690..e0f16033e 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -24,14 +24,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Pt502ProtocolDecoder extends BaseProtocolDecoder { - public Pt502ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Pt502ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Pt502ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index 1c7a0500b..a6d549e7c 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,8 +33,8 @@ import org.traccar.model.Position; public class RitiProtocolDecoder extends BaseProtocolDecoder { - public RitiProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public RitiProtocolDecoder(DataManager dataManager) { + super(dataManager); } public RitiProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/org/traccar/protocol/RuptelaProtocolDecoder.java index c5d678a06..a958e8baa 100644 --- a/src/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -24,14 +24,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class RuptelaProtocolDecoder extends BaseProtocolDecoder { - public RuptelaProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public RuptelaProtocolDecoder(DataManager dataManager) { + super(dataManager); } public RuptelaProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index d09065355..05d48dfde 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class SanavProtocolDecoder extends BaseProtocolDecoder { - public SanavProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public SanavProtocolDecoder(DataManager dataManager) { + super(dataManager); } public SanavProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index 5ef8a09a4..bec126e85 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { - public SkypatrolProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public SkypatrolProtocolDecoder(DataManager dataManager) { + super(dataManager); } public SkypatrolProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java index 77d7ed3bf..c07ac8e92 100644 --- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java +++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Stl060ProtocolDecoder extends BaseProtocolDecoder { - public Stl060ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Stl060ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Stl060ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java index 5b5f4f136..8e8b7d210 100644 --- a/src/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class SuntechProtocolDecoder extends BaseProtocolDecoder { - public SuntechProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public SuntechProtocolDecoder(DataManager dataManager) { + super(dataManager); } public SuntechProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/SyrusProtocolDecoder.java b/src/org/traccar/protocol/SyrusProtocolDecoder.java index fc307d09a..989544aba 100644 --- a/src/org/traccar/protocol/SyrusProtocolDecoder.java +++ b/src/org/traccar/protocol/SyrusProtocolDecoder.java @@ -24,6 +24,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -32,8 +33,8 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder { boolean sendResponse; - public SyrusProtocolDecoder(ServerManager serverManager, boolean sendResponse) { - super(serverManager); + public SyrusProtocolDecoder(DataManager dataManager, boolean sendResponse) { + super(dataManager); this.sendResponse = sendResponse; } diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index c3128bf97..a687fb07a 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public T55ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public T55ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public T55ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/TelikProtocolDecoder.java b/src/org/traccar/protocol/TelikProtocolDecoder.java index 0f5e3794b..76cc9adbb 100644 --- a/src/org/traccar/protocol/TelikProtocolDecoder.java +++ b/src/org/traccar/protocol/TelikProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class TelikProtocolDecoder extends BaseProtocolDecoder { - public TelikProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public TelikProtocolDecoder(DataManager dataManager) { + super(dataManager); } public TelikProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index 5f7ce1638..bf7423ad9 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -33,8 +34,8 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { private long deviceId; - public TeltonikaProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public TeltonikaProtocolDecoder(DataManager dataManager) { + super(dataManager); } public TeltonikaProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java index 9b1157d50..0bdd3ec0e 100644 --- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public Tk102ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Tk102ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Tk102ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index 2309012ab..6b4cd864c 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Tk103ProtocolDecoder extends BaseProtocolDecoder { - public Tk103ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Tk103ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Tk103ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index 0f5bc5275..49093e1ec 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -25,14 +25,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { - public Tlt2hProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Tlt2hProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Tlt2hProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/TopflytechProtocolDecoder.java b/src/org/traccar/protocol/TopflytechProtocolDecoder.java index 112b1e183..cbdb309de 100644 --- a/src/org/traccar/protocol/TopflytechProtocolDecoder.java +++ b/src/org/traccar/protocol/TopflytechProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class TopflytechProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public TopflytechProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public TopflytechProtocolDecoder(DataManager dataManager) { + super(dataManager); } public TopflytechProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 180289b20..4cdf24f51 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class TotemProtocolDecoder extends BaseProtocolDecoder { - public TotemProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public TotemProtocolDecoder(DataManager dataManager) { + super(dataManager); } public TotemProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java index 4d17b45fe..fe047dba0 100644 --- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Tr20ProtocolDecoder extends BaseProtocolDecoder { - public Tr20ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Tr20ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Tr20ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/TrackboxProtocolDecoder.java b/src/org/traccar/protocol/TrackboxProtocolDecoder.java index 8f495cca8..d53ee81ce 100644 --- a/src/org/traccar/protocol/TrackboxProtocolDecoder.java +++ b/src/org/traccar/protocol/TrackboxProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class TrackboxProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public TrackboxProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public TrackboxProtocolDecoder(DataManager dataManager) { + super(dataManager); } public TrackboxProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 6c8673775..d07804793 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -31,8 +32,8 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public V680ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public V680ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public V680ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/VisiontekProtocolDecoder.java b/src/org/traccar/protocol/VisiontekProtocolDecoder.java index 70f1ae194..baa2d470b 100644 --- a/src/org/traccar/protocol/VisiontekProtocolDecoder.java +++ b/src/org/traccar/protocol/VisiontekProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class VisiontekProtocolDecoder extends BaseProtocolDecoder { - public VisiontekProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public VisiontekProtocolDecoder(DataManager dataManager) { + super(dataManager); } public VisiontekProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index 1f14886c4..e4047adc5 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; @@ -33,8 +34,8 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public WialonProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public WialonProtocolDecoder(DataManager dataManager) { + super(dataManager); } public WialonProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java index 6d404a57d..e3dc9329e 100644 --- a/src/org/traccar/protocol/WondexProtocolDecoder.java +++ b/src/org/traccar/protocol/WondexProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class WondexProtocolDecoder extends BaseProtocolDecoder { - public WondexProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public WondexProtocolDecoder(DataManager dataManager) { + super(dataManager); } public WondexProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java index bccd8a8cf..5af4614b4 100644 --- a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { - public Xexun2ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Xexun2ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Xexun2ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 16573dd7c..92b1c103f 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -24,14 +24,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class XexunProtocolDecoder extends BaseProtocolDecoder { - public XexunProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public XexunProtocolDecoder(DataManager dataManager) { + super(dataManager); } public XexunProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/Xt7ProtocolDecoder.java b/src/org/traccar/protocol/Xt7ProtocolDecoder.java index 2ee0e6b0f..a8815f3cb 100644 --- a/src/org/traccar/protocol/Xt7ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt7ProtocolDecoder.java @@ -25,14 +25,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class Xt7ProtocolDecoder extends BaseProtocolDecoder { - public Xt7ProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public Xt7ProtocolDecoder(DataManager dataManager) { + super(dataManager); } public Xt7ProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/src/org/traccar/protocol/YwtProtocolDecoder.java b/src/org/traccar/protocol/YwtProtocolDecoder.java index 01cfbc8dc..61eb8b487 100644 --- a/src/org/traccar/protocol/YwtProtocolDecoder.java +++ b/src/org/traccar/protocol/YwtProtocolDecoder.java @@ -23,14 +23,15 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; +import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class YwtProtocolDecoder extends BaseProtocolDecoder { - public YwtProtocolDecoder(ServerManager serverManager) { - super(serverManager); + public YwtProtocolDecoder(DataManager dataManager) { + super(dataManager); } public YwtProtocolDecoder(ServerManager serverManager, String protocol) { diff --git a/test/org/traccar/protocol/ApelProtocolDecoderTest.java b/test/org/traccar/protocol/ApelProtocolDecoderTest.java index b094552c9..a843be8dc 100644 --- a/test/org/traccar/protocol/ApelProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ApelProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class ApelProtocolDecoderTest { @Test public void testDecode() throws Exception { - ApelProtocolDecoder decoder = new ApelProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + ApelProtocolDecoder decoder = new ApelProtocolDecoder(new TestDataManager()); /*byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1)));*/ diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java index 17a513f3f..49be44016 100644 --- a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java @@ -11,8 +11,7 @@ public class AplicomProtocolDecoderTest { @Test public void testDecode() throws Exception { - AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new TestDataManager()); int[] buf1 = {0x44,0xC2,0x01,0x43,0x72,0x07,0x29,0xD6,0x84,0x00,0x43,0x03,0x1f,0xff,0x71,0x91,0xC0,0x45,0x0e,0xf9,0x06,0x45,0x0e,0xf9,0x06,0x03,0xb2,0x0b,0x80,0x03,0xb2,0x0b,0x80,0x06,0x64,0x65,0xb3,0x87,0x0c,0xe3,0x0f,0x01,0x0c,0xe3,0x0c,0xe3,0x00,0x32,0x00,0x00,0x15,0x20,0x00,0x00,0x00,0x03,0x0a,0xa2,0x00,0x00,0x3b,0x13,0x00,0x00,0x00,0x32,0x03,0x00,0x00,0x0b,0xcb,0x17,0xac,0xff,0x00,0x99,0x00,0x01,0x86,0xa0,0x02}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/AtrackProtocolDecoderTest.java b/test/org/traccar/protocol/AtrackProtocolDecoderTest.java index 1cdaa8363..4d94c004f 100644 --- a/test/org/traccar/protocol/AtrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AtrackProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class AtrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - AtrackProtocolDecoder decoder = new AtrackProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + AtrackProtocolDecoder decoder = new AtrackProtocolDecoder(new TestDataManager()); //int[] buf1 = {0xfe,0x02,0x00,0x01,0x41,0x04,0xd8,0xf1,0x96,0x82,0x00,0x01}; //assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/BoxProtocolDecoderTest.java b/test/org/traccar/protocol/BoxProtocolDecoderTest.java index 897b5071c..e0a4dfa2e 100644 --- a/test/org/traccar/protocol/BoxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/BoxProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class BoxProtocolDecoderTest { @Test public void testDecode() throws Exception { - BoxProtocolDecoder decoder = new BoxProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + BoxProtocolDecoder decoder = new BoxProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "H,BT,358281002435893,081028142432,F5813D19,6D6E6DC2")); diff --git a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java index 96a8e4b74..62a3b5c3a 100644 --- a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class CarTrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - CarTrackProtocolDecoder decoder = new CarTrackProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + CarTrackProtocolDecoder decoder = new CarTrackProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "$$2222234???????&A9955&B102904.000,A,2233.0655,N,11404.9440,E,0.00,,030109,,*17|6.3|&C0100000100&D000024?>&E10000000&Y00100020")); diff --git a/test/org/traccar/protocol/CarscopProtocolDecoderTest.java b/test/org/traccar/protocol/CarscopProtocolDecoderTest.java index 5978ab7b1..4ec3a14d4 100644 --- a/test/org/traccar/protocol/CarscopProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CarscopProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class CarscopProtocolDecoderTest { @Test public void testDecode() throws Exception { - CarscopProtocolDecoder decoder = new CarscopProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + CarscopProtocolDecoder decoder = new CarscopProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "*040331141830UB05123456789012345061825A2934.0133N10627.2544E000.0040331309.6200000000L000000")); diff --git a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java index 2788e6ba1..054be2e0f 100644 --- a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class CellocatorProtocolDecoderTest { @Test public void testDecode() throws Exception { - CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(new TestDataManager()); int[] buf1 = {0x4D,0x43,0x47,0x50,0x00,0x06,0x00,0x00,0x00,0x08,0x1A,0x02,0x02,0x12,0x04,0x00,0x00,0x00,0x21,0x00,0x62,0x30,0x00,0x00,0x00,0x6B,0x00,0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE5,0xA1,0x00,0x04,0x02,0x06,0x61,0x4E,0xA3,0x03,0x18,0x1A,0x57,0x03,0x4E,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x25,0x07,0x14,0x03,0xD6,0x07,0x49}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java index 0160d4367..8a82c5901 100644 --- a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class EasyTrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "*ET,135790246811221,GZ,0001,0005")); diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java index f9dd1d6bb..4d87ef144 100644 --- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class EelinkProtocolDecoderTest { @Test public void testDecode() throws Exception { - EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x67,0x67,0x01,0x00,0x0b,0x00,0x1b,0x03,0x54,0x18,0x80,0x46,0x61,0x83,0x49,0x01})))); diff --git a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java index 974956dbb..38c63d16b 100644 --- a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java @@ -14,8 +14,7 @@ public class EnforaProtocolDecoderTest { @Test public void testDecode() throws Exception { - EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(new TestDataManager()); ChannelBufferFactory factory = new HeapChannelBufferFactory(); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( diff --git a/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java b/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java index 230ad238a..8be4a7596 100644 --- a/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Ev603ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Ev603ProtocolDecoder decoder = new Ev603ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Ev603ProtocolDecoder decoder = new Ev603ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "!1,123456789012345")); diff --git a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java index ead8c980b..acd495d91 100644 --- a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class FreedomProtocolDecoderTest { @Test public void testDecode() throws Exception { - FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "IMEI,353358011714362,2014/05/22, 20:49:32, N, Lat:4725.9624, E, Lon:01912.5483, Spd:5.05")); diff --git a/test/org/traccar/protocol/GalileoProtocolDecoderTest.java b/test/org/traccar/protocol/GalileoProtocolDecoderTest.java index e76d0378f..5d1e06230 100644 --- a/test/org/traccar/protocol/GalileoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GalileoProtocolDecoderTest.java @@ -13,8 +13,7 @@ public class GalileoProtocolDecoderTest { @Test public void testDecode() throws Exception { - GalileoProtocolDecoder decoder = new GalileoProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + GalileoProtocolDecoder decoder = new GalileoProtocolDecoder(new TestDataManager()); int[] buf1 = {0x01,0x13,(byte)0x80,0x03,0x38,0x36,0x38,0x32,0x30,0x34,0x30,0x30,0x31,0x35,0x34,0x39,0x30,0x38,0x37,0x04,0x32,0x00,(byte)0x85,(byte)0x90}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/GatorProtocolDecoderTest.java b/test/org/traccar/protocol/GatorProtocolDecoderTest.java index 251987cb0..dac0b5b7d 100644 --- a/test/org/traccar/protocol/GatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GatorProtocolDecoderTest.java @@ -11,8 +11,7 @@ public class GatorProtocolDecoderTest { @Test public void testDecode() throws Exception { - GatorProtocolDecoder decoder = new GatorProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + GatorProtocolDecoder decoder = new GatorProtocolDecoder(new TestDataManager()); int[] buf1 = {0x24,0x24,0x81,0x00,0x23,0x0C,0xA2,0x32,0x85,0x10,0x03,0x06,0x14,0x59,0x07,0x02,0x23,0x46,0x90,0x11,0x35,0x29,0x47,0x00,0x00,0x00,0x00,0xC0,0x40,0x01,0x01,0x2C,0x0E,0x11,0x00,0x00,0x00,0x21,0xCB,0x0D}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java index b7aaef5b8..149279224 100644 --- a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Gl100ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "AT+GTHBD=HeartBeat,359231030000010,20090101000000,11F0,0102120204")); diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 585440fa3..9d2b233a9 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Gl200ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "+RESP:GTFRI,02010D,867844001675407,,0,0,1,2,0.0,0,28.9,8.591011,56.476397,20140915213209,0238,0001,03CB,2871,,97,20140915213459,009A")); diff --git a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java index 2f986155a..68a3dc8cf 100644 --- a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class GlobalSatProtocolDecoderTest { @Test public void testDecode() throws Exception { - GlobalSatProtocolDecoder decoder = new GlobalSatProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + GlobalSatProtocolDecoder decoder = new GlobalSatProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "GSh,131826789036289,3,M,ea04*3d")); diff --git a/test/org/traccar/protocol/GotopProtocolDecoderTest.java b/test/org/traccar/protocol/GotopProtocolDecoderTest.java index d0e290b61..fe999fc1a 100644 --- a/test/org/traccar/protocol/GotopProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GotopProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class GotopProtocolDecoderTest { @Test public void testDecode() throws Exception { - GotopProtocolDecoder decoder = new GotopProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + GotopProtocolDecoder decoder = new GotopProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "")); diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 655d4f05f..75b7279f8 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Gps103ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager()); // Log on request assertNull(decoder.decode(null, null, null, "##,imei:359586015829802,A")); diff --git a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java index 3e1d8d6b9..312232b9b 100644 --- a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class GpsGateProtocolDecoderTest { @Test public void testDecode() throws Exception { - GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "$FRLIN,,user1,8IVHF*7A")); diff --git a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java index 8d537685e..b7b3b2f1f 100644 --- a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class Gt02ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x68,0x68,0x25,0x00,0x00,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x00,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x6B,0x3F,0x3E,0x02,0x6B,0x3F,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0D,0x0A})))); diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index a910cb618..de52dce1f 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class Gt06ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x78,0x78,0x11,0x01,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x10,0x0B,0x32,0x01,0x00,0x01,0x71,0x93,0x0D,0x0A})))); diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index d2a602744..47d20c89b 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -13,8 +13,7 @@ public class H02ProtocolDecoderTest { @Test public void testDecode() throws Exception { - H02ProtocolDecoder decoder = new H02ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + H02ProtocolDecoder decoder = new H02ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, ChannelBuffers.copiedBuffer( "*HQ,353588020068342,V1,000000,V,0.0000,0,0.0000,0,0.00,0.00,000000,ffffffff,000106,000002,000203,004c87,16#", Charset.defaultCharset()))); diff --git a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java index aca184b4a..c46c8afe3 100644 --- a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class HaicomProtocolDecoderTest { @Test public void testDecode() throws Exception { - HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "$GPRS123456789012345,602S19A,100915,063515,7240649312041079,0019,3156,111000,10004,0000,11111,00LH#V037")); diff --git a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java index 9557797b7..2fc9b8201 100644 --- a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java +++ b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class IntellitracProtocolDecoderTest { @Test public void testDecode() throws Exception { - IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "$OK:TRACKING")); diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 064c15927..4a90e8d55 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -11,8 +11,7 @@ public class Jt600ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new TestDataManager()); byte[] buf1 = {0x24,0x31,0x10,0x21,0x60,0x01,0x11,0x00,0x1B,0x16,0x02,0x11,0x05,0x59,0x10,0x22,0x32,(byte)0x98,0x62,0x11,0x40,0x46,0x22,0x7B,0x05,(byte)0x98,0x09,0x50,(byte)0x80,0x01,0x23,0x27,(byte)0x95,0x14,0x35,0x16,0x1F}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf1))); diff --git a/test/org/traccar/protocol/KhdProtocolDecoderTest.java b/test/org/traccar/protocol/KhdProtocolDecoderTest.java index 2c9b3560e..9f6aecf37 100644 --- a/test/org/traccar/protocol/KhdProtocolDecoderTest.java +++ b/test/org/traccar/protocol/KhdProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class KhdProtocolDecoderTest { @Test public void testDecode() throws Exception { - KhdProtocolDecoder decoder = new KhdProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + KhdProtocolDecoder decoder = new KhdProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x29,0x29,0xb1,0x00,0x06,0x05,0x16,0x29,0x35,0xb8,0x0d})))); diff --git a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java index b348fd895..b66cf818e 100644 --- a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java +++ b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class LaipacProtocolDecoderTest { @Test public void testDecode() throws Exception { - LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "$AVSYS,99999999,V1.50,SN0000103,32768*15")); diff --git a/test/org/traccar/protocol/M2mProtocolDecoderTest.java b/test/org/traccar/protocol/M2mProtocolDecoderTest.java index 097a783bc..bfe6f0df9 100644 --- a/test/org/traccar/protocol/M2mProtocolDecoderTest.java +++ b/test/org/traccar/protocol/M2mProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class M2mProtocolDecoderTest { @Test public void testDecode() throws Exception { - M2mProtocolDecoder decoder = new M2mProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + M2mProtocolDecoder decoder = new M2mProtocolDecoder(new TestDataManager()); int[] buf1 = {0x23,0x5A,0x3C,0x2A,0x26,0x24,0x21,0x5C,0x28,0x7D,0x70,0x21,0x2A,0x21,0x25,0x4C,0x7C,0x64,0x21,0x22,0x0B,0x0B,0x0B}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java b/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java index eba2bc3f0..a12b93b0e 100644 --- a/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class ManPowerProtocolDecoderTest { @Test public void testDecode() throws Exception { - ManPowerProtocolDecoder decoder = new ManPowerProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + ManPowerProtocolDecoder decoder = new ManPowerProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "simei:352581250259539,,,tracker,51,24,1.73,130426023608,A,3201.5462,N,03452.2975,E,0.01,28B9,1DED,425,01,1x0x0*0x1*60x+2,en-us,")); diff --git a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java index f7d682dba..99a40f8de 100644 --- a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class MegastekProtocolDecoderTest { @Test public void testDecode() throws Exception { - MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "STX,GerAL22,$GPRMC,174752.000,A,3637.060059,S,6416.2354,W,0.00,0.00,030812,,,A*55,F,,imei:861785000249353,05,180.6,Battery=100%,,1,722,310,0FA6,39D0;8F")); diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index 66aea768c..bc053ce85 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class MeiligaoProtocolDecoderTest { @Test public void testDecode() throws Exception { - MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[]{0x24,0x24,0x00,0x00,0x12,0x34,0x56,0xFF,0xFF,0xFF,0xFF,0x50,0x00,0x8B,0x9B,0x0D,0x0A})))); diff --git a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java index fe7c31b92..81bbd0464 100644 --- a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java @@ -13,8 +13,7 @@ public class MeitrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, ChannelBuffers.copiedBuffer( "$$X138,862170010187175,AAA,35,-29.960365,-51.655455,130507201625,A,8,9,0,107,0.9,7,169322,126582,724|6|0547|132B,0000,0009|000A||0278|0000,*BE", Charset.defaultCharset()))); diff --git a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java index d484d6660..6ecfd01cf 100644 --- a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class MiniFinderProtocolDecoderTest { @Test public void testDecode() throws Exception { - MiniFinderProtocolDecoder decoder = new MiniFinderProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + MiniFinderProtocolDecoder decoder = new MiniFinderProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "!1,860719020212696")); diff --git a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java index febfb5346..e670872ff 100644 --- a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class NavigilProtocolDecoderTest { @Test public void testDecode() throws Exception { - NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(new TestDataManager()); byte[] buf1 = {0x01,0x00,0x43,0x00,0x04,0x00,0x20,0x00,0x00,0x00,(byte)0xf6,0x02,0x03,0x08,0x02,0x00,(byte)0xe7,(byte)0xcd,0x0f,0x51,0x0c,0x00,0x00,0x00,0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1))); diff --git a/test/org/traccar/protocol/NavisProtocolDecoderTest.java b/test/org/traccar/protocol/NavisProtocolDecoderTest.java index 2b292d775..78f7cb0bd 100644 --- a/test/org/traccar/protocol/NavisProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavisProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class NavisProtocolDecoderTest { @Test public void testDecode() throws Exception { - NavisProtocolDecoder decoder = new NavisProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + NavisProtocolDecoder decoder = new NavisProtocolDecoder(new TestDataManager()); byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1))); diff --git a/test/org/traccar/protocol/NoranProtocolDecoderTest.java b/test/org/traccar/protocol/NoranProtocolDecoderTest.java index 9d787c38f..8cf685fdc 100644 --- a/test/org/traccar/protocol/NoranProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NoranProtocolDecoderTest.java @@ -13,8 +13,7 @@ public class NoranProtocolDecoderTest { @Test public void testDecode() throws Exception { - NoranProtocolDecoder decoder = new NoranProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + NoranProtocolDecoder decoder = new NoranProtocolDecoder(new TestDataManager()); int[] buf1 = {0x0f,0x00,0x00,0x00,0x4e,0x52,0x30,0x39,0x46,0x30,0x34,0x31,0x35,0x35,0x00}; assertNull(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/OrionProtocolDecoderTest.java b/test/org/traccar/protocol/OrionProtocolDecoderTest.java index 9e37ab5a1..3ec8b257e 100644 --- a/test/org/traccar/protocol/OrionProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OrionProtocolDecoderTest.java @@ -13,8 +13,7 @@ public class OrionProtocolDecoderTest { @Test public void testDecode() throws Exception { - OrionProtocolDecoder decoder = new OrionProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + OrionProtocolDecoder decoder = new OrionProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray( new int[] {0x50,0x57,0x00,0x41,0x07,0x36,0x7C,0x24,0x2B,0x44,0x09,0x01,0xAD,0xE9,0x7D,0x01,0x63,0x14,0x3B,0x07,0xB0,0x03,0x00,0x00,0x00,0x00,0x0D,0x04,0x19,0x17,0x38,0x2D,0x00,0x0B,0x01,0x01,0x00,0x05,0x11,0x00,0x00,0x00,0x00,0x06,0x82,0x05,0x00,0x00,0x00,0x8E,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0x03,0x00,0x84,0x03,0x00,0x85,0x03,0x00,0x09,0x0A,0x00,0x00,0x00,0x00,0x48,0x01,0x00,0x00,0x00,0x8A,0xFC})))); diff --git a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java index 8ab636c05..32bba92b7 100644 --- a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class OsmAndProtocolDecoderTest { @Test public void testDecode() throws Exception { - OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/?lat=49.60688&lon=6.15788×tamp=2014-06-04+09%3A10%3A11&altitude=384.7&speed=0.0&id=353861053849681"))); diff --git a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java index 1051b0d4d..b2a33c63c 100644 --- a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java +++ b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java @@ -16,8 +16,7 @@ public class PiligrimProtocolDecoderTest { @Test public void testDecode() throws Exception { - PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(new TestDataManager()); HttpRequest msg1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/bingps?imei=868204005544720&csq=18&vout=00&vin=4050&dataid=00000000"); int[] buf1 = {0xff,0xf2,0x20,0x0d,0x41,0x10,0x06,0x1a,0x32,0x35,0x4f,0x34,0x22,0x31,0x00,0x62,0x00,0x0a,0x00,0x05,0x17,0x3b,0x00,0x00,0xa1,0x01,0x00,0x03,0x00,0x00,0x5e,0x00,0xff,0xf2,0x20,0x0d,0x41,0x10,0x10,0x09,0x32,0x35,0x4f,0x2b,0x22,0x31,0x00,0x42,0x00,0x0b,0x00,0x0e,0x17,0x3b,0x00,0x00,0x9f,0x01,0x00,0x07,0x00,0x00,0x60,0x00}; diff --git a/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java index f06d2312b..cbc31b1b6 100644 --- a/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class Pt3000ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Pt3000ProtocolDecoder decoder = new Pt3000ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Pt3000ProtocolDecoder decoder = new Pt3000ProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "%356939010012099,$GPRMC,124945.752,A,4436.6245,N,01054.4634,E,0.11,358.52,060408,,,A,+393334347445,N028d")); diff --git a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java index d286dde77..0bcd8c3cd 100644 --- a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class Pt502ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "$POS,6094,205523.000,A,1013.6223,N,06728.4248,W,0.0,99.3,011112,,,A/00000,00000/0/23895000//")); diff --git a/test/org/traccar/protocol/RitiProtocolDecoderTest.java b/test/org/traccar/protocol/RitiProtocolDecoderTest.java index 2f77a4fc1..06747ae45 100644 --- a/test/org/traccar/protocol/RitiProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RitiProtocolDecoderTest.java @@ -13,8 +13,7 @@ public class RitiProtocolDecoderTest { @Test public void testDecode() throws Exception { - RitiProtocolDecoder decoder = new RitiProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + RitiProtocolDecoder decoder = new RitiProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray( new int[] {0x3b,0x28,0x64,0xa3,0x05,0x63,0x00,0x00,0x6d,0x40,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x47,0x50,0x52,0x4d,0x43,0x2c,0x32,0x31,0x31,0x37,0x34,0x33,0x2e,0x30,0x30,0x30,0x2c,0x41,0x2c,0x31,0x33,0x35,0x37,0x2e,0x33,0x36,0x37,0x35,0x2c,0x4e,0x2c,0x31,0x30,0x30,0x33,0x36,0x2e,0x36,0x39,0x39,0x32,0x2c,0x45,0x2c,0x30,0x2e,0x30,0x30,0x2c,0x2c,0x30,0x31,0x30,0x39,0x31,0x34,0x2c,0x2c,0x2c,0x41,0x2a,0x37,0x38,0x0d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04})))); diff --git a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java index ddca66aa0..a3bf225db 100644 --- a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java @@ -11,8 +11,7 @@ public class RuptelaProtocolDecoderTest { @Test public void testDecode() throws Exception { - RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(new TestDataManager()); int[] buf1 = {0x00,0x79,0x00,0x00,0x0b,0x1a,0x2a,0x55,0x85,0xc3,0x01,0x00,0x02,0x4e,0x9c,0x03,0x69,0x00,0x00,0x0f,0x10,0x17,0x33,0x20,0x8f,0xf4,0x5e,0x07,0xb3,0x1b,0x57,0x0a,0x00,0x10,0x09,0x09,0x06,0x05,0x01,0x1b,0x1a,0x02,0x00,0x03,0x00,0x1c,0x01,0xad,0x01,0x02,0x1d,0x33,0x8e,0x16,0x00,0x00,0x02,0x96,0x00,0x00,0x60,0x1a,0x41,0x01,0x4b,0xc1,0x6d,0x00,0x4e,0x9c,0x03,0x84,0x00,0x00,0x0f,0x10,0x4f,0xdf,0x20,0x90,0x0d,0x20,0x07,0x51,0x03,0xb0,0x0a,0x00,0x13 ,0x08,0x09,0x06,0x05,0x01,0x1b,0x1a,0x02,0x00,0x03,0x00,0x1c,0x01,0xad,0x01,0x02,0x1d,0x33,0xb1,0x16,0x00,0x00,0x02,0x96,0x00,0x00,0x60,0x1a,0x41,0x01,0x4b,0xc1,0xea,0x00,0x28,0xf9}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/SanavProtocolDecoderTest.java b/test/org/traccar/protocol/SanavProtocolDecoderTest.java index d6d06edaa..b1a832f0f 100644 --- a/test/org/traccar/protocol/SanavProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SanavProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class SanavProtocolDecoderTest { @Test public void testDecode() throws Exception { - SanavProtocolDecoder decoder = new SanavProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + SanavProtocolDecoder decoder = new SanavProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "imei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,*05,AUTO-4095mv")); diff --git a/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java b/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java index a2bf3c0ab..a1ad836e6 100644 --- a/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java @@ -11,8 +11,7 @@ public class SkypatrolProtocolDecoderTest { @Test public void testDecode() throws Exception { - SkypatrolProtocolDecoder decoder = new SkypatrolProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + SkypatrolProtocolDecoder decoder = new SkypatrolProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[]{0x00,0x05,0x02,0x10,0x04,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x0D,0x31,0x31,0x34,0x37,0x37,0x35,0x38,0x33,0x00,0xCB,0x00,0x00,0x00,0x00,0x0E,0x11,0x07,0x0C,0x01,0x01,0x84,0xD0,0x32,0xFB,0x38,0x41,0x37,0x00,0x00,0x00,0x00,0x16,0x07,0x2B,0x00,0x00,0x17,0x05,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x4E,0x0C,0x07,0x11,0x16,0x07,0x2C,0x10,0x59,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x03,0x10,0x02,0x60,0xB7,0x36,0x3B,0x63,0x06,0xC1,0x1A,0x00,0xB7,0x36,0x37,0xF2,0x06,0xBF,0x19,0xB7,0x36,0x37,0xF1,0x06,0xB5,0x0E,0xB7,0x36,0x38,0xB1,0x06,0xBB,0x0B,0xB7,0x36,0x3B,0x61,0x06,0xB8,0x0A,0xB7,0x36,0x37,0xF3,0x06,0xB7,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C})))); diff --git a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java index 890de4f2d..2cee77ca4 100644 --- a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class Stl060ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Stl060ProtocolDecoder decoder = new Stl060ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Stl060ProtocolDecoder decoder = new Stl060ProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "$1,357804048043099,D001,AP29AW0963,23/02/14,14:06:54,17248488N,078342226E,0.08,193.12,1,1,1,1,1,A")); diff --git a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java index fae36ec64..3fbb05bb3 100644 --- a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class SuntechProtocolDecoderTest { @Test public void testDecode() throws Exception { - SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "SA200ALV;317652")); diff --git a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java index 5fc2655bc..87e9c025b 100644 --- a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class SyrusProtocolDecoderTest { @Test public void testDecode() throws Exception { - SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(null, false); - decoder.setDataManager(new TestDataManager()); + SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(new TestDataManager(), false); assertNotNull(decoder.decode(null, null, ">RPV00000+3739438-1220384601512612;ID=1234;*7F")); diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java index bf7cf9101..a06df0c2d 100644 --- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class T55ProtocolDecoderTest { @Test public void testDecode() throws Exception { - T55ProtocolDecoder decoder = new T55ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "$GPFID,ID123456ABC")); diff --git a/test/org/traccar/protocol/TelikProtocolDecoderTest.java b/test/org/traccar/protocol/TelikProtocolDecoderTest.java index 41b6f3a9d..257414abf 100644 --- a/test/org/traccar/protocol/TelikProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TelikProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class TelikProtocolDecoderTest { @Test public void testDecode() throws Exception { - TelikProtocolDecoder decoder = new TelikProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + TelikProtocolDecoder decoder = new TelikProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "0026436729|232|01|003002030")); diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java index 1cd265cb4..8f4b987df 100644 --- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java @@ -12,8 +12,7 @@ public class TeltonikaProtocolDecoderTest { @Test public void testDecode() throws Exception { - TeltonikaProtocolDecoder decoder = new TeltonikaProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + TeltonikaProtocolDecoder decoder = new TeltonikaProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x00,0x0F,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x31,0x32,0x33,0x34,0x35})))); diff --git a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java index eeb97d18f..eb852875f 100644 --- a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Tk102ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "")); diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index 21066bdb2..6d6683db2 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Tk103ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "(090411121854BP0000001234567890HSO")); diff --git a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java index 350df23b4..8ce438c4f 100644 --- a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class Tlt2hProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "#357671030946351#V500#0000#AUTO#1\r\n" + diff --git a/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java b/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java index 03c10dda6..3f84165bf 100644 --- a/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class TopflytechProtocolDecoderTest { @Test public void testDecode() throws Exception { - TopflytechProtocolDecoder decoder = new TopflytechProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + TopflytechProtocolDecoder decoder = new TopflytechProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "(880316890094910BP00XG00b600000000L00074b54S00000000R0C0F0014000100f0130531152205A0706.1395S11024.0965E000.0251.25")); diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java index 2260fc13a..adcfd89ca 100644 --- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class TotemProtocolDecoderTest { @Test public void testDecode() throws Exception { - TotemProtocolDecoder decoder = new TotemProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + TotemProtocolDecoder decoder = new TotemProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "$$BB862170017856731|AA$GPRMC,000000.00,V,0000.0000,N,00000.0000,E,000.0,000.0,000000,,,A*73|00.0|00.0|00.0|000000001000|20000000000000|13790000|00000000|00000000|00000000|0.0000|0007|8C23")); diff --git a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java index b78f95fac..c1fb6b1d2 100644 --- a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class Tr20ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "%%TRACKPRO01,1")); diff --git a/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java b/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java index 7319bb329..131f29a68 100644 --- a/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class TrackboxProtocolDecoderTest { @Test public void testDecode() throws Exception { - TrackboxProtocolDecoder decoder = new TrackboxProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + TrackboxProtocolDecoder decoder = new TrackboxProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "a=connect&v=11&i=111111111111111")); diff --git a/test/org/traccar/protocol/V680ProtocolDecoderTest.java b/test/org/traccar/protocol/V680ProtocolDecoderTest.java index 3f2f2d829..84463a1af 100644 --- a/test/org/traccar/protocol/V680ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/V680ProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class V680ProtocolDecoderTest { @Test public void testDecode() throws Exception { - V680ProtocolDecoder decoder = new V680ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + V680ProtocolDecoder decoder = new V680ProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "#353588102019155")); diff --git a/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java b/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java index eba888810..683d86c7b 100644 --- a/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class VisiontekProtocolDecoderTest { @Test public void testDecode() throws Exception { - VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "$1,AP09BU9397,861785006462448,20,06,14,15,03,28,17267339N,078279407E,060.0,073,0550,11,0,1,0,0,1,1,26,A,0000000000")); diff --git a/test/org/traccar/protocol/WialonProtocolDecoderTest.java b/test/org/traccar/protocol/WialonProtocolDecoderTest.java index a8a369bfc..89aca0d33 100644 --- a/test/org/traccar/protocol/WialonProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WialonProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class WialonProtocolDecoderTest { @Test public void testDecode() throws Exception { - WialonProtocolDecoder decoder = new WialonProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + WialonProtocolDecoder decoder = new WialonProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "#L#123456789012345;test")); diff --git a/test/org/traccar/protocol/WondexProtocolDecoderTest.java b/test/org/traccar/protocol/WondexProtocolDecoderTest.java index eadd1d357..8f62a3b3a 100644 --- a/test/org/traccar/protocol/WondexProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WondexProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class WondexProtocolDecoderTest { @Test public void testDecode() throws Exception { - WondexProtocolDecoder decoder = new WondexProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + WondexProtocolDecoder decoder = new WondexProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "1044989601,20130323074605,0.000000,90.000000,0,000,0,0,2")); diff --git a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java index c3a257318..89907af64 100644 --- a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class Xexun2ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "130302125349,+79604870506,GPRMC,085349.000,A,4503.2392,N,03858.5660,E,6.95,154.65,020313,,,A*6C,F,, imei:012207007744243,03,-1.5,F:4.15V,1,139,28048,250,01,278A,5072")); diff --git a/test/org/traccar/protocol/XexunProtocolDecoderTest.java b/test/org/traccar/protocol/XexunProtocolDecoderTest.java index 252293655..804a4687e 100644 --- a/test/org/traccar/protocol/XexunProtocolDecoderTest.java +++ b/test/org/traccar/protocol/XexunProtocolDecoderTest.java @@ -9,8 +9,7 @@ public class XexunProtocolDecoderTest { @Test public void testDecode() throws Exception { - XexunProtocolDecoder decoder = new XexunProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + XexunProtocolDecoder decoder = new XexunProtocolDecoder(new TestDataManager()); verify(decoder.decode(null, null, "GPRMC,043435.000,A,811.299200,S,11339.9500,E,0.93,29.52,160313,00,0000.0,A*65,F,,imei:359585014597923,")); diff --git a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java index 187221e3a..21a30d377 100644 --- a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java @@ -11,8 +11,7 @@ public class Xt7ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(new TestDataManager()); ChannelBufferFactory factory = new HeapChannelBufferFactory(); byte[] buf1 = {0x53,0x54,0x58,0x32,0x30,0x31,0x30,0x31,0x30,0x31,0x38,0x30,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x02,0x6A,0x24,0x47,0x50,0x52,0x4D,0x43,0x2C,0x31,0x30,0x31,0x30,0x35,0x33,0x2E,0x30,0x30,0x30,0x2C,0x41,0x2C,0x32,0x32,0x33,0x32,0x2E,0x37,0x36,0x30,0x37,0x2C,0x4E,0x2C,0x31,0x31,0x34,0x30,0x34,0x2E,0x37,0x36,0x36,0x39,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x2C,0x32,0x33,0x31,0x31,0x31,0x30,0x2C,0x2C,0x2C,0x41,0x2A,0x37,0x46,0x2C,0x34,0x36,0x30,0x2C,0x30,0x30,0x2C,0x32,0x37,0x39,0x35,0x2C,0x30,0x45,0x36,0x41,0x2C,0x31,0x34,0x2C,0x39,0x34,0x2C,0x31,0x30,0x30,0x30,0x2C,0x30,0x30,0x30,0x30,0x2C,0x39,0x31,0x2C,0x54,0x69,0x6D,0x65,0x72,0x3B,0x31,0x44,0x0D,0x0A}; diff --git a/test/org/traccar/protocol/YwtProtocolDecoderTest.java b/test/org/traccar/protocol/YwtProtocolDecoderTest.java index 3f757c9d7..9ee8f0853 100644 --- a/test/org/traccar/protocol/YwtProtocolDecoderTest.java +++ b/test/org/traccar/protocol/YwtProtocolDecoderTest.java @@ -10,8 +10,7 @@ public class YwtProtocolDecoderTest { @Test public void testDecode() throws Exception { - YwtProtocolDecoder decoder = new YwtProtocolDecoder(null); - decoder.setDataManager(new TestDataManager()); + YwtProtocolDecoder decoder = new YwtProtocolDecoder(new TestDataManager()); assertNull(decoder.decode(null, null, "%SN,0417061042:0,0,140117041203,404")); -- cgit v1.2.3 From 0d59336ac1fbe9934260e56811c3bcafa0aeaeca Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Tue, 21 Oct 2014 15:00:55 -0400 Subject: Updated BaseProtocolDecoder constructor to take three parameters (DataManager, String, Properties); Removed second constructor; --- src/org/traccar/BaseProtocolDecoder.java | 38 ++---- src/org/traccar/ServerManager.java | 150 +++++++++++---------- src/org/traccar/protocol/ApelProtocolDecoder.java | 12 +- .../traccar/protocol/AplicomProtocolDecoder.java | 12 +- .../traccar/protocol/AtrackProtocolDecoder.java | 12 +- src/org/traccar/protocol/BoxProtocolDecoder.java | 12 +- .../traccar/protocol/CarTrackProtocolDecoder.java | 12 +- .../traccar/protocol/CarscopProtocolDecoder.java | 12 +- .../protocol/CellocatorProtocolDecoder.java | 12 +- .../traccar/protocol/EasyTrackProtocolDecoder.java | 12 +- .../traccar/protocol/EelinkProtocolDecoder.java | 12 +- .../traccar/protocol/EnforaProtocolDecoder.java | 12 +- src/org/traccar/protocol/Ev603ProtocolDecoder.java | 12 +- .../traccar/protocol/FreedomProtocolDecoder.java | 12 +- .../traccar/protocol/GalileoProtocolDecoder.java | 12 +- src/org/traccar/protocol/GatorProtocolDecoder.java | 12 +- src/org/traccar/protocol/Gl100ProtocolDecoder.java | 12 +- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 12 +- .../traccar/protocol/GlobalSatProtocolDecoder.java | 23 ++-- src/org/traccar/protocol/GotopProtocolDecoder.java | 12 +- .../traccar/protocol/Gps103ProtocolDecoder.java | 12 +- .../traccar/protocol/GpsGateProtocolDecoder.java | 12 +- src/org/traccar/protocol/Gt02ProtocolDecoder.java | 12 +- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 19 ++- src/org/traccar/protocol/H02ProtocolDecoder.java | 12 +- .../traccar/protocol/HaicomProtocolDecoder.java | 12 +- .../protocol/IntellitracProtocolDecoder.java | 12 +- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 12 +- src/org/traccar/protocol/KhdProtocolDecoder.java | 12 +- .../traccar/protocol/LaipacProtocolDecoder.java | 12 +- src/org/traccar/protocol/M2mProtocolDecoder.java | 12 +- .../traccar/protocol/ManPowerProtocolDecoder.java | 12 +- src/org/traccar/protocol/MaxonProtocolDecoder.java | 12 +- .../traccar/protocol/MegastekProtocolDecoder.java | 12 +- .../traccar/protocol/MeiligaoProtocolDecoder.java | 18 ++- .../traccar/protocol/MeitrackProtocolDecoder.java | 12 +- .../protocol/MiniFinderProtocolDecoder.java | 12 +- src/org/traccar/protocol/Mta6ProtocolDecoder.java | 12 +- .../traccar/protocol/NavigilProtocolDecoder.java | 12 +- src/org/traccar/protocol/NavisProtocolDecoder.java | 12 +- src/org/traccar/protocol/NoranProtocolDecoder.java | 12 +- src/org/traccar/protocol/OrionProtocolDecoder.java | 12 +- .../traccar/protocol/OsmAndProtocolDecoder.java | 12 +- .../traccar/protocol/PiligrimProtocolDecoder.java | 12 +- .../traccar/protocol/ProgressProtocolDecoder.java | 12 +- .../traccar/protocol/Pt3000ProtocolDecoder.java | 12 +- src/org/traccar/protocol/Pt502ProtocolDecoder.java | 12 +- src/org/traccar/protocol/RitiProtocolDecoder.java | 12 +- .../traccar/protocol/RuptelaProtocolDecoder.java | 12 +- src/org/traccar/protocol/SanavProtocolDecoder.java | 12 +- .../traccar/protocol/SkypatrolProtocolDecoder.java | 12 +- .../traccar/protocol/Stl060ProtocolDecoder.java | 12 +- .../traccar/protocol/SuntechProtocolDecoder.java | 12 +- src/org/traccar/protocol/SyrusProtocolDecoder.java | 12 +- src/org/traccar/protocol/T55ProtocolDecoder.java | 12 +- src/org/traccar/protocol/TelikProtocolDecoder.java | 12 +- .../traccar/protocol/TeltonikaProtocolDecoder.java | 12 +- src/org/traccar/protocol/Tk102ProtocolDecoder.java | 12 +- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 12 +- src/org/traccar/protocol/Tlt2hProtocolDecoder.java | 12 +- .../protocol/TopflytechProtocolDecoder.java | 12 +- src/org/traccar/protocol/TotemProtocolDecoder.java | 12 +- src/org/traccar/protocol/Tr20ProtocolDecoder.java | 12 +- .../traccar/protocol/TrackboxProtocolDecoder.java | 12 +- src/org/traccar/protocol/V680ProtocolDecoder.java | 12 +- .../traccar/protocol/VisiontekProtocolDecoder.java | 12 +- .../traccar/protocol/WialonProtocolDecoder.java | 12 +- .../traccar/protocol/WondexProtocolDecoder.java | 12 +- .../traccar/protocol/Xexun2ProtocolDecoder.java | 12 +- src/org/traccar/protocol/XexunProtocolDecoder.java | 12 +- src/org/traccar/protocol/Xt7ProtocolDecoder.java | 12 +- src/org/traccar/protocol/YwtProtocolDecoder.java | 12 +- .../traccar/protocol/ApelProtocolDecoderTest.java | 2 +- .../protocol/AplicomProtocolDecoderTest.java | 2 +- .../protocol/AtrackProtocolDecoderTest.java | 2 +- .../traccar/protocol/BoxProtocolDecoderTest.java | 2 +- .../protocol/CarTrackProtocolDecoderTest.java | 2 +- .../protocol/CarscopProtocolDecoderTest.java | 2 +- .../protocol/CellocatorProtocolDecoderTest.java | 2 +- .../protocol/EasyTrackProtocolDecoderTest.java | 2 +- .../protocol/EelinkProtocolDecoderTest.java | 2 +- .../protocol/EnforaProtocolDecoderTest.java | 2 +- .../traccar/protocol/Ev603ProtocolDecoderTest.java | 2 +- .../protocol/FreedomProtocolDecoderTest.java | 2 +- .../protocol/GalileoProtocolDecoderTest.java | 2 +- .../traccar/protocol/GatorProtocolDecoderTest.java | 2 +- .../traccar/protocol/Gl100ProtocolDecoderTest.java | 2 +- .../traccar/protocol/Gl200ProtocolDecoderTest.java | 2 +- .../protocol/GlobalSatProtocolDecoderTest.java | 2 +- .../traccar/protocol/GotopProtocolDecoderTest.java | 2 +- .../protocol/Gps103ProtocolDecoderTest.java | 2 +- .../protocol/GpsGateProtocolDecoderTest.java | 2 +- .../traccar/protocol/Gt02ProtocolDecoderTest.java | 2 +- .../traccar/protocol/Gt06ProtocolDecoderTest.java | 2 +- .../traccar/protocol/H02ProtocolDecoderTest.java | 2 +- .../protocol/HaicomProtocolDecoderTest.java | 2 +- .../protocol/IntellitracProtocolDecoderTest.java | 2 +- .../traccar/protocol/Jt600ProtocolDecoderTest.java | 2 +- .../traccar/protocol/KhdProtocolDecoderTest.java | 2 +- .../protocol/LaipacProtocolDecoderTest.java | 2 +- .../traccar/protocol/M2mProtocolDecoderTest.java | 2 +- .../protocol/ManPowerProtocolDecoderTest.java | 2 +- .../protocol/MegastekProtocolDecoderTest.java | 2 +- .../protocol/MeiligaoProtocolDecoderTest.java | 2 +- .../protocol/MeitrackProtocolDecoderTest.java | 2 +- .../protocol/MiniFinderProtocolDecoderTest.java | 2 +- .../protocol/NavigilProtocolDecoderTest.java | 2 +- .../traccar/protocol/NavisProtocolDecoderTest.java | 2 +- .../traccar/protocol/NoranProtocolDecoderTest.java | 2 +- .../traccar/protocol/OrionProtocolDecoderTest.java | 2 +- .../protocol/OsmAndProtocolDecoderTest.java | 2 +- .../protocol/PiligrimProtocolDecoderTest.java | 2 +- .../protocol/Pt3000ProtocolDecoderTest.java | 2 +- .../traccar/protocol/Pt502ProtocolDecoderTest.java | 2 +- .../traccar/protocol/RitiProtocolDecoderTest.java | 2 +- .../protocol/RuptelaProtocolDecoderTest.java | 2 +- .../traccar/protocol/SanavProtocolDecoderTest.java | 2 +- .../protocol/SkypatrolProtocolDecoderTest.java | 2 +- .../protocol/Stl060ProtocolDecoderTest.java | 2 +- .../protocol/SuntechProtocolDecoderTest.java | 2 +- .../traccar/protocol/SyrusProtocolDecoderTest.java | 2 +- .../traccar/protocol/T55ProtocolDecoderTest.java | 2 +- .../traccar/protocol/TelikProtocolDecoderTest.java | 2 +- .../protocol/TeltonikaProtocolDecoderTest.java | 2 +- .../traccar/protocol/Tk102ProtocolDecoderTest.java | 2 +- .../traccar/protocol/Tk103ProtocolDecoderTest.java | 2 +- .../traccar/protocol/Tlt2hProtocolDecoderTest.java | 2 +- .../protocol/TopflytechProtocolDecoderTest.java | 2 +- .../traccar/protocol/TotemProtocolDecoderTest.java | 2 +- .../traccar/protocol/Tr20ProtocolDecoderTest.java | 2 +- .../protocol/TrackboxProtocolDecoderTest.java | 2 +- .../traccar/protocol/V680ProtocolDecoderTest.java | 2 +- .../protocol/VisiontekProtocolDecoderTest.java | 2 +- .../protocol/WialonProtocolDecoderTest.java | 2 +- .../protocol/WondexProtocolDecoderTest.java | 2 +- .../protocol/Xexun2ProtocolDecoderTest.java | 2 +- .../traccar/protocol/XexunProtocolDecoderTest.java | 2 +- .../traccar/protocol/Xt7ProtocolDecoderTest.java | 2 +- .../traccar/protocol/YwtProtocolDecoderTest.java | 2 +- 139 files changed, 515 insertions(+), 671 deletions(-) diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index e4a3448f1..04b1a1eec 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -16,12 +16,15 @@ package org.traccar; import java.net.SocketAddress; +import java.util.Properties; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelEvent; import org.jboss.netty.channel.ChannelHandlerContext; import static org.jboss.netty.channel.Channels.fireMessageReceived; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.handler.codec.oneone.OneToOneDecoder; + import org.traccar.database.DataManager; /** @@ -29,46 +32,27 @@ import org.traccar.database.DataManager; */ public abstract class BaseProtocolDecoder extends OneToOneDecoder { - private final ServerManager serverManager; private final DataManager dataManager; private final String protocol; + private final Properties properties; public final DataManager getDataManager() { return dataManager; } - public final ServerManager getServerManager() { - return serverManager; - } - public final String getProtocol() { return protocol; } - - public BaseProtocolDecoder(DataManager dataManager) { - // This constructor must only be used by test classes. - // There should be a way to check this at compile time. - - assert (dataManager != null) : - "BaseProtocolDecoder() initialized with NULL dataManager"; - - serverManager = null; - protocol = null; - - this.dataManager = dataManager; + + public final Properties getProperties() { + return properties; } - public BaseProtocolDecoder(ServerManager serverManager, String protocol) { - assert (serverManager != null) : - "BaseProtocolDecoder() initialized with NULL serverManager"; - - assert (protocol != null) : - "BaseProtocolDecoder() initialized with NULL protocol"; - - this.serverManager = serverManager; + + public BaseProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + this.dataManager = dataManager; this.protocol = protocol; - - dataManager = serverManager.getDataManager(); + this.properties = properties; } @Override diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 9edb1cf5e..f50e66fc5 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -22,6 +22,7 @@ import java.sql.SQLException; import java.util.LinkedList; import java.util.List; import java.util.Properties; + import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.buffer.ChannelBuffers; @@ -35,6 +36,7 @@ import org.jboss.netty.handler.codec.http.HttpRequestDecoder; import org.jboss.netty.handler.codec.http.HttpResponseEncoder; import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; + import org.traccar.geocode.GoogleReverseGeocoder; import org.traccar.geocode.NominatimReverseGeocoder; import org.traccar.geocode.ReverseGeocoder; @@ -235,7 +237,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new XexunFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new XexunProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new XexunProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -255,7 +257,7 @@ public class ServerManager { ChannelBuffers.wrappedBuffer(delimiter3))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(dataManager, protocol, properties)); } }); serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @@ -263,7 +265,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -279,7 +281,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(dataManager, protocol, properties)); } }); serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @@ -287,7 +289,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -303,7 +305,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gl100ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Gl100ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -322,7 +324,7 @@ public class ServerManager { ChannelBuffers.wrappedBuffer(delimiter2))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -338,7 +340,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new T55ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new T55ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -353,7 +355,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -366,7 +368,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new TotemFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TotemProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new TotemProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -378,7 +380,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 0, 2, -2, 2)); - pipeline.addLast("objectDecoder", new EnforaProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new EnforaProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -390,7 +392,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new MeiligaoFrameDecoder()); - pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -406,7 +408,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new MaxonProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new MaxonProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -421,7 +423,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SuntechProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new SuntechProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -433,7 +435,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0)); - pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -447,7 +449,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new H02FrameDecoder()); - pipeline.addLast("objectDecoder", new H02ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new H02ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -459,7 +461,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Jt600FrameDecoder()); - pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -474,7 +476,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Ev603ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Ev603ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -489,7 +491,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new V680ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new V680ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -502,7 +504,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Pt502FrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -520,7 +522,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tr20ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Tr20ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -532,7 +534,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(4 * 1024, 12, 2, 2, 0)); - pipeline.addLast("objectDecoder", new NavisProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new NavisProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -547,7 +549,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new MeitrackFrameDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -560,7 +562,7 @@ public class ServerManager { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -572,7 +574,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0)); - pipeline.addLast("objectDecoder", new Gt02ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Gt02ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -584,7 +586,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Gt06FrameDecoder()); - pipeline.addLast("objectDecoder", new Gt06ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Gt06ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -598,7 +600,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new MegastekProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new MegastekProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -610,7 +612,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new NavigilFrameDecoder()); - pipeline.addLast("objectDecoder", new NavigilProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new NavigilProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -628,7 +630,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GpsGateProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new GpsGateProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -640,7 +642,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new TeltonikaFrameDecoder()); - pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -653,7 +655,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(ServerManager.this, protocol, false)); + pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(dataManager, protocol, properties, false)); } }); } @@ -666,7 +668,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(ServerManager.this, protocol, true)); + pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(dataManager, protocol, properties, true)); } }); } @@ -682,7 +684,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(32 * 1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -698,7 +700,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, protocol, true)); + pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(dataManager, protocol, properties, true)); } }); } @@ -711,7 +713,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new WondexFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new WondexProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new WondexProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -723,7 +725,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new CellocatorFrameDecoder()); - pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -737,7 +739,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new GalileoFrameDecoder()); - pipeline.addLast("objectDecoder", new GalileoProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new GalileoProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -755,7 +757,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new YwtProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new YwtProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -771,7 +773,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -785,7 +787,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new IntellitracFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new IntellitracProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new IntellitracProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -797,7 +799,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 20, 1, 5, 0)); - pipeline.addLast("objectDecoder", new Xt7ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Xt7ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -811,7 +813,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new WialonProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new WialonProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -827,7 +829,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new CarscopProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new CarscopProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -839,7 +841,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0)); - pipeline.addLast("objectDecoder", new ApelProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new ApelProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -857,7 +859,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new ManPowerProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new ManPowerProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -873,7 +875,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GlobalSatProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new GlobalSatProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -885,7 +887,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new AtrackFrameDecoder()); - pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -901,7 +903,7 @@ public class ServerManager { new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Pt3000ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Pt3000ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -913,7 +915,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 0, 2, 2, 0)); - pipeline.addLast("objectDecoder", new RuptelaProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new RuptelaProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -928,7 +930,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -942,7 +944,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new LaipacProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new LaipacProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -954,7 +956,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new AplicomFrameDecoder()); - pipeline.addLast("objectDecoder", new AplicomProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new AplicomProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -969,7 +971,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GotopProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new GotopProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -984,7 +986,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SanavProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new SanavProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -995,7 +997,7 @@ public class ServerManager { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("objectDecoder", new GatorProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new GatorProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1006,7 +1008,7 @@ public class ServerManager { TrackerServer server = new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("objectDecoder", new NoranProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new NoranProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -1020,7 +1022,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(23)); - pipeline.addLast("objectDecoder", new M2mProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new M2mProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1033,7 +1035,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new OsmAndProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new OsmAndProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1048,7 +1050,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1060,7 +1062,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this, protocol, false)); + pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(dataManager, protocol, properties, false)); } }); } @@ -1072,7 +1074,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 3, 2)); - pipeline.addLast("objectDecoder", new KhdProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new KhdProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1086,7 +1088,7 @@ public class ServerManager { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpAggregator", new HttpChunkAggregator(16384)); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new PiligrimProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new PiligrimProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1099,7 +1101,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Stl060FrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Stl060ProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new Stl060ProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1114,7 +1116,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new CarTrackProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new CarTrackProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1129,7 +1131,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new MiniFinderProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new MiniFinderProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1144,7 +1146,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new HaicomProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new HaicomProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1156,7 +1158,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2)); - pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1171,7 +1173,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new BoxProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new BoxProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1184,7 +1186,7 @@ public class ServerManager { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new FreedomProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new FreedomProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1199,7 +1201,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TelikProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new TelikProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1213,7 +1215,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TrackboxProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new TrackboxProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1228,7 +1230,7 @@ public class ServerManager { pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(dataManager, protocol, properties)); } }); } @@ -1240,7 +1242,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new OrionFrameDecoder()); - pipeline.addLast("objectDecoder", new OrionProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new OrionProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); @@ -1254,7 +1256,7 @@ public class ServerManager { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 105, 2, 3, 0)); - pipeline.addLast("objectDecoder", new RitiProtocolDecoder(ServerManager.this, protocol)); + pipeline.addLast("objectDecoder", new RitiProtocolDecoder(dataManager, protocol, properties)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java index cad891d4b..c772ce6f7 100644 --- a/src/org/traccar/protocol/ApelProtocolDecoder.java +++ b/src/org/traccar/protocol/ApelProtocolDecoder.java @@ -20,13 +20,15 @@ import java.nio.charset.Charset; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -39,12 +41,8 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder { private long lastIndex; private long newIndex; - public ApelProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public ApelProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public ApelProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } /* diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index 607bc7869..c47731759 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -16,11 +16,13 @@ package org.traccar.protocol; import java.util.Date; +import java.util.Properties; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -28,12 +30,8 @@ import org.traccar.model.Position; public class AplicomProtocolDecoder extends BaseProtocolDecoder { - public AplicomProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public AplicomProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public AplicomProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final long IMEI_BASE_TC65_V20 = 0x1437207000000L; diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index 02d970f91..db6cdb7e1 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -19,12 +19,14 @@ import java.nio.charset.Charset; import java.util.Date; import java.util.LinkedList; import java.util.List; +import java.util.Properties; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ import org.traccar.model.Position; public class AtrackProtocolDecoder extends BaseProtocolDecoder { - public AtrackProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public AtrackProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public AtrackProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int MSG_HEARTBEAT = 0x1A; diff --git a/src/org/traccar/protocol/BoxProtocolDecoder.java b/src/org/traccar/protocol/BoxProtocolDecoder.java index 68989d71f..cdbd3932e 100644 --- a/src/org/traccar/protocol/BoxProtocolDecoder.java +++ b/src/org/traccar/protocol/BoxProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class BoxProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public BoxProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public BoxProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public BoxProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java index 8b55c71e9..170db3130 100644 --- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class CarTrackProtocolDecoder extends BaseProtocolDecoder { - public CarTrackProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public CarTrackProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public CarTrackProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/CarscopProtocolDecoder.java b/src/org/traccar/protocol/CarscopProtocolDecoder.java index dfc9b6fc2..e56036d0b 100644 --- a/src/org/traccar/protocol/CarscopProtocolDecoder.java +++ b/src/org/traccar/protocol/CarscopProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class CarscopProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public CarscopProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public CarscopProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public CarscopProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } // Very similar to TK103 protocol diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index feb7d2731..59350da22 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.nio.ByteOrder; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class CellocatorProtocolDecoder extends BaseProtocolDecoder { - public CellocatorProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public CellocatorProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public CellocatorProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private String readImei(ChannelBuffer buf) { diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index 33ff9991c..bbf1ce817 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { - public EasyTrackProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public EasyTrackProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public EasyTrackProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } //ET,358155100003016,HB,A,0d081e,07381e,8038ee09,03d2e9be,004f,0000,40c00000,0f,100,0000,00037c,29 diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index e57540a35..009baebd0 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.util.Calendar; import java.util.Date; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Crc; @@ -33,12 +35,8 @@ import org.traccar.model.Position; public class EelinkProtocolDecoder extends BaseProtocolDecoder { - public EelinkProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public EelinkProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public EelinkProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private String readImei(ChannelBuffer buf) { diff --git a/src/org/traccar/protocol/EnforaProtocolDecoder.java b/src/org/traccar/protocol/EnforaProtocolDecoder.java index 980f98c49..8f5391fd6 100644 --- a/src/org/traccar/protocol/EnforaProtocolDecoder.java +++ b/src/org/traccar/protocol/EnforaProtocolDecoder.java @@ -17,14 +17,16 @@ package org.traccar.protocol; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -33,12 +35,8 @@ import org.traccar.model.Position; public class EnforaProtocolDecoder extends BaseProtocolDecoder { - public EnforaProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public EnforaProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public EnforaProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java index 43f4f23e5..7c596d479 100644 --- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -33,12 +35,8 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ private Long deviceId; - public Ev603ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Ev603ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Ev603ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/FreedomProtocolDecoder.java b/src/org/traccar/protocol/FreedomProtocolDecoder.java index 7fa3e3f5c..21e6f9abc 100644 --- a/src/org/traccar/protocol/FreedomProtocolDecoder.java +++ b/src/org/traccar/protocol/FreedomProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class FreedomProtocolDecoder extends BaseProtocolDecoder { - public FreedomProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public FreedomProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public FreedomProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java index b5aeb6ae3..dc22c33cd 100644 --- a/src/org/traccar/protocol/GalileoProtocolDecoder.java +++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java @@ -23,13 +23,15 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -37,12 +39,8 @@ import org.traccar.model.Position; public class GalileoProtocolDecoder extends BaseProtocolDecoder { - public GalileoProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public GalileoProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public GalileoProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int TAG_IMEI = 0x03; diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 9ca7a07a1..9fb74dacc 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -16,12 +16,14 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class GatorProtocolDecoder extends BaseProtocolDecoder { - public GatorProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public GatorProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public GatorProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int PACKET_HEARTBEAT = 0x21; diff --git a/src/org/traccar/protocol/Gl100ProtocolDecoder.java b/src/org/traccar/protocol/Gl100ProtocolDecoder.java index 329a005b5..fb1e42cce 100644 --- a/src/org/traccar/protocol/Gl100ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl100ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Gl100ProtocolDecoder extends BaseProtocolDecoder { - public Gl100ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Gl100ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Gl100ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 8cccc7fae..f8f32effd 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Gl200ProtocolDecoder extends BaseProtocolDecoder { - public Gl200ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Gl200ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Gl200ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index de49d0b85..5e86c1ce3 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -20,10 +20,11 @@ import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,23 +32,19 @@ import org.traccar.model.Position; public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { + // Default values private String format0 = "TSPRXAB27GHKLMnaicz*U!"; private String format1 = "SARY*U!"; - public GlobalSatProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public GlobalSatProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public GlobalSatProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); - if (getServerManager() != null) { - Properties p = getServerManager().getProperties(); - if (p.containsKey(protocol + ".format0")) { - format0 = p.getProperty(protocol + ".format0"); + if (properties != null) { + if (properties.containsKey(protocol + ".format0")) { + format0 = properties.getProperty(protocol + ".format0"); } - if (p.containsKey(protocol + ".format1")) { - format1 = p.getProperty(protocol + ".format1"); + if (properties.containsKey(protocol + ".format1")) { + format1 = properties.getProperty(protocol + ".format1"); } } } diff --git a/src/org/traccar/protocol/GotopProtocolDecoder.java b/src/org/traccar/protocol/GotopProtocolDecoder.java index 48ec0174d..2e49a5dd0 100644 --- a/src/org/traccar/protocol/GotopProtocolDecoder.java +++ b/src/org/traccar/protocol/GotopProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class GotopProtocolDecoder extends BaseProtocolDecoder { - public GotopProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public GotopProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public GotopProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 41072c4ee..5ff74e1f1 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.net.SocketAddress; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class Gps103ProtocolDecoder extends BaseProtocolDecoder { - public Gps103ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Gps103ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Gps103ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java index 1bac7fe8a..80e06c911 100644 --- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -33,12 +35,8 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public GpsGateProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public GpsGateProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public GpsGateProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } /** diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java index 5c113c248..546f7dc56 100644 --- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Gt02ProtocolDecoder extends BaseProtocolDecoder { - public Gt02ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Gt02ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Gt02ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private String readImei(ChannelBuffer buf) { diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 10fa20f65..0ef242b05 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.util.Calendar; import java.util.Properties; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -35,18 +37,13 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; private final TimeZone timeZone = TimeZone.getTimeZone("UTC"); - public Gt06ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Gt06ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Gt06ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); - if (serverManager != null) { - Properties p = getServerManager().getProperties(); - if (p.containsKey(protocol + ".timezone")) { + if (properties != null) { + if (properties.containsKey(protocol + ".timezone")) { timeZone.setRawOffset( - Integer.valueOf(p.getProperty(protocol + ".timezone")) * 1000); + Integer.valueOf(properties.getProperty(protocol + ".timezone")) * 1000); } } } diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index bf8c4e054..c67eb6053 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -17,14 +17,16 @@ package org.traccar.protocol; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -33,12 +35,8 @@ import org.traccar.model.Position; public class H02ProtocolDecoder extends BaseProtocolDecoder { - public H02ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public H02ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public H02ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static double readCoordinate(ChannelBuffer buf, boolean lon) { diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index ba179ad33..ff7445451 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class HaicomProtocolDecoder extends BaseProtocolDecoder { - public HaicomProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public HaicomProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public HaicomProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java index 7d79cf8a2..fa1837e50 100644 --- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java +++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class IntellitracProtocolDecoder extends BaseProtocolDecoder { - public IntellitracProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public IntellitracProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public IntellitracProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index bbf5aa43d..197b4103a 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -17,14 +17,16 @@ package org.traccar.protocol; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -33,12 +35,8 @@ import org.traccar.model.Position; public class Jt600ProtocolDecoder extends BaseProtocolDecoder { - public Jt600ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Jt600ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Jt600ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private Position decodeNormalMessage(ChannelBuffer buf) throws Exception { diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java index eb359ce54..022def9eb 100644 --- a/src/org/traccar/protocol/KhdProtocolDecoder.java +++ b/src/org/traccar/protocol/KhdProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Crc; @@ -32,12 +34,8 @@ import org.traccar.model.Position; public class KhdProtocolDecoder extends BaseProtocolDecoder { - public KhdProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public KhdProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public KhdProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private String readSerialNumber(ChannelBuffer buf) { diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index 3b30ea672..f95109b80 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class LaipacProtocolDecoder extends BaseProtocolDecoder { - public LaipacProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public LaipacProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public LaipacProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/M2mProtocolDecoder.java b/src/org/traccar/protocol/M2mProtocolDecoder.java index a3ae072bb..46442fb4f 100644 --- a/src/org/traccar/protocol/M2mProtocolDecoder.java +++ b/src/org/traccar/protocol/M2mProtocolDecoder.java @@ -16,12 +16,14 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -29,12 +31,8 @@ import org.traccar.model.Position; public class M2mProtocolDecoder extends BaseProtocolDecoder { - public M2mProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public M2mProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public M2mProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private boolean firstPacket = true; diff --git a/src/org/traccar/protocol/ManPowerProtocolDecoder.java b/src/org/traccar/protocol/ManPowerProtocolDecoder.java index ed177a334..449a1b532 100644 --- a/src/org/traccar/protocol/ManPowerProtocolDecoder.java +++ b/src/org/traccar/protocol/ManPowerProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class ManPowerProtocolDecoder extends BaseProtocolDecoder { - public ManPowerProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public ManPowerProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public ManPowerProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/MaxonProtocolDecoder.java b/src/org/traccar/protocol/MaxonProtocolDecoder.java index b85144fea..eb1e43885 100644 --- a/src/org/traccar/protocol/MaxonProtocolDecoder.java +++ b/src/org/traccar/protocol/MaxonProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.Position; @@ -44,12 +46,8 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder { /** * Initialize */ - public MaxonProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public MaxonProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public MaxonProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } /** diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index 3ad3f9494..2eed12fce 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class MegastekProtocolDecoder extends BaseProtocolDecoder { - public MegastekProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public MegastekProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public MegastekProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern patternGPRMC = Pattern.compile( diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 2d56f6f0f..7dcfdb200 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -18,15 +18,17 @@ package org.traccar.protocol; import java.net.InetSocketAddress; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -35,12 +37,8 @@ import org.traccar.model.Position; public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { - public MeiligaoProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public MeiligaoProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public MeiligaoProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( @@ -119,10 +117,10 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { } private String getMeiligaoServer(Channel channel) { + Properties p = getProperties(); - if (getServerManager() != null && - getServerManager().getProperties().containsKey(getProtocol() + ".server")) { - return getServerManager().getProperties().getProperty(getProtocol() + ".server"); + if (p != null && p.containsKey(getProtocol() + ".server")) { + return p.getProperty(getProtocol() + ".server"); } else { InetSocketAddress address = (InetSocketAddress) channel.getLocalAddress(); return address.getAddress().getHostAddress() + ":" + address.getPort(); diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 25190aef7..9df10c8fb 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -20,14 +20,16 @@ import java.util.Calendar; import java.util.Date; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -36,12 +38,8 @@ import org.traccar.model.Position; public class MeitrackProtocolDecoder extends BaseProtocolDecoder { - public MeitrackProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public MeitrackProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public MeitrackProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } //$$J163,123123123123123,AFF,0004,35,58.588926,16.180473,140928192856,A,10,27,0,161,1.2,19 diff --git a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java index 6963e13d2..9a6c7396c 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public MiniFinderProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public MiniFinderProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public MiniFinderProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index b8e1a3db1..d8d1b9f98 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -20,7 +20,9 @@ import java.util.Calendar; import java.util.Date; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; @@ -30,8 +32,8 @@ import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.handler.codec.http.HttpResponseStatus; import org.jboss.netty.handler.codec.http.HttpVersion; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -42,12 +44,8 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { private boolean simple; - public Mta6ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Mta6ProtocolDecoder(ServerManager serverManager, String protocol, boolean simple) { - super(serverManager, protocol); + public Mta6ProtocolDecoder(DataManager dataManager, String protocol, Properties properties, boolean simple) { + super(dataManager, protocol, properties); this.simple = simple; } diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index f34293480..eb9ad96d3 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -17,12 +17,14 @@ package org.traccar.protocol; import java.nio.ByteOrder; import java.util.Date; +import java.util.Properties; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Crc; import org.traccar.helper.Log; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class NavigilProtocolDecoder extends BaseProtocolDecoder { - public NavigilProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public NavigilProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public NavigilProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int LEAP_SECONDS_DELTA = 25; diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index e2471b23b..4646d215f 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -20,13 +20,15 @@ import java.nio.charset.Charset; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -42,12 +44,8 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { private String imei; private Long databaseDeviceId; - public NavisProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public NavisProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public NavisProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } // Format types diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index 5248eb266..161d07a50 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -19,13 +19,15 @@ import java.net.SocketAddress; import java.nio.ByteOrder; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -33,12 +35,8 @@ import org.traccar.model.Position; public class NoranProtocolDecoder extends BaseProtocolDecoder { - public NoranProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public NoranProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public NoranProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int MSG_UPLOAD_POSITION = 0x0008; diff --git a/src/org/traccar/protocol/OrionProtocolDecoder.java b/src/org/traccar/protocol/OrionProtocolDecoder.java index af5b4b706..6ba665614 100644 --- a/src/org/traccar/protocol/OrionProtocolDecoder.java +++ b/src/org/traccar/protocol/OrionProtocolDecoder.java @@ -18,13 +18,15 @@ package org.traccar.protocol; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ import org.traccar.model.Position; public class OrionProtocolDecoder extends BaseProtocolDecoder { - public OrionProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public OrionProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public OrionProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int TYPE_USERLOG = 0; diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index 6f54dc223..d469e0b03 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -21,6 +21,8 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Properties; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelFutureListener; import org.jboss.netty.channel.ChannelHandlerContext; @@ -30,8 +32,8 @@ import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.handler.codec.http.HttpResponseStatus; import org.jboss.netty.handler.codec.http.HttpVersion; import org.jboss.netty.handler.codec.http.QueryStringDecoder; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -39,12 +41,8 @@ import org.traccar.model.Position; public class OsmAndProtocolDecoder extends BaseProtocolDecoder { - public OsmAndProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public OsmAndProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public OsmAndProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } @Override diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index 5336102a9..02c86152d 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -20,7 +20,9 @@ import java.nio.charset.Charset; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; @@ -31,8 +33,8 @@ import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.handler.codec.http.HttpResponseStatus; import org.jboss.netty.handler.codec.http.HttpVersion; import org.jboss.netty.handler.codec.http.QueryStringDecoder; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -40,12 +42,8 @@ import org.traccar.model.Position; public class PiligrimProtocolDecoder extends BaseProtocolDecoder { - public PiligrimProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public PiligrimProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public PiligrimProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private void sendResponse(Channel channel, String message) { diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index 89431b8f9..3f120445c 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -20,13 +20,15 @@ import java.nio.charset.Charset; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -41,12 +43,8 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { private long lastIndex; private long newIndex; - public ProgressProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public ProgressProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public ProgressProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } /* diff --git a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java index 0b750e97a..86c438f6c 100644 --- a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Pt3000ProtocolDecoder extends BaseProtocolDecoder { - public Pt3000ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Pt3000ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Pt3000ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index e0f16033e..72f95a0f6 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class Pt502ProtocolDecoder extends BaseProtocolDecoder { - public Pt502ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Pt502ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Pt502ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index a6d549e7c..4bc04501c 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -17,14 +17,16 @@ package org.traccar.protocol; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; @@ -33,12 +35,8 @@ import org.traccar.model.Position; public class RitiProtocolDecoder extends BaseProtocolDecoder { - public RitiProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public RitiProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public RitiProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/org/traccar/protocol/RuptelaProtocolDecoder.java index a958e8baa..0574aa2d8 100644 --- a/src/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -18,12 +18,14 @@ package org.traccar.protocol; import java.util.Date; import java.util.LinkedList; import java.util.List; +import java.util.Properties; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class RuptelaProtocolDecoder extends BaseProtocolDecoder { - public RuptelaProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public RuptelaProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public RuptelaProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final int COMMAND_RECORDS = 0x01; diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index 05d48dfde..343dc87c8 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class SanavProtocolDecoder extends BaseProtocolDecoder { - public SanavProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public SanavProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public SanavProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index bec126e85..aa47e42fb 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -17,12 +17,14 @@ package org.traccar.protocol; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { - public SkypatrolProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public SkypatrolProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public SkypatrolProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static boolean checkBit(long mask, int bit) { diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java index c07ac8e92..51af0941e 100644 --- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java +++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Stl060ProtocolDecoder extends BaseProtocolDecoder { - public Stl060ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Stl060ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Stl060ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java index 8e8b7d210..868425e8d 100644 --- a/src/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class SuntechProtocolDecoder extends BaseProtocolDecoder { - public SuntechProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public SuntechProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public SuntechProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/SyrusProtocolDecoder.java b/src/org/traccar/protocol/SyrusProtocolDecoder.java index 989544aba..72347ac03 100644 --- a/src/org/traccar/protocol/SyrusProtocolDecoder.java +++ b/src/org/traccar/protocol/SyrusProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.util.Calendar; import java.util.Date; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -33,13 +35,9 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder { boolean sendResponse; - public SyrusProtocolDecoder(DataManager dataManager, boolean sendResponse) { - super(dataManager); - this.sendResponse = sendResponse; - } - public SyrusProtocolDecoder(ServerManager serverManager, String protocol, boolean sendResponse) { - super(serverManager, protocol); + public SyrusProtocolDecoder(DataManager dataManager, String protocol, Properties properties, boolean sendResponse) { + super(dataManager, protocol, properties); this.sendResponse = sendResponse; } diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index a687fb07a..0f2da7d65 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public T55ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public T55ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public T55ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern patternGPRMC = Pattern.compile( diff --git a/src/org/traccar/protocol/TelikProtocolDecoder.java b/src/org/traccar/protocol/TelikProtocolDecoder.java index 76cc9adbb..84dd6fb0b 100644 --- a/src/org/traccar/protocol/TelikProtocolDecoder.java +++ b/src/org/traccar/protocol/TelikProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class TelikProtocolDecoder extends BaseProtocolDecoder { - public TelikProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public TelikProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public TelikProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index bf7423ad9..62d3db539 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -19,12 +19,14 @@ import java.nio.charset.Charset; import java.util.Date; import java.util.LinkedList; import java.util.List; +import java.util.Properties; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -34,12 +36,8 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { private long deviceId; - public TeltonikaProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public TeltonikaProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public TeltonikaProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private void parseIdentification(Channel channel, ChannelBuffer buf) { diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java index 0bdd3ec0e..bb9a5fbd2 100644 --- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public Tk102ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Tk102ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Tk102ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index 6b4cd864c..f5ce44c60 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Tk103ProtocolDecoder extends BaseProtocolDecoder { - public Tk103ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Tk103ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Tk103ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index 49093e1ec..0e17fc70c 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -18,13 +18,15 @@ package org.traccar.protocol; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ import org.traccar.model.Position; public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { - public Tlt2hProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Tlt2hProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Tlt2hProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern patternHeader = Pattern.compile( diff --git a/src/org/traccar/protocol/TopflytechProtocolDecoder.java b/src/org/traccar/protocol/TopflytechProtocolDecoder.java index cbdb309de..9e9a7e3e3 100644 --- a/src/org/traccar/protocol/TopflytechProtocolDecoder.java +++ b/src/org/traccar/protocol/TopflytechProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class TopflytechProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public TopflytechProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public TopflytechProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public TopflytechProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 4cdf24f51..5e49141b7 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class TotemProtocolDecoder extends BaseProtocolDecoder { - public TotemProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public TotemProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public TotemProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern patternFirst = Pattern.compile( diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java index fe047dba0..fb6f319d5 100644 --- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Tr20ProtocolDecoder extends BaseProtocolDecoder { - public Tr20ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Tr20ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Tr20ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern patternPing = Pattern.compile( diff --git a/src/org/traccar/protocol/TrackboxProtocolDecoder.java b/src/org/traccar/protocol/TrackboxProtocolDecoder.java index d53ee81ce..186bc24cd 100644 --- a/src/org/traccar/protocol/TrackboxProtocolDecoder.java +++ b/src/org/traccar/protocol/TrackboxProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class TrackboxProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public TrackboxProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public TrackboxProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public TrackboxProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index d07804793..81fd393e0 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public V680ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public V680ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public V680ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/VisiontekProtocolDecoder.java b/src/org/traccar/protocol/VisiontekProtocolDecoder.java index baa2d470b..242ac1083 100644 --- a/src/org/traccar/protocol/VisiontekProtocolDecoder.java +++ b/src/org/traccar/protocol/VisiontekProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class VisiontekProtocolDecoder extends BaseProtocolDecoder { - public VisiontekProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public VisiontekProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public VisiontekProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index e4047adc5..65cc17bcd 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -18,13 +18,15 @@ package org.traccar.protocol; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -34,12 +36,8 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { private Long deviceId; - public WialonProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public WialonProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public WialonProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java index e3dc9329e..a9068e7be 100644 --- a/src/org/traccar/protocol/WondexProtocolDecoder.java +++ b/src/org/traccar/protocol/WondexProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class WondexProtocolDecoder extends BaseProtocolDecoder { - public WondexProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public WondexProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public WondexProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java index 5af4614b4..3a9e1129e 100644 --- a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { - public Xexun2ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Xexun2ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Xexun2ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } static private Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 92b1c103f..01ce44964 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -17,13 +17,15 @@ package org.traccar.protocol; import java.text.ParseException; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -31,12 +33,8 @@ import org.traccar.model.Position; public class XexunProtocolDecoder extends BaseProtocolDecoder { - public XexunProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public XexunProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public XexunProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/Xt7ProtocolDecoder.java b/src/org/traccar/protocol/Xt7ProtocolDecoder.java index a8815f3cb..bd46cee37 100644 --- a/src/org/traccar/protocol/Xt7ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt7ProtocolDecoder.java @@ -17,14 +17,16 @@ package org.traccar.protocol; import java.nio.charset.Charset; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -32,12 +34,8 @@ import org.traccar.model.Position; public class Xt7ProtocolDecoder extends BaseProtocolDecoder { - public Xt7ProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public Xt7ProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public Xt7ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/src/org/traccar/protocol/YwtProtocolDecoder.java b/src/org/traccar/protocol/YwtProtocolDecoder.java index 61eb8b487..5392a4ccf 100644 --- a/src/org/traccar/protocol/YwtProtocolDecoder.java +++ b/src/org/traccar/protocol/YwtProtocolDecoder.java @@ -16,13 +16,15 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; + import org.traccar.BaseProtocolDecoder; -import org.traccar.ServerManager; import org.traccar.database.DataManager; import org.traccar.helper.Log; import org.traccar.model.ExtendedInfoFormatter; @@ -30,12 +32,8 @@ import org.traccar.model.Position; public class YwtProtocolDecoder extends BaseProtocolDecoder { - public YwtProtocolDecoder(DataManager dataManager) { - super(dataManager); - } - - public YwtProtocolDecoder(ServerManager serverManager, String protocol) { - super(serverManager, protocol); + public YwtProtocolDecoder(DataManager dataManager, String protocol, Properties properties) { + super(dataManager, protocol, properties); } private static final Pattern pattern = Pattern.compile( diff --git a/test/org/traccar/protocol/ApelProtocolDecoderTest.java b/test/org/traccar/protocol/ApelProtocolDecoderTest.java index a843be8dc..3d96563f6 100644 --- a/test/org/traccar/protocol/ApelProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ApelProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class ApelProtocolDecoderTest { @Test public void testDecode() throws Exception { - ApelProtocolDecoder decoder = new ApelProtocolDecoder(new TestDataManager()); + ApelProtocolDecoder decoder = new ApelProtocolDecoder(new TestDataManager(), null, null); /*byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1)));*/ diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java index 49be44016..ad2b2ab38 100644 --- a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java @@ -11,7 +11,7 @@ public class AplicomProtocolDecoderTest { @Test public void testDecode() throws Exception { - AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new TestDataManager()); + AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x44,0xC2,0x01,0x43,0x72,0x07,0x29,0xD6,0x84,0x00,0x43,0x03,0x1f,0xff,0x71,0x91,0xC0,0x45,0x0e,0xf9,0x06,0x45,0x0e,0xf9,0x06,0x03,0xb2,0x0b,0x80,0x03,0xb2,0x0b,0x80,0x06,0x64,0x65,0xb3,0x87,0x0c,0xe3,0x0f,0x01,0x0c,0xe3,0x0c,0xe3,0x00,0x32,0x00,0x00,0x15,0x20,0x00,0x00,0x00,0x03,0x0a,0xa2,0x00,0x00,0x3b,0x13,0x00,0x00,0x00,0x32,0x03,0x00,0x00,0x0b,0xcb,0x17,0xac,0xff,0x00,0x99,0x00,0x01,0x86,0xa0,0x02}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/AtrackProtocolDecoderTest.java b/test/org/traccar/protocol/AtrackProtocolDecoderTest.java index 4d94c004f..5911bf0ab 100644 --- a/test/org/traccar/protocol/AtrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AtrackProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class AtrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - AtrackProtocolDecoder decoder = new AtrackProtocolDecoder(new TestDataManager()); + AtrackProtocolDecoder decoder = new AtrackProtocolDecoder(new TestDataManager(), null, null); //int[] buf1 = {0xfe,0x02,0x00,0x01,0x41,0x04,0xd8,0xf1,0x96,0x82,0x00,0x01}; //assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/BoxProtocolDecoderTest.java b/test/org/traccar/protocol/BoxProtocolDecoderTest.java index e0a4dfa2e..94404d4bc 100644 --- a/test/org/traccar/protocol/BoxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/BoxProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class BoxProtocolDecoderTest { @Test public void testDecode() throws Exception { - BoxProtocolDecoder decoder = new BoxProtocolDecoder(new TestDataManager()); + BoxProtocolDecoder decoder = new BoxProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "H,BT,358281002435893,081028142432,F5813D19,6D6E6DC2")); diff --git a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java index 62a3b5c3a..fa19f485f 100644 --- a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class CarTrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - CarTrackProtocolDecoder decoder = new CarTrackProtocolDecoder(new TestDataManager()); + CarTrackProtocolDecoder decoder = new CarTrackProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "$$2222234???????&A9955&B102904.000,A,2233.0655,N,11404.9440,E,0.00,,030109,,*17|6.3|&C0100000100&D000024?>&E10000000&Y00100020")); diff --git a/test/org/traccar/protocol/CarscopProtocolDecoderTest.java b/test/org/traccar/protocol/CarscopProtocolDecoderTest.java index 4ec3a14d4..8c75c2437 100644 --- a/test/org/traccar/protocol/CarscopProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CarscopProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class CarscopProtocolDecoderTest { @Test public void testDecode() throws Exception { - CarscopProtocolDecoder decoder = new CarscopProtocolDecoder(new TestDataManager()); + CarscopProtocolDecoder decoder = new CarscopProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "*040331141830UB05123456789012345061825A2934.0133N10627.2544E000.0040331309.6200000000L000000")); diff --git a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java index 054be2e0f..3064afe02 100644 --- a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class CellocatorProtocolDecoderTest { @Test public void testDecode() throws Exception { - CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(new TestDataManager()); + CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x4D,0x43,0x47,0x50,0x00,0x06,0x00,0x00,0x00,0x08,0x1A,0x02,0x02,0x12,0x04,0x00,0x00,0x00,0x21,0x00,0x62,0x30,0x00,0x00,0x00,0x6B,0x00,0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE5,0xA1,0x00,0x04,0x02,0x06,0x61,0x4E,0xA3,0x03,0x18,0x1A,0x57,0x03,0x4E,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x25,0x07,0x14,0x03,0xD6,0x07,0x49}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java index 8a82c5901..8a62e0f14 100644 --- a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class EasyTrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(new TestDataManager()); + EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "*ET,135790246811221,GZ,0001,0005")); diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java index 4d87ef144..60d48fead 100644 --- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class EelinkProtocolDecoderTest { @Test public void testDecode() throws Exception { - EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(new TestDataManager()); + EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x67,0x67,0x01,0x00,0x0b,0x00,0x1b,0x03,0x54,0x18,0x80,0x46,0x61,0x83,0x49,0x01})))); diff --git a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java index 38c63d16b..4dd559d42 100644 --- a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java @@ -14,7 +14,7 @@ public class EnforaProtocolDecoderTest { @Test public void testDecode() throws Exception { - EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(new TestDataManager()); + EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(new TestDataManager(), null, null); ChannelBufferFactory factory = new HeapChannelBufferFactory(); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( diff --git a/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java b/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java index 8be4a7596..0fd062e97 100644 --- a/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Ev603ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Ev603ProtocolDecoder decoder = new Ev603ProtocolDecoder(new TestDataManager()); + Ev603ProtocolDecoder decoder = new Ev603ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "!1,123456789012345")); diff --git a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java index acd495d91..e58de3bb1 100644 --- a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class FreedomProtocolDecoderTest { @Test public void testDecode() throws Exception { - FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(new TestDataManager()); + FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "IMEI,353358011714362,2014/05/22, 20:49:32, N, Lat:4725.9624, E, Lon:01912.5483, Spd:5.05")); diff --git a/test/org/traccar/protocol/GalileoProtocolDecoderTest.java b/test/org/traccar/protocol/GalileoProtocolDecoderTest.java index 5d1e06230..4ece965a6 100644 --- a/test/org/traccar/protocol/GalileoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GalileoProtocolDecoderTest.java @@ -13,7 +13,7 @@ public class GalileoProtocolDecoderTest { @Test public void testDecode() throws Exception { - GalileoProtocolDecoder decoder = new GalileoProtocolDecoder(new TestDataManager()); + GalileoProtocolDecoder decoder = new GalileoProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x01,0x13,(byte)0x80,0x03,0x38,0x36,0x38,0x32,0x30,0x34,0x30,0x30,0x31,0x35,0x34,0x39,0x30,0x38,0x37,0x04,0x32,0x00,(byte)0x85,(byte)0x90}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/GatorProtocolDecoderTest.java b/test/org/traccar/protocol/GatorProtocolDecoderTest.java index dac0b5b7d..09e5a1ccb 100644 --- a/test/org/traccar/protocol/GatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GatorProtocolDecoderTest.java @@ -11,7 +11,7 @@ public class GatorProtocolDecoderTest { @Test public void testDecode() throws Exception { - GatorProtocolDecoder decoder = new GatorProtocolDecoder(new TestDataManager()); + GatorProtocolDecoder decoder = new GatorProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x24,0x24,0x81,0x00,0x23,0x0C,0xA2,0x32,0x85,0x10,0x03,0x06,0x14,0x59,0x07,0x02,0x23,0x46,0x90,0x11,0x35,0x29,0x47,0x00,0x00,0x00,0x00,0xC0,0x40,0x01,0x01,0x2C,0x0E,0x11,0x00,0x00,0x00,0x21,0xCB,0x0D}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java index 149279224..0d5a5bc24 100644 --- a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Gl100ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager()); + Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "AT+GTHBD=HeartBeat,359231030000010,20090101000000,11F0,0102120204")); diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 9d2b233a9..a8c0816ed 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Gl200ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new TestDataManager()); + Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "+RESP:GTFRI,02010D,867844001675407,,0,0,1,2,0.0,0,28.9,8.591011,56.476397,20140915213209,0238,0001,03CB,2871,,97,20140915213459,009A")); diff --git a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java index 68a3dc8cf..f15770bd0 100644 --- a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class GlobalSatProtocolDecoderTest { @Test public void testDecode() throws Exception { - GlobalSatProtocolDecoder decoder = new GlobalSatProtocolDecoder(new TestDataManager()); + GlobalSatProtocolDecoder decoder = new GlobalSatProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "GSh,131826789036289,3,M,ea04*3d")); diff --git a/test/org/traccar/protocol/GotopProtocolDecoderTest.java b/test/org/traccar/protocol/GotopProtocolDecoderTest.java index fe999fc1a..79d35e5a7 100644 --- a/test/org/traccar/protocol/GotopProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GotopProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class GotopProtocolDecoderTest { @Test public void testDecode() throws Exception { - GotopProtocolDecoder decoder = new GotopProtocolDecoder(new TestDataManager()); + GotopProtocolDecoder decoder = new GotopProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "")); diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 75b7279f8..756c0a5cb 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Gps103ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager()); + Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager(), null, null); // Log on request assertNull(decoder.decode(null, null, null, "##,imei:359586015829802,A")); diff --git a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java index 312232b9b..812f63873 100644 --- a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class GpsGateProtocolDecoderTest { @Test public void testDecode() throws Exception { - GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new TestDataManager()); + GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "$FRLIN,,user1,8IVHF*7A")); diff --git a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java index b7b3b2f1f..ccd6ba789 100644 --- a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class Gt02ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(new TestDataManager()); + Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x68,0x68,0x25,0x00,0x00,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x00,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x6B,0x3F,0x3E,0x02,0x6B,0x3F,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0D,0x0A})))); diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index de52dce1f..1536644a0 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class Gt06ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(new TestDataManager()); + Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x78,0x78,0x11,0x01,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x10,0x0B,0x32,0x01,0x00,0x01,0x71,0x93,0x0D,0x0A})))); diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index 47d20c89b..d1800f3f3 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -13,7 +13,7 @@ public class H02ProtocolDecoderTest { @Test public void testDecode() throws Exception { - H02ProtocolDecoder decoder = new H02ProtocolDecoder(new TestDataManager()); + H02ProtocolDecoder decoder = new H02ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, ChannelBuffers.copiedBuffer( "*HQ,353588020068342,V1,000000,V,0.0000,0,0.0000,0,0.00,0.00,000000,ffffffff,000106,000002,000203,004c87,16#", Charset.defaultCharset()))); diff --git a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java index c46c8afe3..342d6204b 100644 --- a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class HaicomProtocolDecoderTest { @Test public void testDecode() throws Exception { - HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(new TestDataManager()); + HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "$GPRS123456789012345,602S19A,100915,063515,7240649312041079,0019,3156,111000,10004,0000,11111,00LH#V037")); diff --git a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java index 2fc9b8201..33c3fd3cd 100644 --- a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java +++ b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class IntellitracProtocolDecoderTest { @Test public void testDecode() throws Exception { - IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(new TestDataManager()); + IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "$OK:TRACKING")); diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 4a90e8d55..93dd7d209 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -11,7 +11,7 @@ public class Jt600ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new TestDataManager()); + Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new TestDataManager(), null, null); byte[] buf1 = {0x24,0x31,0x10,0x21,0x60,0x01,0x11,0x00,0x1B,0x16,0x02,0x11,0x05,0x59,0x10,0x22,0x32,(byte)0x98,0x62,0x11,0x40,0x46,0x22,0x7B,0x05,(byte)0x98,0x09,0x50,(byte)0x80,0x01,0x23,0x27,(byte)0x95,0x14,0x35,0x16,0x1F}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf1))); diff --git a/test/org/traccar/protocol/KhdProtocolDecoderTest.java b/test/org/traccar/protocol/KhdProtocolDecoderTest.java index 9f6aecf37..7d196df25 100644 --- a/test/org/traccar/protocol/KhdProtocolDecoderTest.java +++ b/test/org/traccar/protocol/KhdProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class KhdProtocolDecoderTest { @Test public void testDecode() throws Exception { - KhdProtocolDecoder decoder = new KhdProtocolDecoder(new TestDataManager()); + KhdProtocolDecoder decoder = new KhdProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x29,0x29,0xb1,0x00,0x06,0x05,0x16,0x29,0x35,0xb8,0x0d})))); diff --git a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java index b66cf818e..fcfa4e98e 100644 --- a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java +++ b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class LaipacProtocolDecoderTest { @Test public void testDecode() throws Exception { - LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(new TestDataManager()); + LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "$AVSYS,99999999,V1.50,SN0000103,32768*15")); diff --git a/test/org/traccar/protocol/M2mProtocolDecoderTest.java b/test/org/traccar/protocol/M2mProtocolDecoderTest.java index bfe6f0df9..2e481d47f 100644 --- a/test/org/traccar/protocol/M2mProtocolDecoderTest.java +++ b/test/org/traccar/protocol/M2mProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class M2mProtocolDecoderTest { @Test public void testDecode() throws Exception { - M2mProtocolDecoder decoder = new M2mProtocolDecoder(new TestDataManager()); + M2mProtocolDecoder decoder = new M2mProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x23,0x5A,0x3C,0x2A,0x26,0x24,0x21,0x5C,0x28,0x7D,0x70,0x21,0x2A,0x21,0x25,0x4C,0x7C,0x64,0x21,0x22,0x0B,0x0B,0x0B}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java b/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java index a12b93b0e..235778dd2 100644 --- a/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class ManPowerProtocolDecoderTest { @Test public void testDecode() throws Exception { - ManPowerProtocolDecoder decoder = new ManPowerProtocolDecoder(new TestDataManager()); + ManPowerProtocolDecoder decoder = new ManPowerProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "simei:352581250259539,,,tracker,51,24,1.73,130426023608,A,3201.5462,N,03452.2975,E,0.01,28B9,1DED,425,01,1x0x0*0x1*60x+2,en-us,")); diff --git a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java index 99a40f8de..7a25ff340 100644 --- a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class MegastekProtocolDecoderTest { @Test public void testDecode() throws Exception { - MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(new TestDataManager()); + MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "STX,GerAL22,$GPRMC,174752.000,A,3637.060059,S,6416.2354,W,0.00,0.00,030812,,,A*55,F,,imei:861785000249353,05,180.6,Battery=100%,,1,722,310,0FA6,39D0;8F")); diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index bc053ce85..9a00b487e 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class MeiligaoProtocolDecoderTest { @Test public void testDecode() throws Exception { - MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new TestDataManager()); + MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[]{0x24,0x24,0x00,0x00,0x12,0x34,0x56,0xFF,0xFF,0xFF,0xFF,0x50,0x00,0x8B,0x9B,0x0D,0x0A})))); diff --git a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java index 81bbd0464..17a651f38 100644 --- a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java @@ -13,7 +13,7 @@ public class MeitrackProtocolDecoderTest { @Test public void testDecode() throws Exception { - MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(new TestDataManager()); + MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, ChannelBuffers.copiedBuffer( "$$X138,862170010187175,AAA,35,-29.960365,-51.655455,130507201625,A,8,9,0,107,0.9,7,169322,126582,724|6|0547|132B,0000,0009|000A||0278|0000,*BE", Charset.defaultCharset()))); diff --git a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java index 6ecfd01cf..c377a11c8 100644 --- a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class MiniFinderProtocolDecoderTest { @Test public void testDecode() throws Exception { - MiniFinderProtocolDecoder decoder = new MiniFinderProtocolDecoder(new TestDataManager()); + MiniFinderProtocolDecoder decoder = new MiniFinderProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "!1,860719020212696")); diff --git a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java index e670872ff..cf3372313 100644 --- a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class NavigilProtocolDecoderTest { @Test public void testDecode() throws Exception { - NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(new TestDataManager()); + NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(new TestDataManager(), null, null); byte[] buf1 = {0x01,0x00,0x43,0x00,0x04,0x00,0x20,0x00,0x00,0x00,(byte)0xf6,0x02,0x03,0x08,0x02,0x00,(byte)0xe7,(byte)0xcd,0x0f,0x51,0x0c,0x00,0x00,0x00,0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1))); diff --git a/test/org/traccar/protocol/NavisProtocolDecoderTest.java b/test/org/traccar/protocol/NavisProtocolDecoderTest.java index 78f7cb0bd..716b13eaf 100644 --- a/test/org/traccar/protocol/NavisProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavisProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class NavisProtocolDecoderTest { @Test public void testDecode() throws Exception { - NavisProtocolDecoder decoder = new NavisProtocolDecoder(new TestDataManager()); + NavisProtocolDecoder decoder = new NavisProtocolDecoder(new TestDataManager(), null, null); byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1))); diff --git a/test/org/traccar/protocol/NoranProtocolDecoderTest.java b/test/org/traccar/protocol/NoranProtocolDecoderTest.java index 8cf685fdc..83ecac0d0 100644 --- a/test/org/traccar/protocol/NoranProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NoranProtocolDecoderTest.java @@ -13,7 +13,7 @@ public class NoranProtocolDecoderTest { @Test public void testDecode() throws Exception { - NoranProtocolDecoder decoder = new NoranProtocolDecoder(new TestDataManager()); + NoranProtocolDecoder decoder = new NoranProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x0f,0x00,0x00,0x00,0x4e,0x52,0x30,0x39,0x46,0x30,0x34,0x31,0x35,0x35,0x00}; assertNull(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/OrionProtocolDecoderTest.java b/test/org/traccar/protocol/OrionProtocolDecoderTest.java index 3ec8b257e..6c3d1b55d 100644 --- a/test/org/traccar/protocol/OrionProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OrionProtocolDecoderTest.java @@ -13,7 +13,7 @@ public class OrionProtocolDecoderTest { @Test public void testDecode() throws Exception { - OrionProtocolDecoder decoder = new OrionProtocolDecoder(new TestDataManager()); + OrionProtocolDecoder decoder = new OrionProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray( new int[] {0x50,0x57,0x00,0x41,0x07,0x36,0x7C,0x24,0x2B,0x44,0x09,0x01,0xAD,0xE9,0x7D,0x01,0x63,0x14,0x3B,0x07,0xB0,0x03,0x00,0x00,0x00,0x00,0x0D,0x04,0x19,0x17,0x38,0x2D,0x00,0x0B,0x01,0x01,0x00,0x05,0x11,0x00,0x00,0x00,0x00,0x06,0x82,0x05,0x00,0x00,0x00,0x8E,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,0x03,0x00,0x84,0x03,0x00,0x85,0x03,0x00,0x09,0x0A,0x00,0x00,0x00,0x00,0x48,0x01,0x00,0x00,0x00,0x8A,0xFC})))); diff --git a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java index 32bba92b7..94b0eb91b 100644 --- a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class OsmAndProtocolDecoderTest { @Test public void testDecode() throws Exception { - OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(new TestDataManager()); + OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/?lat=49.60688&lon=6.15788×tamp=2014-06-04+09%3A10%3A11&altitude=384.7&speed=0.0&id=353861053849681"))); diff --git a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java index b2a33c63c..9fcab0dd5 100644 --- a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java +++ b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java @@ -16,7 +16,7 @@ public class PiligrimProtocolDecoderTest { @Test public void testDecode() throws Exception { - PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(new TestDataManager()); + PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(new TestDataManager(), null, null); HttpRequest msg1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/bingps?imei=868204005544720&csq=18&vout=00&vin=4050&dataid=00000000"); int[] buf1 = {0xff,0xf2,0x20,0x0d,0x41,0x10,0x06,0x1a,0x32,0x35,0x4f,0x34,0x22,0x31,0x00,0x62,0x00,0x0a,0x00,0x05,0x17,0x3b,0x00,0x00,0xa1,0x01,0x00,0x03,0x00,0x00,0x5e,0x00,0xff,0xf2,0x20,0x0d,0x41,0x10,0x10,0x09,0x32,0x35,0x4f,0x2b,0x22,0x31,0x00,0x42,0x00,0x0b,0x00,0x0e,0x17,0x3b,0x00,0x00,0x9f,0x01,0x00,0x07,0x00,0x00,0x60,0x00}; diff --git a/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java index cbc31b1b6..3aba53b69 100644 --- a/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class Pt3000ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Pt3000ProtocolDecoder decoder = new Pt3000ProtocolDecoder(new TestDataManager()); + Pt3000ProtocolDecoder decoder = new Pt3000ProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "%356939010012099,$GPRMC,124945.752,A,4436.6245,N,01054.4634,E,0.11,358.52,060408,,,A,+393334347445,N028d")); diff --git a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java index 0bcd8c3cd..eb99e9d37 100644 --- a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class Pt502ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(new TestDataManager()); + Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "$POS,6094,205523.000,A,1013.6223,N,06728.4248,W,0.0,99.3,011112,,,A/00000,00000/0/23895000//")); diff --git a/test/org/traccar/protocol/RitiProtocolDecoderTest.java b/test/org/traccar/protocol/RitiProtocolDecoderTest.java index 06747ae45..e006689b5 100644 --- a/test/org/traccar/protocol/RitiProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RitiProtocolDecoderTest.java @@ -13,7 +13,7 @@ public class RitiProtocolDecoderTest { @Test public void testDecode() throws Exception { - RitiProtocolDecoder decoder = new RitiProtocolDecoder(new TestDataManager()); + RitiProtocolDecoder decoder = new RitiProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray( new int[] {0x3b,0x28,0x64,0xa3,0x05,0x63,0x00,0x00,0x6d,0x40,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x47,0x50,0x52,0x4d,0x43,0x2c,0x32,0x31,0x31,0x37,0x34,0x33,0x2e,0x30,0x30,0x30,0x2c,0x41,0x2c,0x31,0x33,0x35,0x37,0x2e,0x33,0x36,0x37,0x35,0x2c,0x4e,0x2c,0x31,0x30,0x30,0x33,0x36,0x2e,0x36,0x39,0x39,0x32,0x2c,0x45,0x2c,0x30,0x2e,0x30,0x30,0x2c,0x2c,0x30,0x31,0x30,0x39,0x31,0x34,0x2c,0x2c,0x2c,0x41,0x2a,0x37,0x38,0x0d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04})))); diff --git a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java index a3bf225db..978b281e2 100644 --- a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java @@ -11,7 +11,7 @@ public class RuptelaProtocolDecoderTest { @Test public void testDecode() throws Exception { - RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(new TestDataManager()); + RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(new TestDataManager(), null, null); int[] buf1 = {0x00,0x79,0x00,0x00,0x0b,0x1a,0x2a,0x55,0x85,0xc3,0x01,0x00,0x02,0x4e,0x9c,0x03,0x69,0x00,0x00,0x0f,0x10,0x17,0x33,0x20,0x8f,0xf4,0x5e,0x07,0xb3,0x1b,0x57,0x0a,0x00,0x10,0x09,0x09,0x06,0x05,0x01,0x1b,0x1a,0x02,0x00,0x03,0x00,0x1c,0x01,0xad,0x01,0x02,0x1d,0x33,0x8e,0x16,0x00,0x00,0x02,0x96,0x00,0x00,0x60,0x1a,0x41,0x01,0x4b,0xc1,0x6d,0x00,0x4e,0x9c,0x03,0x84,0x00,0x00,0x0f,0x10,0x4f,0xdf,0x20,0x90,0x0d,0x20,0x07,0x51,0x03,0xb0,0x0a,0x00,0x13 ,0x08,0x09,0x06,0x05,0x01,0x1b,0x1a,0x02,0x00,0x03,0x00,0x1c,0x01,0xad,0x01,0x02,0x1d,0x33,0xb1,0x16,0x00,0x00,0x02,0x96,0x00,0x00,0x60,0x1a,0x41,0x01,0x4b,0xc1,0xea,0x00,0x28,0xf9}; verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1)))); diff --git a/test/org/traccar/protocol/SanavProtocolDecoderTest.java b/test/org/traccar/protocol/SanavProtocolDecoderTest.java index b1a832f0f..6405ee281 100644 --- a/test/org/traccar/protocol/SanavProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SanavProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class SanavProtocolDecoderTest { @Test public void testDecode() throws Exception { - SanavProtocolDecoder decoder = new SanavProtocolDecoder(new TestDataManager()); + SanavProtocolDecoder decoder = new SanavProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "imei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,*05,AUTO-4095mv")); diff --git a/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java b/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java index a1ad836e6..b47624a25 100644 --- a/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java @@ -11,7 +11,7 @@ public class SkypatrolProtocolDecoderTest { @Test public void testDecode() throws Exception { - SkypatrolProtocolDecoder decoder = new SkypatrolProtocolDecoder(new TestDataManager()); + SkypatrolProtocolDecoder decoder = new SkypatrolProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[]{0x00,0x05,0x02,0x10,0x04,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x0D,0x31,0x31,0x34,0x37,0x37,0x35,0x38,0x33,0x00,0xCB,0x00,0x00,0x00,0x00,0x0E,0x11,0x07,0x0C,0x01,0x01,0x84,0xD0,0x32,0xFB,0x38,0x41,0x37,0x00,0x00,0x00,0x00,0x16,0x07,0x2B,0x00,0x00,0x17,0x05,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x4E,0x0C,0x07,0x11,0x16,0x07,0x2C,0x10,0x59,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x03,0x10,0x02,0x60,0xB7,0x36,0x3B,0x63,0x06,0xC1,0x1A,0x00,0xB7,0x36,0x37,0xF2,0x06,0xBF,0x19,0xB7,0x36,0x37,0xF1,0x06,0xB5,0x0E,0xB7,0x36,0x38,0xB1,0x06,0xBB,0x0B,0xB7,0x36,0x3B,0x61,0x06,0xB8,0x0A,0xB7,0x36,0x37,0xF3,0x06,0xB7,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C})))); diff --git a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java index 2cee77ca4..c1f499e4b 100644 --- a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class Stl060ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Stl060ProtocolDecoder decoder = new Stl060ProtocolDecoder(new TestDataManager()); + Stl060ProtocolDecoder decoder = new Stl060ProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "$1,357804048043099,D001,AP29AW0963,23/02/14,14:06:54,17248488N,078342226E,0.08,193.12,1,1,1,1,1,A")); diff --git a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java index 3fbb05bb3..f021ccdf3 100644 --- a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class SuntechProtocolDecoderTest { @Test public void testDecode() throws Exception { - SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(new TestDataManager()); + SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "SA200ALV;317652")); diff --git a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java index 87e9c025b..72c06d3fc 100644 --- a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class SyrusProtocolDecoderTest { @Test public void testDecode() throws Exception { - SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(new TestDataManager(), false); + SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(new TestDataManager(), null, null, false); assertNotNull(decoder.decode(null, null, ">RPV00000+3739438-1220384601512612;ID=1234;*7F")); diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java index a06df0c2d..4f4818d82 100644 --- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class T55ProtocolDecoderTest { @Test public void testDecode() throws Exception { - T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager()); + T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "$GPFID,ID123456ABC")); diff --git a/test/org/traccar/protocol/TelikProtocolDecoderTest.java b/test/org/traccar/protocol/TelikProtocolDecoderTest.java index 257414abf..55e00a472 100644 --- a/test/org/traccar/protocol/TelikProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TelikProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class TelikProtocolDecoderTest { @Test public void testDecode() throws Exception { - TelikProtocolDecoder decoder = new TelikProtocolDecoder(new TestDataManager()); + TelikProtocolDecoder decoder = new TelikProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "0026436729|232|01|003002030")); diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java index 8f4b987df..9c38bf4b7 100644 --- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java @@ -12,7 +12,7 @@ public class TeltonikaProtocolDecoderTest { @Test public void testDecode() throws Exception { - TeltonikaProtocolDecoder decoder = new TeltonikaProtocolDecoder(new TestDataManager()); + TeltonikaProtocolDecoder decoder = new TeltonikaProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( new int[] {0x00,0x0F,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x31,0x32,0x33,0x34,0x35})))); diff --git a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java index eb852875f..998365648 100644 --- a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Tk102ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(new TestDataManager()); + Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "")); diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index 6d6683db2..a23f5d061 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Tk103ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager()); + Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "(090411121854BP0000001234567890HSO")); diff --git a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java index 8ce438c4f..de1ce2aa3 100644 --- a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class Tlt2hProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(new TestDataManager()); + Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "#357671030946351#V500#0000#AUTO#1\r\n" + diff --git a/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java b/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java index 3f84165bf..2e5d1b0af 100644 --- a/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class TopflytechProtocolDecoderTest { @Test public void testDecode() throws Exception { - TopflytechProtocolDecoder decoder = new TopflytechProtocolDecoder(new TestDataManager()); + TopflytechProtocolDecoder decoder = new TopflytechProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "(880316890094910BP00XG00b600000000L00074b54S00000000R0C0F0014000100f0130531152205A0706.1395S11024.0965E000.0251.25")); diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java index adcfd89ca..7b4f95a77 100644 --- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class TotemProtocolDecoderTest { @Test public void testDecode() throws Exception { - TotemProtocolDecoder decoder = new TotemProtocolDecoder(new TestDataManager()); + TotemProtocolDecoder decoder = new TotemProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "$$BB862170017856731|AA$GPRMC,000000.00,V,0000.0000,N,00000.0000,E,000.0,000.0,000000,,,A*73|00.0|00.0|00.0|000000001000|20000000000000|13790000|00000000|00000000|00000000|0.0000|0007|8C23")); diff --git a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java index c1fb6b1d2..b2d2d9a7d 100644 --- a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class Tr20ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(new TestDataManager()); + Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "%%TRACKPRO01,1")); diff --git a/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java b/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java index 131f29a68..eb26532b0 100644 --- a/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class TrackboxProtocolDecoderTest { @Test public void testDecode() throws Exception { - TrackboxProtocolDecoder decoder = new TrackboxProtocolDecoder(new TestDataManager()); + TrackboxProtocolDecoder decoder = new TrackboxProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "a=connect&v=11&i=111111111111111")); diff --git a/test/org/traccar/protocol/V680ProtocolDecoderTest.java b/test/org/traccar/protocol/V680ProtocolDecoderTest.java index 84463a1af..8e5a8a235 100644 --- a/test/org/traccar/protocol/V680ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/V680ProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class V680ProtocolDecoderTest { @Test public void testDecode() throws Exception { - V680ProtocolDecoder decoder = new V680ProtocolDecoder(new TestDataManager()); + V680ProtocolDecoder decoder = new V680ProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "#353588102019155")); diff --git a/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java b/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java index 683d86c7b..45f8d892a 100644 --- a/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class VisiontekProtocolDecoderTest { @Test public void testDecode() throws Exception { - VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(new TestDataManager()); + VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "$1,AP09BU9397,861785006462448,20,06,14,15,03,28,17267339N,078279407E,060.0,073,0550,11,0,1,0,0,1,1,26,A,0000000000")); diff --git a/test/org/traccar/protocol/WialonProtocolDecoderTest.java b/test/org/traccar/protocol/WialonProtocolDecoderTest.java index 89aca0d33..f5ef8f277 100644 --- a/test/org/traccar/protocol/WialonProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WialonProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class WialonProtocolDecoderTest { @Test public void testDecode() throws Exception { - WialonProtocolDecoder decoder = new WialonProtocolDecoder(new TestDataManager()); + WialonProtocolDecoder decoder = new WialonProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "#L#123456789012345;test")); diff --git a/test/org/traccar/protocol/WondexProtocolDecoderTest.java b/test/org/traccar/protocol/WondexProtocolDecoderTest.java index 8f62a3b3a..096273a66 100644 --- a/test/org/traccar/protocol/WondexProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WondexProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class WondexProtocolDecoderTest { @Test public void testDecode() throws Exception { - WondexProtocolDecoder decoder = new WondexProtocolDecoder(new TestDataManager()); + WondexProtocolDecoder decoder = new WondexProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "1044989601,20130323074605,0.000000,90.000000,0,000,0,0,2")); diff --git a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java index 89907af64..0018ce013 100644 --- a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class Xexun2ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager()); + Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "130302125349,+79604870506,GPRMC,085349.000,A,4503.2392,N,03858.5660,E,6.95,154.65,020313,,,A*6C,F,, imei:012207007744243,03,-1.5,F:4.15V,1,139,28048,250,01,278A,5072")); diff --git a/test/org/traccar/protocol/XexunProtocolDecoderTest.java b/test/org/traccar/protocol/XexunProtocolDecoderTest.java index 804a4687e..d81dbcf16 100644 --- a/test/org/traccar/protocol/XexunProtocolDecoderTest.java +++ b/test/org/traccar/protocol/XexunProtocolDecoderTest.java @@ -9,7 +9,7 @@ public class XexunProtocolDecoderTest { @Test public void testDecode() throws Exception { - XexunProtocolDecoder decoder = new XexunProtocolDecoder(new TestDataManager()); + XexunProtocolDecoder decoder = new XexunProtocolDecoder(new TestDataManager(), null, null); verify(decoder.decode(null, null, "GPRMC,043435.000,A,811.299200,S,11339.9500,E,0.93,29.52,160313,00,0000.0,A*65,F,,imei:359585014597923,")); diff --git a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java index 21a30d377..1207743ed 100644 --- a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java @@ -11,7 +11,7 @@ public class Xt7ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(new TestDataManager()); + Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(new TestDataManager(), null, null); ChannelBufferFactory factory = new HeapChannelBufferFactory(); byte[] buf1 = {0x53,0x54,0x58,0x32,0x30,0x31,0x30,0x31,0x30,0x31,0x38,0x30,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x02,0x6A,0x24,0x47,0x50,0x52,0x4D,0x43,0x2C,0x31,0x30,0x31,0x30,0x35,0x33,0x2E,0x30,0x30,0x30,0x2C,0x41,0x2C,0x32,0x32,0x33,0x32,0x2E,0x37,0x36,0x30,0x37,0x2C,0x4E,0x2C,0x31,0x31,0x34,0x30,0x34,0x2E,0x37,0x36,0x36,0x39,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x2C,0x32,0x33,0x31,0x31,0x31,0x30,0x2C,0x2C,0x2C,0x41,0x2A,0x37,0x46,0x2C,0x34,0x36,0x30,0x2C,0x30,0x30,0x2C,0x32,0x37,0x39,0x35,0x2C,0x30,0x45,0x36,0x41,0x2C,0x31,0x34,0x2C,0x39,0x34,0x2C,0x31,0x30,0x30,0x30,0x2C,0x30,0x30,0x30,0x30,0x2C,0x39,0x31,0x2C,0x54,0x69,0x6D,0x65,0x72,0x3B,0x31,0x44,0x0D,0x0A}; diff --git a/test/org/traccar/protocol/YwtProtocolDecoderTest.java b/test/org/traccar/protocol/YwtProtocolDecoderTest.java index 9ee8f0853..5d98530e3 100644 --- a/test/org/traccar/protocol/YwtProtocolDecoderTest.java +++ b/test/org/traccar/protocol/YwtProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class YwtProtocolDecoderTest { @Test public void testDecode() throws Exception { - YwtProtocolDecoder decoder = new YwtProtocolDecoder(new TestDataManager()); + YwtProtocolDecoder decoder = new YwtProtocolDecoder(new TestDataManager(), null, null); assertNull(decoder.decode(null, null, "%SN,0417061042:0,0,140117041203,404")); -- cgit v1.2.3