aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-06-01 20:37:44 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-06-01 20:37:44 +1200
commit8f62b5da5664ef4294387763d328df92784b50e4 (patch)
tree27ad8ffc056feb00ccf682824a455d3e724655a6 /src/org/traccar/ServerManager.java
parent688b34433c842b2f4ee546c9b8b19e867bfb4352 (diff)
downloadtrackermap-server-8f62b5da5664ef4294387763d328df92784b50e4.tar.gz
trackermap-server-8f62b5da5664ef4294387763d328df92784b50e4.tar.bz2
trackermap-server-8f62b5da5664ef4294387763d328df92784b50e4.zip
Implement Box 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 1c4673f7a..337d177f0 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -168,6 +168,7 @@ public class ServerManager {
initMiniFinderServer("minifinder");
initHaicomServer("haicom");
initEelinkServer("eelink");
+ initBoxServer("box");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -1143,4 +1144,19 @@ public class ServerManager {
}
}
+ private void initBoxServer(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) '\r' };
+ pipeline.addLast("frameDecoder",
+ new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("objectDecoder", new BoxProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}