aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-06-13 22:22:08 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-06-13 22:22:08 +1200
commite6d9af4efc0895cd1723f1cd2b80f82776ccf2e0 (patch)
treea607aa473526d1a5259030bd1a9494419e9a1be5 /src/org/traccar/ServerManager.java
parentffc1755cca2476dc9a4bb430c968207657997222 (diff)
downloadtrackermap-server-e6d9af4efc0895cd1723f1cd2b80f82776ccf2e0.tar.gz
trackermap-server-e6d9af4efc0895cd1723f1cd2b80f82776ccf2e0.tar.bz2
trackermap-server-e6d9af4efc0895cd1723f1cd2b80f82776ccf2e0.zip
Implement Telik protocol (fix #691)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 56647aecd..653d74a73 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -170,6 +170,7 @@ public class ServerManager {
initEelinkServer("eelink");
initBoxServer("box");
initFreedomServer("freedom");
+ initTelikServer("telik");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -1173,4 +1174,19 @@ public class ServerManager {
}
}
+ private void initTelikServer(String protocol) throws SQLException {
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ byte delimiter[] = { (byte) '\0' };
+ pipeline.addLast("frameDecoder",
+ new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("objectDecoder", new TelikProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}