diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-06-22 20:39:49 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-06-22 20:39:49 +1200 |
commit | 1c668044b7c1ce5b90257cca3cdc21ac0bc6fc90 (patch) | |
tree | ef81db278606d0cf66b7ec917ef651dca179396a /src/org/traccar/ServerManager.java | |
parent | f09fc2f40d61c08daa1a28aa03ebe23fe336c8ee (diff) | |
download | trackermap-server-1c668044b7c1ce5b90257cca3cdc21ac0bc6fc90.tar.gz trackermap-server-1c668044b7c1ce5b90257cca3cdc21ac0bc6fc90.tar.bz2 trackermap-server-1c668044b7c1ce5b90257cca3cdc21ac0bc6fc90.zip |
Implement Trackbox protocol
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 653d74a73..01f78c515 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -171,6 +171,7 @@ public class ServerManager { initBoxServer("box"); initFreedomServer("freedom"); initTelikServer("telik"); + initTrackboxServer("trackbox"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -1189,4 +1190,18 @@ public class ServerManager { } } + private void initTrackboxServer(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("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new TrackboxProtocolDecoder(ServerManager.this)); + } + }); + } + } + } |