diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-15 13:41:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-15 13:41:56 +1300 |
commit | 9fe73b049bd739a65b57ec96dec357b0abe42aee (patch) | |
tree | bf69ec27602bbc04161153c8c700daedb0f473f5 /src/org/traccar | |
parent | a9f5bfb5d69d88ee763c67e8a2f4b4ecc512394b (diff) | |
download | traccar-server-9fe73b049bd739a65b57ec96dec357b0abe42aee.tar.gz traccar-server-9fe73b049bd739a65b57ec96dec357b0abe42aee.tar.bz2 traccar-server-9fe73b049bd739a65b57ec96dec357b0abe42aee.zip |
Move Xexun to 5006 port
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/ServerManager.java | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 1f1a380e4..1bf2a09b7 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -104,13 +104,12 @@ public class ServerManager { initGeocoder(properties); - initXexunServer("xexun"); initGps103Server("gps103"); initTk103Server("tk103"); initGl100Server("gl100"); initGl200Server("gl200"); initT55Server("t55"); - initXexun2Server("xexun2"); + initXexunServer("xexun"); initTotemServer("totem"); initEnforaServer("enfora"); initMeiligaoServer("meiligao"); @@ -234,19 +233,6 @@ public class ServerManager { return false; } - 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(dataManager, protocol, properties)); - } - }); - } - } - private void initGps103Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @@ -333,14 +319,20 @@ public class ServerManager { } } - private void initXexun2Server(final 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 LineBasedFrameDecoder(1024)); // tracker bug \n\r - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(dataManager, protocol, properties)); + if (Boolean.valueOf(properties.containsKey(protocol + ".extended"))) { + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); // tracker bug \n\r + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(dataManager, protocol, properties)); + } else { + pipeline.addLast("frameDecoder", new XexunFrameDecoder()); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new XexunProtocolDecoder(dataManager, protocol, properties)); + } } }); } |