diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-07-11 15:57:20 +0300 |
---|---|---|
committer | Ivan Muratov <binakot@gmail.com> | 2017-07-11 15:57:20 +0300 |
commit | 2e0ed3ccfde8f779111de2b722a94224faa65c99 (patch) | |
tree | 6b5c5f02bba4e36efcb802c48a8054588f168735 /src/org/traccar/protocol/Arnavi4Protocol.java | |
parent | 85f7eae47ec4bf6b269305a05a696f9acce31fd5 (diff) | |
download | trackermap-server-2e0ed3ccfde8f779111de2b722a94224faa65c99.tar.gz trackermap-server-2e0ed3ccfde8f779111de2b722a94224faa65c99.tar.bz2 trackermap-server-2e0ed3ccfde8f779111de2b722a94224faa65c99.zip |
Create duplicate of ARNAVI3 protocol implementation.
Add an entry with ARNAVI4 port to the properties in default.xml.
Diffstat (limited to 'src/org/traccar/protocol/Arnavi4Protocol.java')
-rw-r--r-- | src/org/traccar/protocol/Arnavi4Protocol.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Arnavi4Protocol.java b/src/org/traccar/protocol/Arnavi4Protocol.java new file mode 100644 index 000000000..622051fbd --- /dev/null +++ b/src/org/traccar/protocol/Arnavi4Protocol.java @@ -0,0 +1,35 @@ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +/** + * Created by Ivan Muratov @binakot on 11.07.2017. + */ +public class Arnavi4Protocol extends BaseProtocol { + + public Arnavi4Protocol() { + super("arnavi4"); + } + + @Override + public void initTrackerServers(List<TrackerServer> serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new Arnavi4ProtocolDecoder(Arnavi4Protocol.this)); + } + }); + } + +} |