aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-03-01 10:35:55 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-03-01 10:35:55 +1300
commitcb5788df82324d999e1912a5936ade351f3da8da (patch)
tree24ee533d555221e4a1d56d9605fd1f2f8ae9e20c /src/org/traccar/ServerManager.java
parentc988200458e48b3909abfb18689faadd458acf91 (diff)
downloadtrackermap-server-cb5788df82324d999e1912a5936ade351f3da8da.tar.gz
trackermap-server-cb5788df82324d999e1912a5936ade351f3da8da.tar.bz2
trackermap-server-cb5788df82324d999e1912a5936ade351f3da8da.zip
Implement Xirgo protocol
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 57cb3ea4e..378d8a52d 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -181,6 +181,7 @@ public class ServerManager {
initGoSafeServer("gosafe");
initAutoFon45Server("autofon45");
initBceServer("bce");
+ initXirgoServer("xirgo");
initProtocolDetector();
@@ -1337,5 +1338,19 @@ public class ServerManager {
serverList.add(server);
}
}
+
+ private void initXirgoServer(final String protocol) throws SQLException {
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##"));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new XirgoProtocolDecoder(dataManager, protocol, properties));
+ }
+ });
+ }
+ }
}