diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-11 21:16:29 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-11 21:16:29 +1300 |
commit | 77f410b00568e09d503fffdbf42d6eb08aeae570 (patch) | |
tree | 32285726faa88cb7c2ad8d5c3969821db6dbc4dc /src/org/traccar/Server.java | |
parent | 7cc49096e7ea6965a3164ff3ffd66876bc94646c (diff) | |
download | trackermap-server-77f410b00568e09d503fffdbf42d6eb08aeae570.tar.gz trackermap-server-77f410b00568e09d503fffdbf42d6eb08aeae570.tar.bz2 trackermap-server-77f410b00568e09d503fffdbf42d6eb08aeae570.zip |
More Skypatrol stuff
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r-- | src/org/traccar/Server.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java index 9a4bcd1d4..9deb271da 100644 --- a/src/org/traccar/Server.java +++ b/src/org/traccar/Server.java @@ -110,6 +110,7 @@ public class Server { initTr20Server(properties); initNavisServer(properties); initMeitrackServer(properties); + initSkypatrolServer(properties); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -786,4 +787,27 @@ public class Server { serverList.add(server); } } + + /** + * Init SkyPatrol server + */ + private void initSkypatrolServer(Properties properties) throws SQLException { + + String protocol = "skypatrol"; + if (isProtocolEnabled(properties, protocol)) { + + TrackerServer server = new TrackerServer(new ServerBootstrap()); + server.setPort(getProtocolPort(properties, protocol)); + server.setAddress(getProtocolInterface(properties, protocol)); + final Integer resetDelay = getProtocolResetDelay(properties, protocol); + + server.setPipelineFactory(new GenericPipelineFactory(server, dataManager, isLoggerEnabled(), resetDelay, geocoder) { + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(getDataManager())); + } + }); + + serverList.add(server); + } + } } |