diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-16 12:15:43 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-16 12:15:44 +1300 |
commit | 421c13cf3aefeb0de6e057bf9d92ee4347d68f2f (patch) | |
tree | 0d1b2965ca51705d52784dcc55882e12bff24317 /src/org | |
parent | e151bd07a685d8b77ff6c24455ad0520e68843d4 (diff) | |
download | traccar-server-421c13cf3aefeb0de6e057bf9d92ee4347d68f2f.tar.gz traccar-server-421c13cf3aefeb0de6e057bf9d92ee4347d68f2f.tar.bz2 traccar-server-421c13cf3aefeb0de6e057bf9d92ee4347d68f2f.zip |
Remove remaining handler names
Diffstat (limited to 'src/org')
184 files changed, 683 insertions, 674 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index a11d4fcfd..3c309d224 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -255,6 +255,19 @@ public abstract class BasePipelineFactory extends ChannelInitializer<Channel> { addProtocolHandlers(new PipelineBuilder() { @Override + public void addLast(ChannelHandler handler) { + if (!(handler instanceof BaseProtocolDecoder || handler instanceof BaseProtocolEncoder)) { + if (handler instanceof ChannelInboundHandler) { + handler = new WrapperInboundHandler((ChannelInboundHandler) handler); + } else { + handler = new WrapperOutboundHandler((ChannelOutboundHandler) handler); + } + } + pipeline.addLast(handler); + } + + // TODO remove + @Override public void addLast(String name, ChannelHandler handler) { if (!(handler instanceof BaseProtocolDecoder || handler instanceof BaseProtocolEncoder)) { if (handler instanceof ChannelInboundHandler) { diff --git a/src/org/traccar/BaseProtocol.java b/src/org/traccar/BaseProtocol.java index 4e5df329c..a78143167 100644 --- a/src/org/traccar/BaseProtocol.java +++ b/src/org/traccar/BaseProtocol.java @@ -16,6 +16,7 @@ package org.traccar; import io.netty.buffer.Unpooled; +import io.netty.handler.codec.string.StringEncoder; import org.traccar.database.ActiveDevice; import org.traccar.helper.DataConverter; import org.traccar.model.Command; @@ -75,7 +76,7 @@ public abstract class BaseProtocol implements Protocol { activeDevice.write(command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { String data = command.getString(Command.KEY_DATA); - if (activeDevice.getChannel().pipeline().get("stringEncoder") != null) { + if (activeDevice.getChannel().pipeline().get(StringEncoder.class) != null) { activeDevice.write(data); } else { activeDevice.write(Unpooled.wrappedBuffer(DataConverter.parseHex(data))); diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 1f43d6a1e..6b0ece85b 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -17,6 +17,7 @@ package org.traccar; import io.netty.channel.Channel; import io.netty.channel.socket.DatagramChannel; +import io.netty.handler.codec.http.HttpRequestDecoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.traccar.helper.UnitsConverter; @@ -160,7 +161,7 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } public DeviceSession getDeviceSession(Channel channel, SocketAddress remoteAddress, String... uniqueIds) { - if (channel != null && channel.pipeline().get("httpDecoder") != null + if (channel != null && channel.pipeline().get(HttpRequestDecoder.class) != null || Context.getConfig().getBoolean("decoder.ignoreSessionCache")) { long deviceId = findDeviceId(remoteAddress, uniqueIds); if (deviceId != 0) { diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java index 81d19ef01..4d54a6fe6 100644 --- a/src/org/traccar/MainEventHandler.java +++ b/src/org/traccar/MainEventHandler.java @@ -19,6 +19,7 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.socket.DatagramChannel; +import io.netty.handler.codec.http.HttpRequestDecoder; import io.netty.handler.timeout.IdleStateEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -97,8 +98,8 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter { LOGGER.info(formatChannel(ctx.channel()) + " disconnected"); closeChannel(ctx.channel()); - BaseProtocolDecoder protocolDecoder = (BaseProtocolDecoder) ctx.pipeline().get("objectDecoder"); - if (ctx.pipeline().get("httpDecoder") == null + BaseProtocolDecoder protocolDecoder = ctx.pipeline().get(BaseProtocolDecoder.class); + if (ctx.pipeline().get(HttpRequestDecoder.class) == null && !connectionlessProtocols.contains(protocolDecoder.getProtocolName())) { Context.getConnectionManager().removeActiveDevice(ctx.channel()); } diff --git a/src/org/traccar/PipelineBuilder.java b/src/org/traccar/PipelineBuilder.java index 20c40f159..ecf746843 100644 --- a/src/org/traccar/PipelineBuilder.java +++ b/src/org/traccar/PipelineBuilder.java @@ -19,6 +19,8 @@ import io.netty.channel.ChannelHandler; public interface PipelineBuilder { - void addLast(String name, ChannelHandler handler); + void addLast(ChannelHandler handler); + + void addLast(String name, ChannelHandler handler); // TODO remove } diff --git a/src/org/traccar/protocol/AdmProtocol.java b/src/org/traccar/protocol/AdmProtocol.java index 994661af2..3e240ac08 100644 --- a/src/org/traccar/protocol/AdmProtocol.java +++ b/src/org/traccar/protocol/AdmProtocol.java @@ -39,11 +39,10 @@ public class AdmProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 1, -3, 0, true)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new AdmProtocolEncoder()); - pipeline.addLast("objectDecoder", new AdmProtocolDecoder(AdmProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 1, -3, 0, true)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new AdmProtocolEncoder()); + pipeline.addLast(new AdmProtocolDecoder(AdmProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AisProtocol.java b/src/org/traccar/protocol/AisProtocol.java index ff81db45c..c6ef3d175 100644 --- a/src/org/traccar/protocol/AisProtocol.java +++ b/src/org/traccar/protocol/AisProtocol.java @@ -33,8 +33,8 @@ public class AisProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new AisProtocolDecoder(AisProtocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new AisProtocolDecoder(AisProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AlematicsProtocol.java b/src/org/traccar/protocol/AlematicsProtocol.java index a8bb124f9..58e6040a4 100644 --- a/src/org/traccar/protocol/AlematicsProtocol.java +++ b/src/org/traccar/protocol/AlematicsProtocol.java @@ -34,10 +34,10 @@ public class AlematicsProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new AlematicsFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new AlematicsProtocolDecoder(AlematicsProtocol.this)); + pipeline.addLast(new AlematicsFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new AlematicsProtocolDecoder(AlematicsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AnytrekProtocol.java b/src/org/traccar/protocol/AnytrekProtocol.java index 8616e9194..6e69a37e9 100644 --- a/src/org/traccar/protocol/AnytrekProtocol.java +++ b/src/org/traccar/protocol/AnytrekProtocol.java @@ -33,8 +33,8 @@ public class AnytrekProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 2, 0)); - pipeline.addLast("objectDecoder", new AnytrekProtocolDecoder(AnytrekProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2, 2, 2, 0)); + pipeline.addLast(new AnytrekProtocolDecoder(AnytrekProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ApelProtocol.java b/src/org/traccar/protocol/ApelProtocol.java index 6b18c2fb8..9f2249eb6 100644 --- a/src/org/traccar/protocol/ApelProtocol.java +++ b/src/org/traccar/protocol/ApelProtocol.java @@ -34,9 +34,8 @@ public class ApelProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, 4, 0, true)); - pipeline.addLast("objectDecoder", new ApelProtocolDecoder(ApelProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, 4, 0, true)); + pipeline.addLast(new ApelProtocolDecoder(ApelProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AplicomProtocol.java b/src/org/traccar/protocol/AplicomProtocol.java index 6b9074163..8ae20a735 100644 --- a/src/org/traccar/protocol/AplicomProtocol.java +++ b/src/org/traccar/protocol/AplicomProtocol.java @@ -32,8 +32,8 @@ public class AplicomProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new AplicomFrameDecoder()); - pipeline.addLast("objectDecoder", new AplicomProtocolDecoder(AplicomProtocol.this)); + pipeline.addLast(new AplicomFrameDecoder()); + pipeline.addLast(new AplicomProtocolDecoder(AplicomProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AppelloProtocol.java b/src/org/traccar/protocol/AppelloProtocol.java index 33c7bbeed..1c73837a5 100644 --- a/src/org/traccar/protocol/AppelloProtocol.java +++ b/src/org/traccar/protocol/AppelloProtocol.java @@ -35,10 +35,10 @@ public class AppelloProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new AppelloProtocolDecoder(AppelloProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new AppelloProtocolDecoder(AppelloProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AppletProtocol.java b/src/org/traccar/protocol/AppletProtocol.java index 2ad459e8b..43d57671a 100644 --- a/src/org/traccar/protocol/AppletProtocol.java +++ b/src/org/traccar/protocol/AppletProtocol.java @@ -35,10 +35,10 @@ public class AppletProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(16384)); - pipeline.addLast("objectDecoder", new AppletProtocolDecoder(AppletProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(16384)); + pipeline.addLast(new AppletProtocolDecoder(AppletProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AquilaProtocol.java b/src/org/traccar/protocol/AquilaProtocol.java index b8c8e45d9..e6198277b 100644 --- a/src/org/traccar/protocol/AquilaProtocol.java +++ b/src/org/traccar/protocol/AquilaProtocol.java @@ -35,10 +35,10 @@ public class AquilaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new AquilaProtocolDecoder(AquilaProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new AquilaProtocolDecoder(AquilaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Ardi01Protocol.java b/src/org/traccar/protocol/Ardi01Protocol.java index 5242df08c..0360b5001 100644 --- a/src/org/traccar/protocol/Ardi01Protocol.java +++ b/src/org/traccar/protocol/Ardi01Protocol.java @@ -35,10 +35,10 @@ public class Ardi01Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Ardi01ProtocolDecoder(Ardi01Protocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Ardi01ProtocolDecoder(Ardi01Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/ArknavProtocol.java b/src/org/traccar/protocol/ArknavProtocol.java index 3497ab8bb..faa85ea60 100644 --- a/src/org/traccar/protocol/ArknavProtocol.java +++ b/src/org/traccar/protocol/ArknavProtocol.java @@ -35,10 +35,10 @@ public class ArknavProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new ArknavProtocolDecoder(ArknavProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\r')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new ArknavProtocolDecoder(ArknavProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ArknavX8Protocol.java b/src/org/traccar/protocol/ArknavX8Protocol.java index f5ad81660..8eb9340da 100644 --- a/src/org/traccar/protocol/ArknavX8Protocol.java +++ b/src/org/traccar/protocol/ArknavX8Protocol.java @@ -35,10 +35,10 @@ public class ArknavX8Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ';')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new ArknavX8ProtocolDecoder(ArknavX8Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ';')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new ArknavX8ProtocolDecoder(ArknavX8Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/ArnaviProtocol.java b/src/org/traccar/protocol/ArnaviProtocol.java index 88203fdbe..fa5ca4e54 100644 --- a/src/org/traccar/protocol/ArnaviProtocol.java +++ b/src/org/traccar/protocol/ArnaviProtocol.java @@ -35,10 +35,10 @@ public class ArnaviProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new ArnaviProtocolDecoder(ArnaviProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new ArnaviProtocolDecoder(ArnaviProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AstraProtocol.java b/src/org/traccar/protocol/AstraProtocol.java index 301afa532..23b7dca5c 100644 --- a/src/org/traccar/protocol/AstraProtocol.java +++ b/src/org/traccar/protocol/AstraProtocol.java @@ -33,14 +33,14 @@ public class AstraProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 1, 2, -3, 0)); - pipeline.addLast("objectDecoder", new AstraProtocolDecoder(AstraProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 1, 2, -3, 0)); + pipeline.addLast(new AstraProtocolDecoder(AstraProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new AstraProtocolDecoder(AstraProtocol.this)); + pipeline.addLast(new AstraProtocolDecoder(AstraProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/At2000Protocol.java b/src/org/traccar/protocol/At2000Protocol.java index 1aca8bb13..32f6f664a 100644 --- a/src/org/traccar/protocol/At2000Protocol.java +++ b/src/org/traccar/protocol/At2000Protocol.java @@ -32,8 +32,8 @@ public class At2000Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new At2000FrameDecoder()); - pipeline.addLast("objectDecoder", new At2000ProtocolDecoder(At2000Protocol.this)); + pipeline.addLast(new At2000FrameDecoder()); + pipeline.addLast(new At2000ProtocolDecoder(At2000Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/AtrackProtocol.java b/src/org/traccar/protocol/AtrackProtocol.java index 74840a1f5..66b7123b9 100644 --- a/src/org/traccar/protocol/AtrackProtocol.java +++ b/src/org/traccar/protocol/AtrackProtocol.java @@ -35,16 +35,16 @@ public class AtrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new AtrackFrameDecoder()); - pipeline.addLast("objectEncoder", new AtrackProtocolEncoder()); - pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(AtrackProtocol.this)); + pipeline.addLast(new AtrackFrameDecoder()); + pipeline.addLast(new AtrackProtocolEncoder()); + pipeline.addLast(new AtrackProtocolDecoder(AtrackProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new AtrackProtocolEncoder()); - pipeline.addLast("objectDecoder", new AtrackProtocolDecoder(AtrackProtocol.this)); + pipeline.addLast(new AtrackProtocolEncoder()); + pipeline.addLast(new AtrackProtocolDecoder(AtrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AuroProtocol.java b/src/org/traccar/protocol/AuroProtocol.java index 99affeba1..253c4a6da 100644 --- a/src/org/traccar/protocol/AuroProtocol.java +++ b/src/org/traccar/protocol/AuroProtocol.java @@ -35,10 +35,10 @@ public class AuroProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new AuroProtocolDecoder(AuroProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new AuroProtocolDecoder(AuroProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AustinNbProtocol.java b/src/org/traccar/protocol/AustinNbProtocol.java index 1ffb6e4ad..ac308521b 100644 --- a/src/org/traccar/protocol/AustinNbProtocol.java +++ b/src/org/traccar/protocol/AustinNbProtocol.java @@ -34,9 +34,9 @@ public class AustinNbProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new AustinNbProtocolDecoder(AustinNbProtocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new AustinNbProtocolDecoder(AustinNbProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AutoFonProtocol.java b/src/org/traccar/protocol/AutoFonProtocol.java index 993f8610c..1f6c1e488 100644 --- a/src/org/traccar/protocol/AutoFonProtocol.java +++ b/src/org/traccar/protocol/AutoFonProtocol.java @@ -32,8 +32,8 @@ public class AutoFonProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new AutoFonFrameDecoder()); - pipeline.addLast("objectDecoder", new AutoFonProtocolDecoder(AutoFonProtocol.this)); + pipeline.addLast(new AutoFonFrameDecoder()); + pipeline.addLast(new AutoFonProtocolDecoder(AutoFonProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AutoGradeProtocol.java b/src/org/traccar/protocol/AutoGradeProtocol.java index ba51c2bfc..2e1d1ce9c 100644 --- a/src/org/traccar/protocol/AutoGradeProtocol.java +++ b/src/org/traccar/protocol/AutoGradeProtocol.java @@ -35,10 +35,10 @@ public class AutoGradeProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ')')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new AutoGradeProtocolDecoder(AutoGradeProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ')')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new AutoGradeProtocolDecoder(AutoGradeProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AutoTrackProtocol.java b/src/org/traccar/protocol/AutoTrackProtocol.java index d6d4ac177..5dc8c3766 100644 --- a/src/org/traccar/protocol/AutoTrackProtocol.java +++ b/src/org/traccar/protocol/AutoTrackProtocol.java @@ -34,9 +34,8 @@ public class AutoTrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 5, 2, 2, 0, true)); - pipeline.addLast("objectDecoder", new AutoTrackProtocolDecoder(AutoTrackProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 5, 2, 2, 0, true)); + pipeline.addLast(new AutoTrackProtocolDecoder(AutoTrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/AvemaProtocol.java b/src/org/traccar/protocol/AvemaProtocol.java index e3fd61baa..3b5c042ce 100644 --- a/src/org/traccar/protocol/AvemaProtocol.java +++ b/src/org/traccar/protocol/AvemaProtocol.java @@ -35,10 +35,10 @@ public class AvemaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new AvemaProtocolDecoder(AvemaProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new AvemaProtocolDecoder(AvemaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Avl301Protocol.java b/src/org/traccar/protocol/Avl301Protocol.java index 98a9b8edc..d45799dbf 100644 --- a/src/org/traccar/protocol/Avl301Protocol.java +++ b/src/org/traccar/protocol/Avl301Protocol.java @@ -33,8 +33,8 @@ public class Avl301Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 2, 1, -3, 0)); - pipeline.addLast("objectDecoder", new Avl301ProtocolDecoder(Avl301Protocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 1, -3, 0)); + pipeline.addLast(new Avl301ProtocolDecoder(Avl301Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/BceProtocol.java b/src/org/traccar/protocol/BceProtocol.java index 880a4df70..eb75b7732 100644 --- a/src/org/traccar/protocol/BceProtocol.java +++ b/src/org/traccar/protocol/BceProtocol.java @@ -32,8 +32,8 @@ public class BceProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new BceFrameDecoder()); - pipeline.addLast("objectDecoder", new BceProtocolDecoder(BceProtocol.this)); + pipeline.addLast(new BceFrameDecoder()); + pipeline.addLast(new BceProtocolDecoder(BceProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/BlackKiteProtocol.java b/src/org/traccar/protocol/BlackKiteProtocol.java index 423562907..88eb5b5cd 100644 --- a/src/org/traccar/protocol/BlackKiteProtocol.java +++ b/src/org/traccar/protocol/BlackKiteProtocol.java @@ -33,8 +33,8 @@ public class BlackKiteProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new GalileoFrameDecoder()); - pipeline.addLast("objectDecoder", new BlackKiteProtocolDecoder(BlackKiteProtocol.this)); + pipeline.addLast(new GalileoFrameDecoder()); + pipeline.addLast(new BlackKiteProtocolDecoder(BlackKiteProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/BoxProtocol.java b/src/org/traccar/protocol/BoxProtocol.java index 6e76ee635..68d6ce2e0 100644 --- a/src/org/traccar/protocol/BoxProtocol.java +++ b/src/org/traccar/protocol/BoxProtocol.java @@ -35,10 +35,10 @@ public class BoxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new BoxProtocolDecoder(BoxProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\r')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new BoxProtocolDecoder(BoxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CalAmpProtocol.java b/src/org/traccar/protocol/CalAmpProtocol.java index 29cb2974f..1962623be 100644 --- a/src/org/traccar/protocol/CalAmpProtocol.java +++ b/src/org/traccar/protocol/CalAmpProtocol.java @@ -32,7 +32,7 @@ public class CalAmpProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new CalAmpProtocolDecoder(CalAmpProtocol.this)); + pipeline.addLast(new CalAmpProtocolDecoder(CalAmpProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CarTrackProtocol.java b/src/org/traccar/protocol/CarTrackProtocol.java index 2ac6598a4..b5eb80cba 100644 --- a/src/org/traccar/protocol/CarTrackProtocol.java +++ b/src/org/traccar/protocol/CarTrackProtocol.java @@ -35,10 +35,10 @@ public class CarTrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new CarTrackProtocolDecoder(CarTrackProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "##")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new CarTrackProtocolDecoder(CarTrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CarcellProtocol.java b/src/org/traccar/protocol/CarcellProtocol.java index 40ecfbbe7..8339b8345 100644 --- a/src/org/traccar/protocol/CarcellProtocol.java +++ b/src/org/traccar/protocol/CarcellProtocol.java @@ -39,11 +39,11 @@ public class CarcellProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new CarcellProtocolEncoder()); - pipeline.addLast("objectDecoder", new CarcellProtocolDecoder(CarcellProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\r')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new CarcellProtocolEncoder()); + pipeline.addLast(new CarcellProtocolDecoder(CarcellProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CarscopProtocol.java b/src/org/traccar/protocol/CarscopProtocol.java index c52b025bc..3c674630c 100644 --- a/src/org/traccar/protocol/CarscopProtocol.java +++ b/src/org/traccar/protocol/CarscopProtocol.java @@ -35,10 +35,10 @@ public class CarscopProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '^')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new CarscopProtocolDecoder(CarscopProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '^')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new CarscopProtocolDecoder(CarscopProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CastelProtocol.java b/src/org/traccar/protocol/CastelProtocol.java index fcf461fde..e82682dea 100644 --- a/src/org/traccar/protocol/CastelProtocol.java +++ b/src/org/traccar/protocol/CastelProtocol.java @@ -38,17 +38,16 @@ public class CastelProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, -4, 0, true)); - pipeline.addLast("objectEncoder", new CastelProtocolEncoder()); - pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, -4, 0, true)); + pipeline.addLast(new CastelProtocolEncoder()); + pipeline.addLast(new CastelProtocolDecoder(CastelProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new CastelProtocolEncoder()); - pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this)); + pipeline.addLast(new CastelProtocolEncoder()); + pipeline.addLast(new CastelProtocolDecoder(CastelProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CautelaProtocol.java b/src/org/traccar/protocol/CautelaProtocol.java index dc5c82193..b9e5323ad 100644 --- a/src/org/traccar/protocol/CautelaProtocol.java +++ b/src/org/traccar/protocol/CautelaProtocol.java @@ -35,10 +35,10 @@ public class CautelaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new CautelaProtocolDecoder(CautelaProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new CautelaProtocolDecoder(CautelaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CellocatorProtocol.java b/src/org/traccar/protocol/CellocatorProtocol.java index bf186e67f..0bdd962fc 100644 --- a/src/org/traccar/protocol/CellocatorProtocol.java +++ b/src/org/traccar/protocol/CellocatorProtocol.java @@ -35,16 +35,16 @@ public class CellocatorProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CellocatorFrameDecoder()); - pipeline.addLast("objectEncoder", new CellocatorProtocolEncoder()); - pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(CellocatorProtocol.this)); + pipeline.addLast(new CellocatorFrameDecoder()); + pipeline.addLast(new CellocatorProtocolEncoder()); + pipeline.addLast(new CellocatorProtocolDecoder(CellocatorProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new CellocatorProtocolEncoder()); - pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(CellocatorProtocol.this)); + pipeline.addLast(new CellocatorProtocolEncoder()); + pipeline.addLast(new CellocatorProtocolDecoder(CellocatorProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CguardProtocol.java b/src/org/traccar/protocol/CguardProtocol.java index 5d2ffb6fd..99a2c80a8 100644 --- a/src/org/traccar/protocol/CguardProtocol.java +++ b/src/org/traccar/protocol/CguardProtocol.java @@ -35,10 +35,10 @@ public class CguardProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new CguardProtocolDecoder(CguardProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new CguardProtocolDecoder(CguardProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CityeasyProtocol.java b/src/org/traccar/protocol/CityeasyProtocol.java index 82b33e0f4..4f1ddced3 100644 --- a/src/org/traccar/protocol/CityeasyProtocol.java +++ b/src/org/traccar/protocol/CityeasyProtocol.java @@ -39,9 +39,9 @@ public class CityeasyProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); - pipeline.addLast("objectEncoder", new CityeasyProtocolEncoder()); - pipeline.addLast("objectDecoder", new CityeasyProtocolDecoder(CityeasyProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); + pipeline.addLast(new CityeasyProtocolEncoder()); + pipeline.addLast(new CityeasyProtocolDecoder(CityeasyProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ContinentalProtocol.java b/src/org/traccar/protocol/ContinentalProtocol.java index 540128120..f6bce7503 100644 --- a/src/org/traccar/protocol/ContinentalProtocol.java +++ b/src/org/traccar/protocol/ContinentalProtocol.java @@ -33,8 +33,8 @@ public class ContinentalProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); - pipeline.addLast("objectDecoder", new ContinentalProtocolDecoder(ContinentalProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0)); + pipeline.addLast(new ContinentalProtocolDecoder(ContinentalProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/CradlepointProtocol.java b/src/org/traccar/protocol/CradlepointProtocol.java index 51de43bd9..9cc1eb527 100644 --- a/src/org/traccar/protocol/CradlepointProtocol.java +++ b/src/org/traccar/protocol/CradlepointProtocol.java @@ -35,10 +35,10 @@ public class CradlepointProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new CradlepointProtocolDecoder(CradlepointProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new CradlepointProtocolDecoder(CradlepointProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/DishaProtocol.java b/src/org/traccar/protocol/DishaProtocol.java index 1e746f270..ce8729ad4 100644 --- a/src/org/traccar/protocol/DishaProtocol.java +++ b/src/org/traccar/protocol/DishaProtocol.java @@ -35,10 +35,10 @@ public class DishaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new DishaProtocolDecoder(DishaProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new DishaProtocolDecoder(DishaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/DmtHttpProtocol.java b/src/org/traccar/protocol/DmtHttpProtocol.java index ee369dca0..11b5f3a84 100644 --- a/src/org/traccar/protocol/DmtHttpProtocol.java +++ b/src/org/traccar/protocol/DmtHttpProtocol.java @@ -35,10 +35,10 @@ public class DmtHttpProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(65535)); - pipeline.addLast("objectDecoder", new DmtHttpProtocolDecoder(DmtHttpProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(65535)); + pipeline.addLast(new DmtHttpProtocolDecoder(DmtHttpProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/DmtProtocol.java b/src/org/traccar/protocol/DmtProtocol.java index 3df261443..bce731254 100644 --- a/src/org/traccar/protocol/DmtProtocol.java +++ b/src/org/traccar/protocol/DmtProtocol.java @@ -34,9 +34,8 @@ public class DmtProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 3, 2, 0, 0, true)); - pipeline.addLast("objectDecoder", new DmtProtocolDecoder(DmtProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 3, 2, 0, 0, true)); + pipeline.addLast(new DmtProtocolDecoder(DmtProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/DwayProtocol.java b/src/org/traccar/protocol/DwayProtocol.java index d9af5bd02..7666f4c88 100644 --- a/src/org/traccar/protocol/DwayProtocol.java +++ b/src/org/traccar/protocol/DwayProtocol.java @@ -35,10 +35,10 @@ public class DwayProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new DwayProtocolDecoder(DwayProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new DwayProtocolDecoder(DwayProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/EasyTrackProtocol.java b/src/org/traccar/protocol/EasyTrackProtocol.java index 5e1bb48be..a66ce65f0 100644 --- a/src/org/traccar/protocol/EasyTrackProtocol.java +++ b/src/org/traccar/protocol/EasyTrackProtocol.java @@ -35,10 +35,10 @@ public class EasyTrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "#", "\r\n")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(EasyTrackProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "#", "\r\n")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new EasyTrackProtocolDecoder(EasyTrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/EelinkProtocol.java b/src/org/traccar/protocol/EelinkProtocol.java index 0ad23fc14..dec996279 100644 --- a/src/org/traccar/protocol/EelinkProtocol.java +++ b/src/org/traccar/protocol/EelinkProtocol.java @@ -40,16 +40,16 @@ public class EelinkProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2)); - pipeline.addLast("objectEncoder", new EelinkProtocolEncoder(false)); - pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 3, 2)); + pipeline.addLast(new EelinkProtocolEncoder(false)); + pipeline.addLast(new EelinkProtocolDecoder(EelinkProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new EelinkProtocolEncoder(true)); - pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this)); + pipeline.addLast(new EelinkProtocolEncoder(true)); + pipeline.addLast(new EelinkProtocolDecoder(EelinkProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/EgtsProtocol.java b/src/org/traccar/protocol/EgtsProtocol.java index 2bc2ec10d..1939bd7b9 100644 --- a/src/org/traccar/protocol/EgtsProtocol.java +++ b/src/org/traccar/protocol/EgtsProtocol.java @@ -32,8 +32,8 @@ public class EgtsProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new EgtsFrameDecoder()); - pipeline.addLast("objectDecoder", new EgtsProtocolDecoder(EgtsProtocol.this)); + pipeline.addLast(new EgtsFrameDecoder()); + pipeline.addLast(new EgtsProtocolDecoder(EgtsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/EnforaProtocol.java b/src/org/traccar/protocol/EnforaProtocol.java index ebdb4a31b..186e4c980 100644 --- a/src/org/traccar/protocol/EnforaProtocol.java +++ b/src/org/traccar/protocol/EnforaProtocol.java @@ -38,9 +38,9 @@ public class EnforaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 0, 2, -2, 2)); - pipeline.addLast("objectEncoder", new EnforaProtocolEncoder()); - pipeline.addLast("objectDecoder", new EnforaProtocolDecoder(EnforaProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 0, 2, -2, 2)); + pipeline.addLast(new EnforaProtocolEncoder()); + pipeline.addLast(new EnforaProtocolDecoder(EnforaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/EsealProtocol.java b/src/org/traccar/protocol/EsealProtocol.java index 54be201d1..3d50c1cde 100644 --- a/src/org/traccar/protocol/EsealProtocol.java +++ b/src/org/traccar/protocol/EsealProtocol.java @@ -40,11 +40,11 @@ public class EsealProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new EsealProtocolEncoder()); - pipeline.addLast("objectDecoder", new EsealProtocolDecoder(EsealProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new EsealProtocolEncoder()); + pipeline.addLast(new EsealProtocolDecoder(EsealProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/EskyProtocol.java b/src/org/traccar/protocol/EskyProtocol.java index 65dd607a3..4432d1b5a 100644 --- a/src/org/traccar/protocol/EskyProtocol.java +++ b/src/org/traccar/protocol/EskyProtocol.java @@ -34,10 +34,10 @@ public class EskyProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new EskyFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new EskyProtocolDecoder(EskyProtocol.this)); + pipeline.addLast(new EskyFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new EskyProtocolDecoder(EskyProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ExtremTracProtocol.java b/src/org/traccar/protocol/ExtremTracProtocol.java index e0c2876ca..e39bd54b0 100644 --- a/src/org/traccar/protocol/ExtremTracProtocol.java +++ b/src/org/traccar/protocol/ExtremTracProtocol.java @@ -35,10 +35,10 @@ public class ExtremTracProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new ExtremTracProtocolDecoder(ExtremTracProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new ExtremTracProtocolDecoder(ExtremTracProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FifotrackProtocol.java b/src/org/traccar/protocol/FifotrackProtocol.java index 6d42fc8fe..44c7b8489 100644 --- a/src/org/traccar/protocol/FifotrackProtocol.java +++ b/src/org/traccar/protocol/FifotrackProtocol.java @@ -34,9 +34,9 @@ public class FifotrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new FifotrackProtocolDecoder(FifotrackProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new FifotrackProtocolDecoder(FifotrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FlespiProtocol.java b/src/org/traccar/protocol/FlespiProtocol.java index 4ac5d2ccd..b81759772 100644 --- a/src/org/traccar/protocol/FlespiProtocol.java +++ b/src/org/traccar/protocol/FlespiProtocol.java @@ -35,10 +35,10 @@ public class FlespiProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(Integer.MAX_VALUE)); - pipeline.addLast("objectDecoder", new FlespiProtocolDecoder(FlespiProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE)); + pipeline.addLast(new FlespiProtocolDecoder(FlespiProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FlexCommProtocol.java b/src/org/traccar/protocol/FlexCommProtocol.java index 69bd99c79..0aa278ce8 100644 --- a/src/org/traccar/protocol/FlexCommProtocol.java +++ b/src/org/traccar/protocol/FlexCommProtocol.java @@ -35,10 +35,10 @@ public class FlexCommProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(2 + 2 + 101 + 5)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new FlexCommProtocolDecoder(FlexCommProtocol.this)); + pipeline.addLast(new FixedLengthFrameDecoder(2 + 2 + 101 + 5)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new FlexCommProtocolDecoder(FlexCommProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FlextrackProtocol.java b/src/org/traccar/protocol/FlextrackProtocol.java index a94df710a..08f6a9f47 100644 --- a/src/org/traccar/protocol/FlextrackProtocol.java +++ b/src/org/traccar/protocol/FlextrackProtocol.java @@ -35,10 +35,10 @@ public class FlextrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new FlextrackProtocolDecoder(FlextrackProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "\r")); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new FlextrackProtocolDecoder(FlextrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FoxProtocol.java b/src/org/traccar/protocol/FoxProtocol.java index 6f312dc8e..430c0665f 100644 --- a/src/org/traccar/protocol/FoxProtocol.java +++ b/src/org/traccar/protocol/FoxProtocol.java @@ -35,10 +35,10 @@ public class FoxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "</fox>")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new FoxProtocolDecoder(FoxProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "</fox>")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new FoxProtocolDecoder(FoxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FreedomProtocol.java b/src/org/traccar/protocol/FreedomProtocol.java index 7ea09d25a..4362b0e49 100644 --- a/src/org/traccar/protocol/FreedomProtocol.java +++ b/src/org/traccar/protocol/FreedomProtocol.java @@ -35,10 +35,10 @@ public class FreedomProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new FreedomProtocolDecoder(FreedomProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new FreedomProtocolDecoder(FreedomProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/FreematicsProtocol.java b/src/org/traccar/protocol/FreematicsProtocol.java index 6e7dfa15d..7435780cc 100644 --- a/src/org/traccar/protocol/FreematicsProtocol.java +++ b/src/org/traccar/protocol/FreematicsProtocol.java @@ -34,9 +34,9 @@ public class FreematicsProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new FreematicsProtocolDecoder(FreematicsProtocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new FreematicsProtocolDecoder(FreematicsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GalileoProtocol.java b/src/org/traccar/protocol/GalileoProtocol.java index 93178ea52..1ee03d7af 100644 --- a/src/org/traccar/protocol/GalileoProtocol.java +++ b/src/org/traccar/protocol/GalileoProtocol.java @@ -36,9 +36,9 @@ public class GalileoProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new GalileoFrameDecoder()); - pipeline.addLast("objectEncoder", new GalileoProtocolEncoder()); - pipeline.addLast("objectDecoder", new GalileoProtocolDecoder(GalileoProtocol.this)); + pipeline.addLast(new GalileoFrameDecoder()); + pipeline.addLast(new GalileoProtocolEncoder()); + pipeline.addLast(new GalileoProtocolDecoder(GalileoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GatorProtocol.java b/src/org/traccar/protocol/GatorProtocol.java index 531f1238c..f1a44dc71 100644 --- a/src/org/traccar/protocol/GatorProtocol.java +++ b/src/org/traccar/protocol/GatorProtocol.java @@ -33,14 +33,14 @@ public class GatorProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2)); - pipeline.addLast("objectDecoder", new GatorProtocolDecoder(GatorProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 3, 2)); + pipeline.addLast(new GatorProtocolDecoder(GatorProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new GatorProtocolDecoder(GatorProtocol.this)); + pipeline.addLast(new GatorProtocolDecoder(GatorProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GenxProtocol.java b/src/org/traccar/protocol/GenxProtocol.java index 2c3c4f7a0..b8b6d500b 100644 --- a/src/org/traccar/protocol/GenxProtocol.java +++ b/src/org/traccar/protocol/GenxProtocol.java @@ -34,9 +34,9 @@ public class GenxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GenxProtocolDecoder(GenxProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new GenxProtocolDecoder(GenxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gl100Protocol.java b/src/org/traccar/protocol/Gl100Protocol.java index 90beab23a..d1d9abc31 100644 --- a/src/org/traccar/protocol/Gl100Protocol.java +++ b/src/org/traccar/protocol/Gl100Protocol.java @@ -35,18 +35,18 @@ public class Gl100Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\0')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Gl100ProtocolDecoder(Gl100Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\0')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Gl100ProtocolDecoder(Gl100Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Gl100ProtocolDecoder(Gl100Protocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Gl100ProtocolDecoder(Gl100Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gl200Protocol.java b/src/org/traccar/protocol/Gl200Protocol.java index 15ed00d06..5548634df 100644 --- a/src/org/traccar/protocol/Gl200Protocol.java +++ b/src/org/traccar/protocol/Gl200Protocol.java @@ -41,18 +41,18 @@ public class Gl200Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Gl200FrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new Gl200ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(Gl200Protocol.this)); + pipeline.addLast(new Gl200FrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Gl200ProtocolEncoder()); + pipeline.addLast(new Gl200ProtocolDecoder(Gl200Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new Gl200ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(Gl200Protocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Gl200ProtocolEncoder()); + pipeline.addLast(new Gl200ProtocolDecoder(Gl200Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/GlobalSatProtocol.java b/src/org/traccar/protocol/GlobalSatProtocol.java index dddf07d55..1d8509566 100644 --- a/src/org/traccar/protocol/GlobalSatProtocol.java +++ b/src/org/traccar/protocol/GlobalSatProtocol.java @@ -35,10 +35,10 @@ public class GlobalSatProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '!')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GlobalSatProtocolDecoder(GlobalSatProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '!')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new GlobalSatProtocolDecoder(GlobalSatProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GnxProtocol.java b/src/org/traccar/protocol/GnxProtocol.java index 985f200eb..471c313f5 100644 --- a/src/org/traccar/protocol/GnxProtocol.java +++ b/src/org/traccar/protocol/GnxProtocol.java @@ -35,10 +35,10 @@ public class GnxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\n\r")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GnxProtocolDecoder(GnxProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "\n\r")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new GnxProtocolDecoder(GnxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GoSafeProtocol.java b/src/org/traccar/protocol/GoSafeProtocol.java index e4c6cc66f..377a3f690 100644 --- a/src/org/traccar/protocol/GoSafeProtocol.java +++ b/src/org/traccar/protocol/GoSafeProtocol.java @@ -35,10 +35,10 @@ public class GoSafeProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GoSafeProtocolDecoder(GoSafeProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new GoSafeProtocolDecoder(GoSafeProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GotopProtocol.java b/src/org/traccar/protocol/GotopProtocol.java index 272c38cd0..a469d38ab 100644 --- a/src/org/traccar/protocol/GotopProtocol.java +++ b/src/org/traccar/protocol/GotopProtocol.java @@ -35,10 +35,10 @@ public class GotopProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GotopProtocolDecoder(GotopProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new GotopProtocolDecoder(GotopProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gps056Protocol.java b/src/org/traccar/protocol/Gps056Protocol.java index f5122830d..6ae0b8528 100644 --- a/src/org/traccar/protocol/Gps056Protocol.java +++ b/src/org/traccar/protocol/Gps056Protocol.java @@ -32,8 +32,8 @@ public class Gps056Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Gps056FrameDecoder()); - pipeline.addLast("objectDecoder", new Gps056ProtocolDecoder(Gps056Protocol.this)); + pipeline.addLast(new Gps056FrameDecoder()); + pipeline.addLast(new Gps056ProtocolDecoder(Gps056Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gps103Protocol.java b/src/org/traccar/protocol/Gps103Protocol.java index 068f362c9..8e9e0ea70 100644 --- a/src/org/traccar/protocol/Gps103Protocol.java +++ b/src/org/traccar/protocol/Gps103Protocol.java @@ -46,20 +46,20 @@ public class Gps103Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(2048, "\r\n", "\n", ";")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new Gps103ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(Gps103Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(2048, "\r\n", "\n", ";")); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Gps103ProtocolEncoder()); + pipeline.addLast(new Gps103ProtocolDecoder(Gps103Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new Gps103ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(Gps103Protocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Gps103ProtocolEncoder()); + pipeline.addLast(new Gps103ProtocolDecoder(Gps103Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/GpsGateProtocol.java b/src/org/traccar/protocol/GpsGateProtocol.java index 4685e40b7..62af3cc66 100644 --- a/src/org/traccar/protocol/GpsGateProtocol.java +++ b/src/org/traccar/protocol/GpsGateProtocol.java @@ -35,10 +35,10 @@ public class GpsGateProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\0", "\n", "\r\n")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GpsGateProtocolDecoder(GpsGateProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "\0", "\n", "\r\n")); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new GpsGateProtocolDecoder(GpsGateProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GpsMarkerProtocol.java b/src/org/traccar/protocol/GpsMarkerProtocol.java index 0655d2c88..e8013bcec 100644 --- a/src/org/traccar/protocol/GpsMarkerProtocol.java +++ b/src/org/traccar/protocol/GpsMarkerProtocol.java @@ -35,10 +35,10 @@ public class GpsMarkerProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new GpsMarkerProtocolDecoder(GpsMarkerProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "\r")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new GpsMarkerProtocolDecoder(GpsMarkerProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GpsmtaProtocol.java b/src/org/traccar/protocol/GpsmtaProtocol.java index b2720cb8a..5753e6378 100644 --- a/src/org/traccar/protocol/GpsmtaProtocol.java +++ b/src/org/traccar/protocol/GpsmtaProtocol.java @@ -34,9 +34,9 @@ public class GpsmtaProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new GpsmtaProtocolDecoder(GpsmtaProtocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new GpsmtaProtocolDecoder(GpsmtaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/GranitProtocol.java b/src/org/traccar/protocol/GranitProtocol.java index 5855d34ee..b62d92f48 100644 --- a/src/org/traccar/protocol/GranitProtocol.java +++ b/src/org/traccar/protocol/GranitProtocol.java @@ -42,9 +42,9 @@ public class GranitProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new GranitFrameDecoder()); - pipeline.addLast("objectEncoder", new GranitProtocolEncoder()); - pipeline.addLast("objectDecoder", new GranitProtocolDecoder(GranitProtocol.this)); + pipeline.addLast(new GranitFrameDecoder()); + pipeline.addLast(new GranitProtocolEncoder()); + pipeline.addLast(new GranitProtocolDecoder(GranitProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gt02Protocol.java b/src/org/traccar/protocol/Gt02Protocol.java index f44cb3979..1d0ec8d0f 100644 --- a/src/org/traccar/protocol/Gt02Protocol.java +++ b/src/org/traccar/protocol/Gt02Protocol.java @@ -33,8 +33,8 @@ public class Gt02Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0)); - pipeline.addLast("objectDecoder", new Gt02ProtocolDecoder(Gt02Protocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0)); + pipeline.addLast(new Gt02ProtocolDecoder(Gt02Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gt06Protocol.java b/src/org/traccar/protocol/Gt06Protocol.java index e00a585ca..fa928490e 100644 --- a/src/org/traccar/protocol/Gt06Protocol.java +++ b/src/org/traccar/protocol/Gt06Protocol.java @@ -37,9 +37,9 @@ public class Gt06Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Gt06FrameDecoder()); - pipeline.addLast("objectEncoder", new Gt06ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Gt06ProtocolDecoder(Gt06Protocol.this)); + pipeline.addLast(new Gt06FrameDecoder()); + pipeline.addLast(new Gt06ProtocolEncoder()); + pipeline.addLast(new Gt06ProtocolDecoder(Gt06Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Gt30Protocol.java b/src/org/traccar/protocol/Gt30Protocol.java index 43bb5a70b..69984bf73 100644 --- a/src/org/traccar/protocol/Gt30Protocol.java +++ b/src/org/traccar/protocol/Gt30Protocol.java @@ -35,10 +35,10 @@ public class Gt30Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Gt30ProtocolDecoder(Gt30Protocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Gt30ProtocolDecoder(Gt30Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/H02Protocol.java b/src/org/traccar/protocol/H02Protocol.java index 29ac89f78..e4b9784c1 100644 --- a/src/org/traccar/protocol/H02Protocol.java +++ b/src/org/traccar/protocol/H02Protocol.java @@ -43,18 +43,18 @@ public class H02Protocol extends BaseProtocol { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { int messageLength = Context.getConfig().getInteger(getName() + ".messageLength"); - pipeline.addLast("frameDecoder", new H02FrameDecoder(messageLength)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new H02ProtocolEncoder()); - pipeline.addLast("objectDecoder", new H02ProtocolDecoder(H02Protocol.this)); + pipeline.addLast(new H02FrameDecoder(messageLength)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new H02ProtocolEncoder()); + pipeline.addLast(new H02ProtocolDecoder(H02Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new H02ProtocolEncoder()); - pipeline.addLast("objectDecoder", new H02ProtocolDecoder(H02Protocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new H02ProtocolEncoder()); + pipeline.addLast(new H02ProtocolDecoder(H02Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/HaicomProtocol.java b/src/org/traccar/protocol/HaicomProtocol.java index 45bf9f890..769499cbe 100644 --- a/src/org/traccar/protocol/HaicomProtocol.java +++ b/src/org/traccar/protocol/HaicomProtocol.java @@ -35,10 +35,10 @@ public class HaicomProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '*')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new HaicomProtocolDecoder(HaicomProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '*')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new HaicomProtocolDecoder(HaicomProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/HomtecsProtocol.java b/src/org/traccar/protocol/HomtecsProtocol.java index e57cb96be..bd5c18603 100644 --- a/src/org/traccar/protocol/HomtecsProtocol.java +++ b/src/org/traccar/protocol/HomtecsProtocol.java @@ -34,9 +34,9 @@ public class HomtecsProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new HomtecsProtocolDecoder(HomtecsProtocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new HomtecsProtocolDecoder(HomtecsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/HuaShengProtocol.java b/src/org/traccar/protocol/HuaShengProtocol.java index b1f187e14..6f6aebaaa 100644 --- a/src/org/traccar/protocol/HuaShengProtocol.java +++ b/src/org/traccar/protocol/HuaShengProtocol.java @@ -32,8 +32,8 @@ public class HuaShengProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new HuaShengFrameDecoder()); - pipeline.addLast("objectDecoder", new HuaShengProtocolDecoder(HuaShengProtocol.this)); + pipeline.addLast(new HuaShengFrameDecoder()); + pipeline.addLast(new HuaShengProtocolDecoder(HuaShengProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/HuabaoProtocol.java b/src/org/traccar/protocol/HuabaoProtocol.java index 113aa4b62..f09edb8db 100644 --- a/src/org/traccar/protocol/HuabaoProtocol.java +++ b/src/org/traccar/protocol/HuabaoProtocol.java @@ -36,9 +36,9 @@ public class HuabaoProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new HuabaoFrameDecoder()); - pipeline.addLast("objectEncoder", new HuabaoProtocolEncoder()); - pipeline.addLast("objectDecoder", new HuabaoProtocolDecoder(HuabaoProtocol.this)); + pipeline.addLast(new HuabaoFrameDecoder()); + pipeline.addLast(new HuabaoProtocolEncoder()); + pipeline.addLast(new HuabaoProtocolDecoder(HuabaoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/HunterProProtocol.java b/src/org/traccar/protocol/HunterProProtocol.java index 8b81e8f22..432390030 100644 --- a/src/org/traccar/protocol/HunterProProtocol.java +++ b/src/org/traccar/protocol/HunterProProtocol.java @@ -35,10 +35,10 @@ public class HunterProProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new HunterProProtocolDecoder(HunterProProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "\r")); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new HunterProProtocolDecoder(HunterProProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/IdplProtocol.java b/src/org/traccar/protocol/IdplProtocol.java index 2275aaeb2..c90b558d1 100644 --- a/src/org/traccar/protocol/IdplProtocol.java +++ b/src/org/traccar/protocol/IdplProtocol.java @@ -35,10 +35,10 @@ public class IdplProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new IdplProtocolDecoder(IdplProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new IdplProtocolDecoder(IdplProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/IntellitracProtocol.java b/src/org/traccar/protocol/IntellitracProtocol.java index fc954625a..6f56c0c7b 100644 --- a/src/org/traccar/protocol/IntellitracProtocol.java +++ b/src/org/traccar/protocol/IntellitracProtocol.java @@ -34,10 +34,10 @@ public class IntellitracProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new IntellitracFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new IntellitracProtocolDecoder(IntellitracProtocol.this)); + pipeline.addLast(new IntellitracFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new IntellitracProtocolDecoder(IntellitracProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ItsProtocol.java b/src/org/traccar/protocol/ItsProtocol.java index dfd5c37a0..00821d4e7 100644 --- a/src/org/traccar/protocol/ItsProtocol.java +++ b/src/org/traccar/protocol/ItsProtocol.java @@ -35,10 +35,10 @@ public class ItsProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '*')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new ItsProtocolDecoder(ItsProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '*')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new ItsProtocolDecoder(ItsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Ivt401Protocol.java b/src/org/traccar/protocol/Ivt401Protocol.java index dce0f2b79..74938d154 100644 --- a/src/org/traccar/protocol/Ivt401Protocol.java +++ b/src/org/traccar/protocol/Ivt401Protocol.java @@ -34,9 +34,9 @@ public class Ivt401Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ';')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Ivt401ProtocolDecoder(Ivt401Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ';')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Ivt401ProtocolDecoder(Ivt401Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/JpKorjarProtocol.java b/src/org/traccar/protocol/JpKorjarProtocol.java index 020575a7d..36ae942b8 100644 --- a/src/org/traccar/protocol/JpKorjarProtocol.java +++ b/src/org/traccar/protocol/JpKorjarProtocol.java @@ -34,9 +34,9 @@ public class JpKorjarProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, this.getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new JpKorjarFrameDecoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new JpKorjarProtocolDecoder(JpKorjarProtocol.this)); + pipeline.addLast(new JpKorjarFrameDecoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new JpKorjarProtocolDecoder(JpKorjarProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Jt600Protocol.java b/src/org/traccar/protocol/Jt600Protocol.java index 17fd4cb6b..8544446bb 100644 --- a/src/org/traccar/protocol/Jt600Protocol.java +++ b/src/org/traccar/protocol/Jt600Protocol.java @@ -39,10 +39,10 @@ public class Jt600Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Jt600FrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new Jt600ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(Jt600Protocol.this)); + pipeline.addLast(new Jt600FrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Jt600ProtocolEncoder()); + pipeline.addLast(new Jt600ProtocolDecoder(Jt600Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/KenjiProtocol.java b/src/org/traccar/protocol/KenjiProtocol.java index 15eb3d77a..830e93fe3 100644 --- a/src/org/traccar/protocol/KenjiProtocol.java +++ b/src/org/traccar/protocol/KenjiProtocol.java @@ -36,10 +36,10 @@ public class KenjiProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new KenjiProtocolDecoder(KenjiProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new KenjiProtocolDecoder(KenjiProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/KhdProtocol.java b/src/org/traccar/protocol/KhdProtocol.java index 47a30de5a..6fa755353 100644 --- a/src/org/traccar/protocol/KhdProtocol.java +++ b/src/org/traccar/protocol/KhdProtocol.java @@ -37,9 +37,9 @@ public class KhdProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(512, 3, 2)); - pipeline.addLast("objectEncoder", new KhdProtocolEncoder()); - pipeline.addLast("objectDecoder", new KhdProtocolDecoder(KhdProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(512, 3, 2)); + pipeline.addLast(new KhdProtocolEncoder()); + pipeline.addLast(new KhdProtocolDecoder(KhdProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/L100Protocol.java b/src/org/traccar/protocol/L100Protocol.java index 2d29bee40..0332f2ec4 100644 --- a/src/org/traccar/protocol/L100Protocol.java +++ b/src/org/traccar/protocol/L100Protocol.java @@ -34,10 +34,10 @@ public class L100Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new L100FrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new L100ProtocolDecoder(L100Protocol.this)); + pipeline.addLast(new L100FrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new L100ProtocolDecoder(L100Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/LaipacProtocol.java b/src/org/traccar/protocol/LaipacProtocol.java index aafada331..1a2783cec 100644 --- a/src/org/traccar/protocol/LaipacProtocol.java +++ b/src/org/traccar/protocol/LaipacProtocol.java @@ -35,10 +35,10 @@ public class LaipacProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new LaipacProtocolDecoder(LaipacProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new LaipacProtocolDecoder(LaipacProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/M2cProtocol.java b/src/org/traccar/protocol/M2cProtocol.java index ef16108cd..dc5b0cf0f 100644 --- a/src/org/traccar/protocol/M2cProtocol.java +++ b/src/org/traccar/protocol/M2cProtocol.java @@ -35,10 +35,10 @@ public class M2cProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(32 * 1024, ']')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new M2cProtocolDecoder(M2cProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(32 * 1024, ']')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new M2cProtocolDecoder(M2cProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/M2mProtocol.java b/src/org/traccar/protocol/M2mProtocol.java index 70dfc7b39..11bc73ea9 100644 --- a/src/org/traccar/protocol/M2mProtocol.java +++ b/src/org/traccar/protocol/M2mProtocol.java @@ -33,8 +33,8 @@ public class M2mProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(23)); - pipeline.addLast("objectDecoder", new M2mProtocolDecoder(M2mProtocol.this)); + pipeline.addLast(new FixedLengthFrameDecoder(23)); + pipeline.addLast(new M2mProtocolDecoder(M2mProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MaestroProtocol.java b/src/org/traccar/protocol/MaestroProtocol.java index 5a7cbcf4d..13aa949b1 100644 --- a/src/org/traccar/protocol/MaestroProtocol.java +++ b/src/org/traccar/protocol/MaestroProtocol.java @@ -35,10 +35,10 @@ public class MaestroProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(160)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new MaestroProtocolDecoder(MaestroProtocol.this)); + pipeline.addLast(new FixedLengthFrameDecoder(160)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new MaestroProtocolDecoder(MaestroProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ManPowerProtocol.java b/src/org/traccar/protocol/ManPowerProtocol.java index 5567cdccb..f4f1e3059 100644 --- a/src/org/traccar/protocol/ManPowerProtocol.java +++ b/src/org/traccar/protocol/ManPowerProtocol.java @@ -35,10 +35,10 @@ public class ManPowerProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ';')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new ManPowerProtocolDecoder(ManPowerProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ';')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new ManPowerProtocolDecoder(ManPowerProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MegastekProtocol.java b/src/org/traccar/protocol/MegastekProtocol.java index 862d1abd2..0e0dc84a7 100644 --- a/src/org/traccar/protocol/MegastekProtocol.java +++ b/src/org/traccar/protocol/MegastekProtocol.java @@ -34,10 +34,10 @@ public class MegastekProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new MegastekFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new MegastekProtocolDecoder(MegastekProtocol.this)); + pipeline.addLast(new MegastekFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new MegastekProtocolDecoder(MegastekProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MeiligaoProtocol.java b/src/org/traccar/protocol/MeiligaoProtocol.java index 0b745f0c6..ab243727b 100644 --- a/src/org/traccar/protocol/MeiligaoProtocol.java +++ b/src/org/traccar/protocol/MeiligaoProtocol.java @@ -42,16 +42,16 @@ public class MeiligaoProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new MeiligaoFrameDecoder()); - pipeline.addLast("objectEncoder", new MeiligaoProtocolEncoder()); - pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(MeiligaoProtocol.this)); + pipeline.addLast(new MeiligaoFrameDecoder()); + pipeline.addLast(new MeiligaoProtocolEncoder()); + pipeline.addLast(new MeiligaoProtocolDecoder(MeiligaoProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new MeiligaoProtocolEncoder()); - pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(MeiligaoProtocol.this)); + pipeline.addLast(new MeiligaoProtocolEncoder()); + pipeline.addLast(new MeiligaoProtocolDecoder(MeiligaoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MeitrackProtocol.java b/src/org/traccar/protocol/MeitrackProtocol.java index b9be2a8fd..d5ad38e1c 100644 --- a/src/org/traccar/protocol/MeitrackProtocol.java +++ b/src/org/traccar/protocol/MeitrackProtocol.java @@ -42,18 +42,18 @@ public class MeitrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new MeitrackFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new MeitrackProtocolEncoder()); - pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(MeitrackProtocol.this)); + pipeline.addLast(new MeitrackFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new MeitrackProtocolEncoder()); + pipeline.addLast(new MeitrackProtocolDecoder(MeitrackProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new MeitrackProtocolEncoder()); - pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(MeitrackProtocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new MeitrackProtocolEncoder()); + pipeline.addLast(new MeitrackProtocolDecoder(MeitrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MilesmateProtocol.java b/src/org/traccar/protocol/MilesmateProtocol.java index 59d5a39ae..1c9a347ff 100644 --- a/src/org/traccar/protocol/MilesmateProtocol.java +++ b/src/org/traccar/protocol/MilesmateProtocol.java @@ -35,10 +35,10 @@ public class MilesmateProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new MilesmateProtocolDecoder(MilesmateProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new MilesmateProtocolDecoder(MilesmateProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MiniFinderProtocol.java b/src/org/traccar/protocol/MiniFinderProtocol.java index 05641dcbe..b9f7948e2 100644 --- a/src/org/traccar/protocol/MiniFinderProtocol.java +++ b/src/org/traccar/protocol/MiniFinderProtocol.java @@ -48,11 +48,11 @@ public class MiniFinderProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ';')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new MiniFinderProtocolEncoder()); - pipeline.addLast("objectDecoder", new MiniFinderProtocolDecoder(MiniFinderProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ';')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new MiniFinderProtocolEncoder()); + pipeline.addLast(new MiniFinderProtocolDecoder(MiniFinderProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Mta6Protocol.java b/src/org/traccar/protocol/Mta6Protocol.java index e0b3f6063..ab046f797 100644 --- a/src/org/traccar/protocol/Mta6Protocol.java +++ b/src/org/traccar/protocol/Mta6Protocol.java @@ -36,10 +36,10 @@ public class Mta6Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(65535)); - pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder( + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(65535)); + pipeline.addLast(new Mta6ProtocolDecoder( Mta6Protocol.this, !Context.getConfig().getBoolean(getName() + ".can"))); } }); diff --git a/src/org/traccar/protocol/MtxProtocol.java b/src/org/traccar/protocol/MtxProtocol.java index 2f33909db..65057af19 100644 --- a/src/org/traccar/protocol/MtxProtocol.java +++ b/src/org/traccar/protocol/MtxProtocol.java @@ -35,10 +35,10 @@ public class MtxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new MtxProtocolDecoder(MtxProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new MtxProtocolDecoder(MtxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/MxtProtocol.java b/src/org/traccar/protocol/MxtProtocol.java index 8bfb958ab..516b19e35 100644 --- a/src/org/traccar/protocol/MxtProtocol.java +++ b/src/org/traccar/protocol/MxtProtocol.java @@ -32,8 +32,8 @@ public class MxtProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new MxtFrameDecoder()); - pipeline.addLast("objectDecoder", new MxtProtocolDecoder(MxtProtocol.this)); + pipeline.addLast(new MxtFrameDecoder()); + pipeline.addLast(new MxtProtocolDecoder(MxtProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/NavigilProtocol.java b/src/org/traccar/protocol/NavigilProtocol.java index 82f4af17d..8bec02fd0 100644 --- a/src/org/traccar/protocol/NavigilProtocol.java +++ b/src/org/traccar/protocol/NavigilProtocol.java @@ -32,8 +32,8 @@ public class NavigilProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new NavigilFrameDecoder()); - pipeline.addLast("objectDecoder", new NavigilProtocolDecoder(NavigilProtocol.this)); + pipeline.addLast(new NavigilFrameDecoder()); + pipeline.addLast(new NavigilProtocolDecoder(NavigilProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/NavisProtocol.java b/src/org/traccar/protocol/NavisProtocol.java index 92b705517..61a292b71 100644 --- a/src/org/traccar/protocol/NavisProtocol.java +++ b/src/org/traccar/protocol/NavisProtocol.java @@ -34,9 +34,8 @@ public class NavisProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 4 * 1024, 12, 2, 2, 0, true)); - pipeline.addLast("objectDecoder", new NavisProtocolDecoder(NavisProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 4096, 12, 2, 2, 0, true)); + pipeline.addLast(new NavisProtocolDecoder(NavisProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/NoranProtocol.java b/src/org/traccar/protocol/NoranProtocol.java index 9cae57b32..1dfc25a7d 100644 --- a/src/org/traccar/protocol/NoranProtocol.java +++ b/src/org/traccar/protocol/NoranProtocol.java @@ -39,8 +39,8 @@ public class NoranProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new NoranProtocolEncoder()); - pipeline.addLast("objectDecoder", new NoranProtocolDecoder(NoranProtocol.this)); + pipeline.addLast(new NoranProtocolEncoder()); + pipeline.addLast(new NoranProtocolDecoder(NoranProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/NvsProtocol.java b/src/org/traccar/protocol/NvsProtocol.java index aaf447120..537ecdd92 100644 --- a/src/org/traccar/protocol/NvsProtocol.java +++ b/src/org/traccar/protocol/NvsProtocol.java @@ -32,8 +32,8 @@ public class NvsProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new NvsFrameDecoder()); - pipeline.addLast("objectDecoder", new NvsProtocolDecoder(NvsProtocol.this)); + pipeline.addLast(new NvsFrameDecoder()); + pipeline.addLast(new NvsProtocolDecoder(NvsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ObdDongleProtocol.java b/src/org/traccar/protocol/ObdDongleProtocol.java index 5f50b16ae..1a45e5a2c 100644 --- a/src/org/traccar/protocol/ObdDongleProtocol.java +++ b/src/org/traccar/protocol/ObdDongleProtocol.java @@ -33,8 +33,8 @@ public class ObdDongleProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1099, 20, 2, 3, 0)); - pipeline.addLast("objectDecoder", new ObdDongleProtocolDecoder(ObdDongleProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1099, 20, 2, 3, 0)); + pipeline.addLast(new ObdDongleProtocolDecoder(ObdDongleProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/OigoProtocol.java b/src/org/traccar/protocol/OigoProtocol.java index b4f2b4163..da113ac52 100644 --- a/src/org/traccar/protocol/OigoProtocol.java +++ b/src/org/traccar/protocol/OigoProtocol.java @@ -32,7 +32,7 @@ public class OigoProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new OigoProtocolDecoder(OigoProtocol.this)); + pipeline.addLast(new OigoProtocolDecoder(OigoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/OkoProtocol.java b/src/org/traccar/protocol/OkoProtocol.java index 21f06cca0..9f8510530 100644 --- a/src/org/traccar/protocol/OkoProtocol.java +++ b/src/org/traccar/protocol/OkoProtocol.java @@ -34,9 +34,9 @@ public class OkoProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '}')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new OkoProtocolDecoder(OkoProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '}')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new OkoProtocolDecoder(OkoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/OpenGtsProtocol.java b/src/org/traccar/protocol/OpenGtsProtocol.java index afc0b0c60..77cd3cfbe 100644 --- a/src/org/traccar/protocol/OpenGtsProtocol.java +++ b/src/org/traccar/protocol/OpenGtsProtocol.java @@ -35,10 +35,10 @@ public class OpenGtsProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(16384)); - pipeline.addLast("objectDecoder", new OpenGtsProtocolDecoder(OpenGtsProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(16384)); + pipeline.addLast(new OpenGtsProtocolDecoder(OpenGtsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/OrionProtocol.java b/src/org/traccar/protocol/OrionProtocol.java index ba7044cce..d7c23f967 100644 --- a/src/org/traccar/protocol/OrionProtocol.java +++ b/src/org/traccar/protocol/OrionProtocol.java @@ -32,8 +32,8 @@ public class OrionProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new OrionFrameDecoder()); - pipeline.addLast("objectDecoder", new OrionProtocolDecoder(OrionProtocol.this)); + pipeline.addLast(new OrionFrameDecoder()); + pipeline.addLast(new OrionProtocolDecoder(OrionProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/OsmAndProtocol.java b/src/org/traccar/protocol/OsmAndProtocol.java index a199f067a..3afda14b1 100644 --- a/src/org/traccar/protocol/OsmAndProtocol.java +++ b/src/org/traccar/protocol/OsmAndProtocol.java @@ -35,10 +35,10 @@ public class OsmAndProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(16384)); - pipeline.addLast("objectDecoder", new OsmAndProtocolDecoder(OsmAndProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(16384)); + pipeline.addLast(new OsmAndProtocolDecoder(OsmAndProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/OwnTracksProtocol.java b/src/org/traccar/protocol/OwnTracksProtocol.java index 275bb739a..076cdfaba 100644 --- a/src/org/traccar/protocol/OwnTracksProtocol.java +++ b/src/org/traccar/protocol/OwnTracksProtocol.java @@ -36,10 +36,10 @@ public class OwnTracksProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(16384)); - pipeline.addLast("objectDecoder", new OwnTracksProtocolDecoder(OwnTracksProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(16384)); + pipeline.addLast(new OwnTracksProtocolDecoder(OwnTracksProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/PathAwayProtocol.java b/src/org/traccar/protocol/PathAwayProtocol.java index 7cb5a3fca..c8f3396a0 100644 --- a/src/org/traccar/protocol/PathAwayProtocol.java +++ b/src/org/traccar/protocol/PathAwayProtocol.java @@ -35,10 +35,10 @@ public class PathAwayProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(16384)); - pipeline.addLast("objectDecoder", new PathAwayProtocolDecoder(PathAwayProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(16384)); + pipeline.addLast(new PathAwayProtocolDecoder(PathAwayProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/PiligrimProtocol.java b/src/org/traccar/protocol/PiligrimProtocol.java index ff602d366..dcfd7e87a 100644 --- a/src/org/traccar/protocol/PiligrimProtocol.java +++ b/src/org/traccar/protocol/PiligrimProtocol.java @@ -35,10 +35,10 @@ public class PiligrimProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(16384)); - pipeline.addLast("objectDecoder", new PiligrimProtocolDecoder(PiligrimProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(16384)); + pipeline.addLast(new PiligrimProtocolDecoder(PiligrimProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/PretraceProtocol.java b/src/org/traccar/protocol/PretraceProtocol.java index 811c387f6..b7d8471e9 100644 --- a/src/org/traccar/protocol/PretraceProtocol.java +++ b/src/org/traccar/protocol/PretraceProtocol.java @@ -39,11 +39,11 @@ public class PretraceProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ')')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new PretraceProtocolEncoder()); - pipeline.addLast("objectDecoder", new PretraceProtocolDecoder(PretraceProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ')')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new PretraceProtocolEncoder()); + pipeline.addLast(new PretraceProtocolDecoder(PretraceProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/PricolProtocol.java b/src/org/traccar/protocol/PricolProtocol.java index ca52e2734..7b7aae95f 100644 --- a/src/org/traccar/protocol/PricolProtocol.java +++ b/src/org/traccar/protocol/PricolProtocol.java @@ -33,14 +33,14 @@ public class PricolProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(64)); - pipeline.addLast("objectDecoder", new PricolProtocolDecoder(PricolProtocol.this)); + pipeline.addLast(new FixedLengthFrameDecoder(64)); + pipeline.addLast(new PricolProtocolDecoder(PricolProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new PricolProtocolDecoder(PricolProtocol.this)); + pipeline.addLast(new PricolProtocolDecoder(PricolProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/ProgressProtocol.java b/src/org/traccar/protocol/ProgressProtocol.java index 22fdfbd48..9306504d7 100644 --- a/src/org/traccar/protocol/ProgressProtocol.java +++ b/src/org/traccar/protocol/ProgressProtocol.java @@ -34,9 +34,8 @@ public class ProgressProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, 4, 0, true)); - pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(ProgressProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, 4, 0, true)); + pipeline.addLast(new ProgressProtocolDecoder(ProgressProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Pt3000Protocol.java b/src/org/traccar/protocol/Pt3000Protocol.java index 03cc493d9..12fe1d9e9 100644 --- a/src/org/traccar/protocol/Pt3000Protocol.java +++ b/src/org/traccar/protocol/Pt3000Protocol.java @@ -35,10 +35,10 @@ public class Pt3000Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, 'd')); // probably wrong - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Pt3000ProtocolDecoder(Pt3000Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, 'd')); // probably wrong + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Pt3000ProtocolDecoder(Pt3000Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Pt502Protocol.java b/src/org/traccar/protocol/Pt502Protocol.java index fe8a0bb6c..1af2b8c0c 100644 --- a/src/org/traccar/protocol/Pt502Protocol.java +++ b/src/org/traccar/protocol/Pt502Protocol.java @@ -40,10 +40,10 @@ public class Pt502Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Pt502FrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new Pt502ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(Pt502Protocol.this)); + pipeline.addLast(new Pt502FrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Pt502ProtocolEncoder()); + pipeline.addLast(new Pt502ProtocolDecoder(Pt502Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Pt60Protocol.java b/src/org/traccar/protocol/Pt60Protocol.java index 6c03f209e..3f2244571 100644 --- a/src/org/traccar/protocol/Pt60Protocol.java +++ b/src/org/traccar/protocol/Pt60Protocol.java @@ -35,10 +35,10 @@ public class Pt60Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "@R#@")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Pt60ProtocolDecoder(Pt60Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "@R#@")); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Pt60ProtocolDecoder(Pt60Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/RaveonProtocol.java b/src/org/traccar/protocol/RaveonProtocol.java index 3dfca17fb..5fac461b0 100644 --- a/src/org/traccar/protocol/RaveonProtocol.java +++ b/src/org/traccar/protocol/RaveonProtocol.java @@ -35,10 +35,10 @@ public class RaveonProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new RaveonProtocolDecoder(RaveonProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new RaveonProtocolDecoder(RaveonProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/RecodaProtocol.java b/src/org/traccar/protocol/RecodaProtocol.java index ac8f772b6..e497d713e 100644 --- a/src/org/traccar/protocol/RecodaProtocol.java +++ b/src/org/traccar/protocol/RecodaProtocol.java @@ -34,9 +34,8 @@ public class RecodaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 4, 4, -8, 0, true)); - pipeline.addLast("objectDecoder", new RecodaProtocolDecoder(RecodaProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 4, 4, -8, 0, true)); + pipeline.addLast(new RecodaProtocolDecoder(RecodaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/RetranslatorProtocol.java b/src/org/traccar/protocol/RetranslatorProtocol.java index 725e37bd2..0715c7857 100644 --- a/src/org/traccar/protocol/RetranslatorProtocol.java +++ b/src/org/traccar/protocol/RetranslatorProtocol.java @@ -32,8 +32,8 @@ public class RetranslatorProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new RetranslatorFrameDecoder()); - pipeline.addLast("objectDecoder", new RetranslatorProtocolDecoder(RetranslatorProtocol.this)); + pipeline.addLast(new RetranslatorFrameDecoder()); + pipeline.addLast(new RetranslatorProtocolDecoder(RetranslatorProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/RitiProtocol.java b/src/org/traccar/protocol/RitiProtocol.java index 9c2b93feb..25854e2ec 100644 --- a/src/org/traccar/protocol/RitiProtocol.java +++ b/src/org/traccar/protocol/RitiProtocol.java @@ -34,9 +34,8 @@ public class RitiProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", - new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 105, 2, 3, 0, true)); - pipeline.addLast("objectDecoder", new RitiProtocolDecoder(RitiProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 105, 2, 3, 0, true)); + pipeline.addLast(new RitiProtocolDecoder(RitiProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/RoboTrackProtocol.java b/src/org/traccar/protocol/RoboTrackProtocol.java index 6ff670042..72357f0b8 100644 --- a/src/org/traccar/protocol/RoboTrackProtocol.java +++ b/src/org/traccar/protocol/RoboTrackProtocol.java @@ -32,8 +32,8 @@ public class RoboTrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new RoboTrackFrameDecoder()); - pipeline.addLast("objectDecoder", new RoboTrackProtocolDecoder(RoboTrackProtocol.this)); + pipeline.addLast(new RoboTrackFrameDecoder()); + pipeline.addLast(new RoboTrackProtocolDecoder(RoboTrackProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/RuptelaProtocol.java b/src/org/traccar/protocol/RuptelaProtocol.java index eb9bdada7..124297b80 100644 --- a/src/org/traccar/protocol/RuptelaProtocol.java +++ b/src/org/traccar/protocol/RuptelaProtocol.java @@ -42,9 +42,9 @@ public class RuptelaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 0, 2, 2, 0)); - pipeline.addLast("objectEncoder", new RuptelaProtocolEncoder()); - pipeline.addLast("objectDecoder", new RuptelaProtocolDecoder(RuptelaProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 0, 2, 2, 0)); + pipeline.addLast(new RuptelaProtocolEncoder()); + pipeline.addLast(new RuptelaProtocolDecoder(RuptelaProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SabertekProtocol.java b/src/org/traccar/protocol/SabertekProtocol.java index 55cb346ca..5e173fe3b 100644 --- a/src/org/traccar/protocol/SabertekProtocol.java +++ b/src/org/traccar/protocol/SabertekProtocol.java @@ -33,9 +33,9 @@ public class SabertekProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new SabertekFrameDecoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SabertekProtocolDecoder(SabertekProtocol.this)); + pipeline.addLast(new SabertekFrameDecoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new SabertekProtocolDecoder(SabertekProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SanavProtocol.java b/src/org/traccar/protocol/SanavProtocol.java index e33a29db7..c151156b8 100644 --- a/src/org/traccar/protocol/SanavProtocol.java +++ b/src/org/traccar/protocol/SanavProtocol.java @@ -34,17 +34,17 @@ public class SanavProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new SanavProtocolDecoder(SanavProtocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new SanavProtocolDecoder(SanavProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new SanavProtocolDecoder(SanavProtocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new SanavProtocolDecoder(SanavProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SigfoxProtocol.java b/src/org/traccar/protocol/SigfoxProtocol.java index 4968a04ef..b53c2f557 100644 --- a/src/org/traccar/protocol/SigfoxProtocol.java +++ b/src/org/traccar/protocol/SigfoxProtocol.java @@ -35,10 +35,10 @@ public class SigfoxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(65535)); - pipeline.addLast("objectDecoder", new SigfoxProtocolDecoder(SigfoxProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(65535)); + pipeline.addLast(new SigfoxProtocolDecoder(SigfoxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SiwiProtocol.java b/src/org/traccar/protocol/SiwiProtocol.java index dba11f647..7f23406da 100644 --- a/src/org/traccar/protocol/SiwiProtocol.java +++ b/src/org/traccar/protocol/SiwiProtocol.java @@ -34,9 +34,9 @@ public class SiwiProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SiwiProtocolDecoder(SiwiProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new SiwiProtocolDecoder(SiwiProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SkypatrolProtocol.java b/src/org/traccar/protocol/SkypatrolProtocol.java index 2ce018dc8..f2bd2b404 100644 --- a/src/org/traccar/protocol/SkypatrolProtocol.java +++ b/src/org/traccar/protocol/SkypatrolProtocol.java @@ -32,7 +32,7 @@ public class SkypatrolProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new SkypatrolProtocolDecoder(SkypatrolProtocol.this)); + pipeline.addLast(new SkypatrolProtocolDecoder(SkypatrolProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SmartSoleProtocol.java b/src/org/traccar/protocol/SmartSoleProtocol.java index 060fa418a..d6ca68444 100644 --- a/src/org/traccar/protocol/SmartSoleProtocol.java +++ b/src/org/traccar/protocol/SmartSoleProtocol.java @@ -35,10 +35,10 @@ public class SmartSoleProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '$')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SmartSoleProtocolDecoder(SmartSoleProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '$')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new SmartSoleProtocolDecoder(SmartSoleProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SmokeyProtocol.java b/src/org/traccar/protocol/SmokeyProtocol.java index 7a4f416e6..4450d541a 100644 --- a/src/org/traccar/protocol/SmokeyProtocol.java +++ b/src/org/traccar/protocol/SmokeyProtocol.java @@ -32,7 +32,7 @@ public class SmokeyProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new SmokeyProtocolDecoder(SmokeyProtocol.this)); + pipeline.addLast(new SmokeyProtocolDecoder(SmokeyProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SpotProtocol.java b/src/org/traccar/protocol/SpotProtocol.java index f06eea17a..311328aa5 100644 --- a/src/org/traccar/protocol/SpotProtocol.java +++ b/src/org/traccar/protocol/SpotProtocol.java @@ -35,10 +35,10 @@ public class SpotProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("httpDecoder", new HttpRequestDecoder()); - pipeline.addLast("httpAggregator", new HttpObjectAggregator(65535)); - pipeline.addLast("objectDecoder", new SpotProtocolDecoder(SpotProtocol.this)); + pipeline.addLast(new HttpResponseEncoder()); + pipeline.addLast(new HttpRequestDecoder()); + pipeline.addLast(new HttpObjectAggregator(65535)); + pipeline.addLast(new SpotProtocolDecoder(SpotProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/StarLinkProtocol.java b/src/org/traccar/protocol/StarLinkProtocol.java index 78178078c..a88691d6f 100644 --- a/src/org/traccar/protocol/StarLinkProtocol.java +++ b/src/org/traccar/protocol/StarLinkProtocol.java @@ -35,10 +35,10 @@ public class StarLinkProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new StarLinkProtocolDecoder(StarLinkProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StarLinkProtocolDecoder(StarLinkProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Stl060Protocol.java b/src/org/traccar/protocol/Stl060Protocol.java index 91440baa9..5f0ca1f24 100644 --- a/src/org/traccar/protocol/Stl060Protocol.java +++ b/src/org/traccar/protocol/Stl060Protocol.java @@ -34,10 +34,10 @@ public class Stl060Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Stl060FrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Stl060ProtocolDecoder(Stl060Protocol.this)); + pipeline.addLast(new Stl060FrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Stl060ProtocolDecoder(Stl060Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/SuntechProtocol.java b/src/org/traccar/protocol/SuntechProtocol.java index fdb8041cb..eaff6295a 100644 --- a/src/org/traccar/protocol/SuntechProtocol.java +++ b/src/org/traccar/protocol/SuntechProtocol.java @@ -44,11 +44,11 @@ public class SuntechProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new SuntechProtocolEncoder()); - pipeline.addLast("objectDecoder", new SuntechProtocolDecoder(SuntechProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\r')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new SuntechProtocolEncoder()); + pipeline.addLast(new SuntechProtocolDecoder(SuntechProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SupermateProtocol.java b/src/org/traccar/protocol/SupermateProtocol.java index 847f9095c..b00ef9f2a 100644 --- a/src/org/traccar/protocol/SupermateProtocol.java +++ b/src/org/traccar/protocol/SupermateProtocol.java @@ -35,10 +35,10 @@ public class SupermateProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "#")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new SupermateProtocolDecoder(SupermateProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "#")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new SupermateProtocolDecoder(SupermateProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/SviasProtocol.java b/src/org/traccar/protocol/SviasProtocol.java index a811ddc9a..fcd5b5f2b 100644 --- a/src/org/traccar/protocol/SviasProtocol.java +++ b/src/org/traccar/protocol/SviasProtocol.java @@ -45,11 +45,11 @@ public class SviasProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
- pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "]"));
- pipeline.addLast("stringEncoder", new StringEncoder());
- pipeline.addLast("stringDecoder", new StringDecoder());
- pipeline.addLast("objectEncoder", new SviasProtocolEncoder());
- pipeline.addLast("objectDecoder", new SviasProtocolDecoder(SviasProtocol.this));
+ pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "]"));
+ pipeline.addLast(new StringEncoder());
+ pipeline.addLast(new StringDecoder());
+ pipeline.addLast(new SviasProtocolEncoder());
+ pipeline.addLast(new SviasProtocolDecoder(SviasProtocol.this));
}
});
}
diff --git a/src/org/traccar/protocol/T55Protocol.java b/src/org/traccar/protocol/T55Protocol.java index b69cfab6f..fd0f0c939 100644 --- a/src/org/traccar/protocol/T55Protocol.java +++ b/src/org/traccar/protocol/T55Protocol.java @@ -35,18 +35,18 @@ public class T55Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new T55ProtocolDecoder(T55Protocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new T55ProtocolDecoder(T55Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new T55ProtocolDecoder(T55Protocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new T55ProtocolDecoder(T55Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/T57Protocol.java b/src/org/traccar/protocol/T57Protocol.java index 9f3dd62a3..50b302e74 100644 --- a/src/org/traccar/protocol/T57Protocol.java +++ b/src/org/traccar/protocol/T57Protocol.java @@ -34,10 +34,10 @@ public class T57Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new T57FrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new T57ProtocolDecoder(T57Protocol.this)); + pipeline.addLast(new T57FrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new T57ProtocolDecoder(T57Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/T800xProtocol.java b/src/org/traccar/protocol/T800xProtocol.java index 26f34ee77..d8012ee07 100644 --- a/src/org/traccar/protocol/T800xProtocol.java +++ b/src/org/traccar/protocol/T800xProtocol.java @@ -36,9 +36,9 @@ public class T800xProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2, -5, 0)); - pipeline.addLast("objectEncoder", new T800xProtocolEncoder()); - pipeline.addLast("objectDecoder", new T800xProtocolDecoder(T800xProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 3, 2, -5, 0)); + pipeline.addLast(new T800xProtocolEncoder()); + pipeline.addLast(new T800xProtocolDecoder(T800xProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TaipProtocol.java b/src/org/traccar/protocol/TaipProtocol.java index bfecf9b39..9a5863338 100644 --- a/src/org/traccar/protocol/TaipProtocol.java +++ b/src/org/traccar/protocol/TaipProtocol.java @@ -35,18 +35,18 @@ public class TaipProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '<')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '<')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new TaipProtocolDecoder(TaipProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new TaipProtocolDecoder(TaipProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TekProtocol.java b/src/org/traccar/protocol/TekProtocol.java index 4618fdf00..f9f75ab2e 100644 --- a/src/org/traccar/protocol/TekProtocol.java +++ b/src/org/traccar/protocol/TekProtocol.java @@ -32,8 +32,8 @@ public class TekProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new TekFrameDecoder()); - pipeline.addLast("objectDecoder", new TekProtocolDecoder(TekProtocol.this)); + pipeline.addLast(new TekFrameDecoder()); + pipeline.addLast(new TekProtocolDecoder(TekProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TelemaxProtocol.java b/src/org/traccar/protocol/TelemaxProtocol.java index f2208741a..980984df4 100644 --- a/src/org/traccar/protocol/TelemaxProtocol.java +++ b/src/org/traccar/protocol/TelemaxProtocol.java @@ -35,10 +35,10 @@ public class TelemaxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TelemaxProtocolDecoder(TelemaxProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new TelemaxProtocolDecoder(TelemaxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TelicProtocol.java b/src/org/traccar/protocol/TelicProtocol.java index 0ee4cf165..57d8d5a1a 100644 --- a/src/org/traccar/protocol/TelicProtocol.java +++ b/src/org/traccar/protocol/TelicProtocol.java @@ -34,10 +34,10 @@ public class TelicProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new TelicFrameDecoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TelicProtocolDecoder(TelicProtocol.this)); + pipeline.addLast(new TelicFrameDecoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new TelicProtocolDecoder(TelicProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TeltonikaProtocol.java b/src/org/traccar/protocol/TeltonikaProtocol.java index d5e10de03..75953a52f 100644 --- a/src/org/traccar/protocol/TeltonikaProtocol.java +++ b/src/org/traccar/protocol/TeltonikaProtocol.java @@ -35,16 +35,16 @@ public class TeltonikaProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new TeltonikaFrameDecoder()); - pipeline.addLast("objectEncoder", new TeltonikaProtocolEncoder()); - pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(TeltonikaProtocol.this, false)); + pipeline.addLast(new TeltonikaFrameDecoder()); + pipeline.addLast(new TeltonikaProtocolEncoder()); + pipeline.addLast(new TeltonikaProtocolDecoder(TeltonikaProtocol.this, false)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectEncoder", new TeltonikaProtocolEncoder()); - pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(TeltonikaProtocol.this, true)); + pipeline.addLast(new TeltonikaProtocolEncoder()); + pipeline.addLast(new TeltonikaProtocolDecoder(TeltonikaProtocol.this, true)); } }); } diff --git a/src/org/traccar/protocol/ThinkRaceProtocol.java b/src/org/traccar/protocol/ThinkRaceProtocol.java index 644e16ca7..e1973d605 100644 --- a/src/org/traccar/protocol/ThinkRaceProtocol.java +++ b/src/org/traccar/protocol/ThinkRaceProtocol.java @@ -33,8 +33,8 @@ public class ThinkRaceProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2 + 12 + 1 + 1, 2, 2, 0)); - pipeline.addLast("objectDecoder", new ThinkRaceProtocolDecoder(ThinkRaceProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2 + 12 + 1 + 1, 2, 2, 0)); + pipeline.addLast(new ThinkRaceProtocolDecoder(ThinkRaceProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Tk102Protocol.java b/src/org/traccar/protocol/Tk102Protocol.java index 2eff262f0..324e6b575 100644 --- a/src/org/traccar/protocol/Tk102Protocol.java +++ b/src/org/traccar/protocol/Tk102Protocol.java @@ -33,8 +33,8 @@ public class Tk102Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 1 + 1 + 10, 1, 1, 0)); - pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(Tk102Protocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 1 + 1 + 10, 1, 1, 0)); + pipeline.addLast(new Tk102ProtocolDecoder(Tk102Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Tk103Protocol.java b/src/org/traccar/protocol/Tk103Protocol.java index ff31f16bc..678c948e6 100644 --- a/src/org/traccar/protocol/Tk103Protocol.java +++ b/src/org/traccar/protocol/Tk103Protocol.java @@ -54,20 +54,20 @@ public class Tk103Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Tk103FrameDecoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new Tk103ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this)); + pipeline.addLast(new Tk103FrameDecoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Tk103ProtocolEncoder()); + pipeline.addLast(new Tk103ProtocolDecoder(Tk103Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new Tk103ProtocolEncoder()); - pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Tk103ProtocolEncoder()); + pipeline.addLast(new Tk103ProtocolDecoder(Tk103Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Tlt2hProtocol.java b/src/org/traccar/protocol/Tlt2hProtocol.java index 1a23dee40..9e669f893 100644 --- a/src/org/traccar/protocol/Tlt2hProtocol.java +++ b/src/org/traccar/protocol/Tlt2hProtocol.java @@ -35,10 +35,10 @@ public class Tlt2hProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(32 * 1024, "##\r\n")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(Tlt2hProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(32 * 1024, "##\r\n")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Tlt2hProtocolDecoder(Tlt2hProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TlvProtocol.java b/src/org/traccar/protocol/TlvProtocol.java index bfe597e76..4bf0abdbe 100644 --- a/src/org/traccar/protocol/TlvProtocol.java +++ b/src/org/traccar/protocol/TlvProtocol.java @@ -33,8 +33,8 @@ public class TlvProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\0')); - pipeline.addLast("objectDecoder", new TlvProtocolDecoder(TlvProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\0')); + pipeline.addLast(new TlvProtocolDecoder(TlvProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TmgProtocol.java b/src/org/traccar/protocol/TmgProtocol.java index 192891100..c11404be9 100644 --- a/src/org/traccar/protocol/TmgProtocol.java +++ b/src/org/traccar/protocol/TmgProtocol.java @@ -34,10 +34,10 @@ public class TmgProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new TmgFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TmgProtocolDecoder(TmgProtocol.this)); + pipeline.addLast(new TmgFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new TmgProtocolDecoder(TmgProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TopflytechProtocol.java b/src/org/traccar/protocol/TopflytechProtocol.java index 03eb4b3ea..6c3ba08cf 100644 --- a/src/org/traccar/protocol/TopflytechProtocol.java +++ b/src/org/traccar/protocol/TopflytechProtocol.java @@ -35,10 +35,10 @@ public class TopflytechProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ')')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(TopflytechProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ')')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new TopflytechProtocolDecoder(TopflytechProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TotemProtocol.java b/src/org/traccar/protocol/TotemProtocol.java index c533268cc..1f692bff0 100644 --- a/src/org/traccar/protocol/TotemProtocol.java +++ b/src/org/traccar/protocol/TotemProtocol.java @@ -39,11 +39,11 @@ public class TotemProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new TotemFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new TotemProtocolEncoder()); - pipeline.addLast("objectDecoder", new TotemProtocolDecoder(TotemProtocol.this)); + pipeline.addLast(new TotemFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new TotemProtocolEncoder()); + pipeline.addLast(new TotemProtocolDecoder(TotemProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Tr20Protocol.java b/src/org/traccar/protocol/Tr20Protocol.java index 629d8b961..fdc85b573 100644 --- a/src/org/traccar/protocol/Tr20Protocol.java +++ b/src/org/traccar/protocol/Tr20Protocol.java @@ -35,10 +35,10 @@ public class Tr20Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Tr20ProtocolDecoder(Tr20Protocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Tr20ProtocolDecoder(Tr20Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Tr900Protocol.java b/src/org/traccar/protocol/Tr900Protocol.java index 80ad76087..eb4afd39d 100644 --- a/src/org/traccar/protocol/Tr900Protocol.java +++ b/src/org/traccar/protocol/Tr900Protocol.java @@ -35,18 +35,18 @@ public class Tr900Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Tr900ProtocolDecoder(Tr900Protocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Tr900ProtocolDecoder(Tr900Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Tr900ProtocolDecoder(Tr900Protocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new Tr900ProtocolDecoder(Tr900Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/TrackboxProtocol.java b/src/org/traccar/protocol/TrackboxProtocol.java index c86870aec..11b78b3d4 100644 --- a/src/org/traccar/protocol/TrackboxProtocol.java +++ b/src/org/traccar/protocol/TrackboxProtocol.java @@ -35,10 +35,10 @@ public class TrackboxProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TrackboxProtocolDecoder(TrackboxProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new TrackboxProtocolDecoder(TrackboxProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TrakMateProtocol.java b/src/org/traccar/protocol/TrakMateProtocol.java index 506408d65..ce37fd491 100644 --- a/src/org/traccar/protocol/TrakMateProtocol.java +++ b/src/org/traccar/protocol/TrakMateProtocol.java @@ -35,10 +35,10 @@ public class TrakMateProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TrakMateProtocolDecoder(TrakMateProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new TrakMateProtocolDecoder(TrakMateProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TramigoProtocol.java b/src/org/traccar/protocol/TramigoProtocol.java index 74c673967..ead3e63fc 100644 --- a/src/org/traccar/protocol/TramigoProtocol.java +++ b/src/org/traccar/protocol/TramigoProtocol.java @@ -32,8 +32,8 @@ public class TramigoProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new TramigoFrameDecoder()); - pipeline.addLast("objectDecoder", new TramigoProtocolDecoder(TramigoProtocol.this)); + pipeline.addLast(new TramigoFrameDecoder()); + pipeline.addLast(new TramigoProtocolDecoder(TramigoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TrvProtocol.java b/src/org/traccar/protocol/TrvProtocol.java index 7167ab674..8ae94527f 100644 --- a/src/org/traccar/protocol/TrvProtocol.java +++ b/src/org/traccar/protocol/TrvProtocol.java @@ -35,10 +35,10 @@ public class TrvProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new TrvProtocolDecoder(TrvProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new TrvProtocolDecoder(TrvProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Tt8850Protocol.java b/src/org/traccar/protocol/Tt8850Protocol.java index 7d3c6a437..706001ab9 100644 --- a/src/org/traccar/protocol/Tt8850Protocol.java +++ b/src/org/traccar/protocol/Tt8850Protocol.java @@ -35,10 +35,10 @@ public class Tt8850Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "$")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Tt8850ProtocolDecoder(Tt8850Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "$")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Tt8850ProtocolDecoder(Tt8850Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/TytanProtocol.java b/src/org/traccar/protocol/TytanProtocol.java index 7c424981b..2ad1e8631 100644 --- a/src/org/traccar/protocol/TytanProtocol.java +++ b/src/org/traccar/protocol/TytanProtocol.java @@ -32,7 +32,7 @@ public class TytanProtocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new TytanProtocolDecoder(TytanProtocol.this)); + pipeline.addLast(new TytanProtocolDecoder(TytanProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TzoneProtocol.java b/src/org/traccar/protocol/TzoneProtocol.java index 21a304402..1d1dad592 100644 --- a/src/org/traccar/protocol/TzoneProtocol.java +++ b/src/org/traccar/protocol/TzoneProtocol.java @@ -34,8 +34,8 @@ public class TzoneProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(256, 2, 2, 2, 0)); - pipeline.addLast("objectDecoder", new TzoneProtocolDecoder(TzoneProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 2, 2, 0)); + pipeline.addLast(new TzoneProtocolDecoder(TzoneProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/UlbotechProtocol.java b/src/org/traccar/protocol/UlbotechProtocol.java index 7d6d95706..ee603bbbb 100644 --- a/src/org/traccar/protocol/UlbotechProtocol.java +++ b/src/org/traccar/protocol/UlbotechProtocol.java @@ -32,8 +32,8 @@ public class UlbotechProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new UlbotechFrameDecoder()); - pipeline.addLast("objectDecoder", new UlbotechProtocolDecoder(UlbotechProtocol.this)); + pipeline.addLast(new UlbotechFrameDecoder()); + pipeline.addLast(new UlbotechProtocolDecoder(UlbotechProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/UproProtocol.java b/src/org/traccar/protocol/UproProtocol.java index 832121ec1..a861f85ca 100644 --- a/src/org/traccar/protocol/UproProtocol.java +++ b/src/org/traccar/protocol/UproProtocol.java @@ -34,9 +34,9 @@ public class UproProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new UproProtocolDecoder(UproProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new UproProtocolDecoder(UproProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/V680Protocol.java b/src/org/traccar/protocol/V680Protocol.java index eb9111578..5382af59b 100644 --- a/src/org/traccar/protocol/V680Protocol.java +++ b/src/org/traccar/protocol/V680Protocol.java @@ -35,18 +35,18 @@ public class V680Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new V680ProtocolDecoder(V680Protocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "##")); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new V680ProtocolDecoder(V680Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new V680ProtocolDecoder(V680Protocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new V680ProtocolDecoder(V680Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/VisiontekProtocol.java b/src/org/traccar/protocol/VisiontekProtocol.java index 897c7e6f7..20ddca43e 100644 --- a/src/org/traccar/protocol/VisiontekProtocol.java +++ b/src/org/traccar/protocol/VisiontekProtocol.java @@ -35,10 +35,10 @@ public class VisiontekProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(VisiontekProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new VisiontekProtocolDecoder(VisiontekProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Vt200Protocol.java b/src/org/traccar/protocol/Vt200Protocol.java index b227020c2..5180a5402 100644 --- a/src/org/traccar/protocol/Vt200Protocol.java +++ b/src/org/traccar/protocol/Vt200Protocol.java @@ -32,8 +32,8 @@ public class Vt200Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new Vt200FrameDecoder()); - pipeline.addLast("objectDecoder", new Vt200ProtocolDecoder(Vt200Protocol.this)); + pipeline.addLast(new Vt200FrameDecoder()); + pipeline.addLast(new Vt200ProtocolDecoder(Vt200Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/VtfmsProtocol.java b/src/org/traccar/protocol/VtfmsProtocol.java index dee72aaa8..d3ac79fe6 100644 --- a/src/org/traccar/protocol/VtfmsProtocol.java +++ b/src/org/traccar/protocol/VtfmsProtocol.java @@ -34,16 +34,16 @@ public class VtfmsProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new VtfmsFrameDecoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new VtfmsProtocolDecoder(VtfmsProtocol.this)); + pipeline.addLast(new VtfmsFrameDecoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new VtfmsProtocolDecoder(VtfmsProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new VtfmsProtocolDecoder(VtfmsProtocol.this)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new VtfmsProtocolDecoder(VtfmsProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/WatchProtocol.java b/src/org/traccar/protocol/WatchProtocol.java index 6f9a4a882..f4aeb9f37 100644 --- a/src/org/traccar/protocol/WatchProtocol.java +++ b/src/org/traccar/protocol/WatchProtocol.java @@ -50,10 +50,10 @@ public class WatchProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new WatchFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new WatchProtocolEncoder()); - pipeline.addLast("objectDecoder", new WatchProtocolDecoder(WatchProtocol.this)); + pipeline.addLast(new WatchFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new WatchProtocolEncoder()); + pipeline.addLast(new WatchProtocolDecoder(WatchProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/WialonProtocol.java b/src/org/traccar/protocol/WialonProtocol.java index 119d9899b..c606251c0 100644 --- a/src/org/traccar/protocol/WialonProtocol.java +++ b/src/org/traccar/protocol/WialonProtocol.java @@ -44,16 +44,16 @@ public class WialonProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(4 * 1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast(new LineBasedFrameDecoder(4 * 1024)); + pipeline.addLast(new StringEncoder()); boolean utf8 = Context.getConfig().getBoolean(getName() + ".utf8"); if (utf8) { - pipeline.addLast("stringDecoder", new StringDecoder(StandardCharsets.UTF_8)); + pipeline.addLast(new StringDecoder(StandardCharsets.UTF_8)); } else { - pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast(new StringDecoder()); } - pipeline.addLast("objectEncoder", new WialonProtocolEncoder()); - pipeline.addLast("objectDecoder", new WialonProtocolDecoder(WialonProtocol.this)); + pipeline.addLast(new WialonProtocolEncoder()); + pipeline.addLast(new WialonProtocolDecoder(WialonProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/WondexProtocol.java b/src/org/traccar/protocol/WondexProtocol.java index a43c8b06a..f68b12eb0 100644 --- a/src/org/traccar/protocol/WondexProtocol.java +++ b/src/org/traccar/protocol/WondexProtocol.java @@ -43,18 +43,18 @@ public class WondexProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new WondexFrameDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new WondexProtocolEncoder()); - pipeline.addLast("objectDecoder", new WondexProtocolDecoder(WondexProtocol.this)); + pipeline.addLast(new WondexFrameDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new WondexProtocolEncoder()); + pipeline.addLast(new WondexProtocolDecoder(WondexProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectEncoder", new WondexProtocolEncoder()); - pipeline.addLast("objectDecoder", new WondexProtocolDecoder(WondexProtocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new WondexProtocolEncoder()); + pipeline.addLast(new WondexProtocolDecoder(WondexProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/WristbandProtocol.java b/src/org/traccar/protocol/WristbandProtocol.java index 02db38f4f..336f4bfb9 100644 --- a/src/org/traccar/protocol/WristbandProtocol.java +++ b/src/org/traccar/protocol/WristbandProtocol.java @@ -33,8 +33,8 @@ public class WristbandProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2, 3, 0)); - pipeline.addLast("objectDecoder", new WristbandProtocolDecoder(WristbandProtocol.this)); + pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 3, 2, 3, 0)); + pipeline.addLast(new WristbandProtocolDecoder(WristbandProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/XexunProtocol.java b/src/org/traccar/protocol/XexunProtocol.java index 11e0e0761..bbfb236db 100644 --- a/src/org/traccar/protocol/XexunProtocol.java +++ b/src/org/traccar/protocol/XexunProtocol.java @@ -43,14 +43,14 @@ public class XexunProtocol extends BaseProtocol { protected void addProtocolHandlers(PipelineBuilder pipeline) { boolean full = Context.getConfig().getBoolean(getName() + ".extended"); if (full) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); // tracker bug \n\r + pipeline.addLast(new LineBasedFrameDecoder(1024)); // tracker bug \n\r } else { - pipeline.addLast("frameDecoder", new XexunFrameDecoder()); + pipeline.addLast(new XexunFrameDecoder()); } - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new XexunProtocolEncoder()); - pipeline.addLast("objectDecoder", new XexunProtocolDecoder(XexunProtocol.this, full)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new XexunProtocolEncoder()); + pipeline.addLast(new XexunProtocolDecoder(XexunProtocol.this, full)); } }); } diff --git a/src/org/traccar/protocol/XirgoProtocol.java b/src/org/traccar/protocol/XirgoProtocol.java index 18017bcdb..5f1d96e4b 100644 --- a/src/org/traccar/protocol/XirgoProtocol.java +++ b/src/org/traccar/protocol/XirgoProtocol.java @@ -39,20 +39,20 @@ public class XirgoProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new XirgoProtocolEncoder()); - pipeline.addLast("objectDecoder", new XirgoProtocolDecoder(XirgoProtocol.this)); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "##")); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new XirgoProtocolEncoder()); + pipeline.addLast(new XirgoProtocolDecoder(XirgoProtocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectEncoder", new XirgoProtocolEncoder()); - pipeline.addLast("objectDecoder", new XirgoProtocolDecoder(XirgoProtocol.this)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new XirgoProtocolEncoder()); + pipeline.addLast(new XirgoProtocolDecoder(XirgoProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/Xt013Protocol.java b/src/org/traccar/protocol/Xt013Protocol.java index 8e43e8f0b..8c3581f68 100644 --- a/src/org/traccar/protocol/Xt013Protocol.java +++ b/src/org/traccar/protocol/Xt013Protocol.java @@ -36,10 +36,10 @@ public class Xt013Protocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Xt013ProtocolDecoder(Xt013Protocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new Xt013ProtocolDecoder(Xt013Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/Xt2400Protocol.java b/src/org/traccar/protocol/Xt2400Protocol.java index 08b281554..05640c52c 100644 --- a/src/org/traccar/protocol/Xt2400Protocol.java +++ b/src/org/traccar/protocol/Xt2400Protocol.java @@ -32,7 +32,7 @@ public class Xt2400Protocol extends BaseProtocol { serverList.add(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("objectDecoder", new Xt2400ProtocolDecoder(Xt2400Protocol.this)); + pipeline.addLast(new Xt2400ProtocolDecoder(Xt2400Protocol.this)); } }); } diff --git a/src/org/traccar/protocol/YwtProtocol.java b/src/org/traccar/protocol/YwtProtocol.java index c026fc61a..fb09360b7 100644 --- a/src/org/traccar/protocol/YwtProtocol.java +++ b/src/org/traccar/protocol/YwtProtocol.java @@ -35,10 +35,10 @@ public class YwtProtocol extends BaseProtocol { serverList.add(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new YwtProtocolDecoder(YwtProtocol.this)); + pipeline.addLast(new LineBasedFrameDecoder(1024)); + pipeline.addLast(new StringEncoder()); + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new YwtProtocolDecoder(YwtProtocol.this)); } }); } |