aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CastelProtocol.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/CastelProtocol.java')
-rw-r--r--src/org/traccar/protocol/CastelProtocol.java26
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);
+ });
}
}