aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Server.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-10-07 22:22:40 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2012-10-07 22:22:40 +1300
commitf9da745ca13052396c40c4e8f99da7cd4ed14d3c (patch)
tree1374cac87060c8feee0ca5be178a1f337a39d9c0 /src/org/traccar/Server.java
parentba8ece8a5b1c784f96c306e3fcbe6c612a1e4f97 (diff)
downloadtrackermap-server-f9da745ca13052396c40c4e8f99da7cd4ed14d3c.tar.gz
trackermap-server-f9da745ca13052396c40c4e8f99da7cd4ed14d3c.tar.bz2
trackermap-server-f9da745ca13052396c40c4e8f99da7cd4ed14d3c.zip
Progress protocol template
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r--src/org/traccar/Server.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java
index 7df1a463a..7dcabe084 100644
--- a/src/org/traccar/Server.java
+++ b/src/org/traccar/Server.java
@@ -499,5 +499,24 @@ public class Server {
serverList.add(server);
}
}
-
+
+ private void initProgressServer(Properties properties) throws SQLException {
+ String protocol = "progress";
+ if (isProtocolEnabled(properties, protocol)) {
+
+ TrackerServer server = new TrackerServer(getProtocolPort(properties, protocol));
+ server.setEndianness(java.nio.ByteOrder.LITTLE_ENDIAN);
+ final Integer resetDelay = getProtocolResetDelay(properties, protocol);
+
+ server.setPipelineFactory(new GenericPipelineFactory(server, dataManager, isLoggerEnabled(), geocoder) {
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 0, 0));
+ pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(getDataManager(), resetDelay));
+ }
+ });
+
+ serverList.add(server);
+ }
+ }
+
}