diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-09 21:46:58 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-09 21:46:58 +1200 |
commit | 635b158070a163c91a66fba857d61bf8acb5bd5d (patch) | |
tree | a49952b1c87c70b90dda61bb0cf32e28c794d4e0 /src/org/traccar/ServerManager.java | |
parent | c10858c1ae7f4dca0c9ae88e19bb069b91ad0792 (diff) | |
download | trackermap-server-635b158070a163c91a66fba857d61bf8acb5bd5d.tar.gz trackermap-server-635b158070a163c91a66fba857d61bf8acb5bd5d.tar.bz2 trackermap-server-635b158070a163c91a66fba857d61bf8acb5bd5d.zip |
Added Topflytech protocol (fix #282)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 84933b093..0811a48be 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -142,6 +142,7 @@ public class ServerManager { initAtrackServer("atrack"); initPt3000Server("pt3000"); initRuptelaServer("ruptela"); + initTopflytechServer("topflytech"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -870,4 +871,19 @@ public class ServerManager { } } + private void initTopflytechServer(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) ')' }; + pipeline.addLast("frameDecoder", + new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(ServerManager.this)); + } + }); + } + } + } |