diff options
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); + } + } } |