aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-12 22:45:47 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-12 22:45:47 +1200
commitc42b05ceffcf56c696b20b34cacb80f7ce690497 (patch)
tree6b5c9a1c85638d20cc1ac395c6122b589fcafdea /src/org/traccar/ServerManager.java
parent2bd65faa3ca6e78727277c6daa1c97bf01689c8a (diff)
downloadtrackermap-server-c42b05ceffcf56c696b20b34cacb80f7ce690497.tar.gz
trackermap-server-c42b05ceffcf56c696b20b34cacb80f7ce690497.tar.bz2
trackermap-server-c42b05ceffcf56c696b20b34cacb80f7ce690497.zip
Added Gotop protocol
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 f66eda351..3f7bd9986 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -145,6 +145,7 @@ public class ServerManager {
initTopflytechServer("topflytech");
//initLaipacServer("laipac");
initAplicomServer("aplicom");
+ initGotopServer("gotop");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -914,4 +915,19 @@ public class ServerManager {
}
}
+ private void initGotopServer(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) '#' };
+ pipeline.addLast("frameDecoder",
+ new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("objectDecoder", new GotopProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}