Search in sources :

Example 16 with TrackerServer

use of org.traccar.TrackerServer in project traccar by tananaev.

the class MeiligaoProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new MeiligaoFrameDecoder());
            pipeline.addLast("objectEncoder", new MeiligaoProtocolEncoder());
            pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(MeiligaoProtocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("objectEncoder", new MeiligaoProtocolEncoder());
            pipeline.addLast("objectDecoder", new MeiligaoProtocolDecoder(MeiligaoProtocol.this));
        }
    });
}
Also used : TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 17 with TrackerServer

use of org.traccar.TrackerServer in project traccar by tananaev.

the class NavigilProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new NavigilFrameDecoder());
            pipeline.addLast("objectDecoder", new NavigilProtocolDecoder(NavigilProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 18 with TrackerServer

use of org.traccar.TrackerServer in project traccar by tananaev.

the class OrionProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new OrionFrameDecoder());
            pipeline.addLast("objectDecoder", new OrionProtocolDecoder(OrionProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 19 with TrackerServer

use of org.traccar.TrackerServer in project traccar by tananaev.

the class Pt502Protocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new Pt502FrameDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("objectEncoder", new Pt502ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(Pt502Protocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) StringDecoder(org.jboss.netty.handler.codec.string.StringDecoder) TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 20 with TrackerServer

use of org.traccar.TrackerServer in project traccar by tananaev.

the class ProgressProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0));
            pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(ProgressProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)43 TrackerServer (org.traccar.TrackerServer)43 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)42 ConnectionlessBootstrap (org.jboss.netty.bootstrap.ConnectionlessBootstrap)23 StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)15 LengthFieldBasedFrameDecoder (org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder)11 StringDecoder (org.jboss.netty.handler.codec.string.StringDecoder)11 CharacterDelimiterFrameDecoder (org.traccar.CharacterDelimiterFrameDecoder)5 LineBasedFrameDecoder (org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder)2 FixedLengthFrameDecoder (org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder)1