diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-06 16:51:47 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-06 16:51:47 +1200 |
commit | 562535fd538e7b05b6fe96c0f56eb2ec0ae1fd0e (patch) | |
tree | 44fa438ebc6be56ede7307b18a2116fff14d8cc8 /src/org/traccar/protocol/CastelProtocol.java | |
parent | 9c99076dc2416c4e0725007af0e5f2f2f444c05c (diff) | |
download | trackermap-server-562535fd538e7b05b6fe96c0f56eb2ec0ae1fd0e.tar.gz trackermap-server-562535fd538e7b05b6fe96c0f56eb2ec0ae1fd0e.tar.bz2 trackermap-server-562535fd538e7b05b6fe96c0f56eb2ec0ae1fd0e.zip |
Migrate more protocols
Diffstat (limited to 'src/org/traccar/protocol/CastelProtocol.java')
-rw-r--r-- | src/org/traccar/protocol/CastelProtocol.java | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/org/traccar/protocol/CastelProtocol.java b/src/org/traccar/protocol/CastelProtocol.java index d5ba5cd55..3e3c5699e 100644 --- a/src/org/traccar/protocol/CastelProtocol.java +++ b/src/org/traccar/protocol/CastelProtocol.java @@ -15,15 +15,12 @@ */ package org.traccar.protocol; -import org.jboss.netty.bootstrap.ConnectionlessBootstrap; -import org.jboss.netty.bootstrap.ServerBootstrap; -import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; +import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; +import org.traccar.PipelineBuilder; import org.traccar.TrackerServer; import org.traccar.model.Command; -import java.nio.ByteOrder; import java.util.List; public class CastelProtocol extends BaseProtocol { @@ -37,26 +34,21 @@ public class CastelProtocol extends BaseProtocol { @Override public void initTrackerServers(List<TrackerServer> serverList) { - TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) { + serverList.add(new TrackerServer(false, getName()) { @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); + protected void addProtocolHandlers(PipelineBuilder pipeline) { + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); // TODO LE frame decoder pipeline.addLast("objectEncoder", new CastelProtocolEncoder()); pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this)); } - }; - server.setEndianness(ByteOrder.LITTLE_ENDIAN); - serverList.add(server); - - server = new TrackerServer(new ConnectionlessBootstrap(), getName()) { + }); + serverList.add(new TrackerServer(true, getName()) { @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { + protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast("objectEncoder", new CastelProtocolEncoder()); pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this)); } - }; - server.setEndianness(ByteOrder.LITTLE_ENDIAN); - serverList.add(server); + }); } } |