aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-04-27 18:38:40 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-04-27 18:38:40 +1200
commit62e04a3d493a98790172def8d1996be63400eb15 (patch)
tree90b463138c4f0e7f1a9f9ce766db5c3168b6d3c1 /src/org/traccar/ServerManager.java
parentfc787e132cd5d7aa09d9f7b33bed933ece6d32f0 (diff)
downloadtrackermap-server-62e04a3d493a98790172def8d1996be63400eb15.tar.gz
trackermap-server-62e04a3d493a98790172def8d1996be63400eb15.tar.bz2
trackermap-server-62e04a3d493a98790172def8d1996be63400eb15.zip
Add MiniFinder 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 43fbec650..1a3cf0a00 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -165,6 +165,7 @@ public class ServerManager {
initPiligrimServer("piligrim");
initStl060Server("stl060");
initCarTrackServer("cartrack");
+ initMiniFinderServer("minifinder");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -1099,4 +1100,19 @@ public class ServerManager {
}
}
+ private void initMiniFinderServer(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 MiniFinderProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}