aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-13 20:41:08 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-13 20:41:08 +1300
commit82965326887d0867f8edf29e638630c2ee85423c (patch)
treeb9b85b2ceadff02bc4b2ee6b5fe4de76ec486f08 /src/org/traccar/ServerManager.java
parent6271b433cdada9b94b93db7f30bf8f8d7efe4b52 (diff)
downloadtrackermap-server-82965326887d0867f8edf29e638630c2ee85423c.tar.gz
trackermap-server-82965326887d0867f8edf29e638630c2ee85423c.tar.bz2
trackermap-server-82965326887d0867f8edf29e638630c2ee85423c.zip
Added Syrus protocol (fix #133)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index a79714a8d..0d55b4e0d 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -136,6 +136,7 @@ public class ServerManager {
initMta6Server("mta6");
initMta6CanServer("mta6can");
initTlt2hServer("tlt2h");
+ initSyrusServer("syrus");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -682,5 +683,21 @@ public class ServerManager {
});
}
}
+
+ private void initSyrusServer(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("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new SyrusProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
}