diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-23 01:19:09 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-23 01:19:09 +1200 |
commit | caa4fd747981075ed47315fffc5bbd18268278bd (patch) | |
tree | ea03028dce590667c5c289e1dc2962d6ca3dddea /src/org/traccar/ServerManager.java | |
parent | f94f4ea8f327a6d89cf3b484296bd4d97f2dde9f (diff) | |
download | trackermap-server-caa4fd747981075ed47315fffc5bbd18268278bd.tar.gz trackermap-server-caa4fd747981075ed47315fffc5bbd18268278bd.tar.bz2 trackermap-server-caa4fd747981075ed47315fffc5bbd18268278bd.zip |
Added OsmAnd 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 d149e3ea8..2e5dfcda5 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -156,6 +156,7 @@ public class ServerManager { initGatorServer("gator"); initNoranServer("noran"); initM2mServer("m2m"); + initOsmAndServer("osmand"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -983,5 +984,18 @@ public class ServerManager { }); } } + + private void initOsmAndServer(String protocol) throws SQLException { + if (isProtocolEnabled(properties, protocol)) { + serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("httpDecoder", new HttpRequestDecoder()); + pipeline.addLast("httpEncoder", new HttpResponseEncoder()); + pipeline.addLast("objectDecoder", new OsmAndProtocolDecoder(ServerManager.this)); + } + }); + } + } } |