From 27b76e26e7f438976e6702c9f3c71be93f68fa52 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Nov 2013 11:56:19 +1300 Subject: Merge AVL08 and Totem protocols --- src/org/traccar/ServerManager.java | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src/org/traccar/ServerManager.java') diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 771ea6480..32afc29fc 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -108,7 +108,7 @@ public class ServerManager { initGl200Server("gl200"); initT55Server("t55"); initXexun2Server("xexun2"); - initAvl08Server("avl08"); + initTotemServer("totem"); initEnforaServer("enfora"); initMeiligaoServer("meiligao"); initMaxonServer("maxon"); @@ -152,7 +152,6 @@ public class ServerManager { initLaipacServer("laipac"); initAplicomServer("aplicom"); initGotopServer("gotop"); - initTotemServer("totem"); initGatorServer("gator"); initNoranServer("noran"); initM2mServer("m2m"); @@ -322,16 +321,14 @@ public class ServerManager { } } - private void initAvl08Server(String protocol) throws SQLException { + private void initTotemServer(String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - byte delimiter[] = { (byte) '\r', (byte) '\n' }; - pipeline.addLast("frameDecoder", - new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("frameDecoder", new TotemFrameDecoder()); pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Avl08ProtocolDecoder(ServerManager.this)); + pipeline.addLast("objectDecoder", new TotemProtocolDecoder(ServerManager.this)); } }); } @@ -944,19 +941,6 @@ public class ServerManager { } } - private void initTotemServer(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)); - } - }); - } - } - private void initGatorServer(String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { -- cgit v1.2.3