diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-06-02 22:39:48 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-06-02 22:39:48 +1200 |
commit | 6ac5e8cef0be902b7067c6d9c4b30c4740d3dffd (patch) | |
tree | 135c3ab138f2d0762aafeec1be6c2bb32a47aad4 /src/org/traccar/ServerManager.java | |
parent | 8f62b5da5664ef4294387763d328df92784b50e4 (diff) | |
download | trackermap-server-6ac5e8cef0be902b7067c6d9c4b30c4740d3dffd.tar.gz trackermap-server-6ac5e8cef0be902b7067c6d9c4b30c4740d3dffd.tar.bz2 trackermap-server-6ac5e8cef0be902b7067c6d9c4b30c4740d3dffd.zip |
Implement Freedom protocol
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 337d177f0..56647aecd 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -169,6 +169,7 @@ public class ServerManager { initHaicomServer("haicom"); initEelinkServer("eelink"); initBoxServer("box"); + initFreedomServer("freedom"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -1159,4 +1160,17 @@ public class ServerManager { } } + private void initFreedomServer(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)); + } + }); + } + } + } |