From 77f410b00568e09d503fffdbf42d6eb08aeae570 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 11 Dec 2012 21:16:29 +1300 Subject: More Skypatrol stuff --- src/org/traccar/Server.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/org/traccar/Server.java') 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); + } + } } -- cgit v1.2.3