Search in sources :

Example 66 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class EelinkProtocol 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 LengthFieldBasedFrameDecoder(1024, 3, 2));
            pipeline.addLast("objectEncoder", new EelinkProtocolEncoder(false));
            pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("objectEncoder", new EelinkProtocolEncoder(true));
            pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this));
        }
    });
}
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) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 67 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class EgtsProtocol 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 EgtsFrameDecoder());
            pipeline.addLast("objectDecoder", new EgtsProtocolDecoder(EgtsProtocol.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 68 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class BceProtocol 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 BceFrameDecoder());
            pipeline.addLast("objectDecoder", new BceProtocolDecoder(BceProtocol.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 69 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class Gl200Protocol 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 Gl200FrameDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new Gl200ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(Gl200Protocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new Gl200ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(Gl200Protocol.this));
        }
    });
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 70 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class TelicProtocol 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 TelicFrameDecoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectDecoder", new TelicProtocolDecoder(TelicProtocol.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)

Aggregations

ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)165 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)58 TrackerServer (org.traccar.TrackerServer)43 InetSocketAddress (java.net.InetSocketAddress)37 ChannelPipelineFactory (org.jboss.netty.channel.ChannelPipelineFactory)32 ConnectionlessBootstrap (org.jboss.netty.bootstrap.ConnectionlessBootstrap)26 Channel (org.jboss.netty.channel.Channel)26 SimpleObjectCaptureHandler (com.linkedin.databus2.test.container.SimpleObjectCaptureHandler)24 SocketAddress (java.net.SocketAddress)20 StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)18 SimpleTestServerConnection (com.linkedin.databus2.test.container.SimpleTestServerConnection)17 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)16 NioServerSocketChannelFactory (org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory)16 HttpRequest (org.jboss.netty.handler.codec.http.HttpRequest)16 HttpResponse (org.jboss.netty.handler.codec.http.HttpResponse)16 HttpResponseEncoder (org.jboss.netty.handler.codec.http.HttpResponseEncoder)16 DefaultHttpResponse (org.jboss.netty.handler.codec.http.DefaultHttpResponse)15 HttpRequestDecoder (org.jboss.netty.handler.codec.http.HttpRequestDecoder)15 StringDecoder (org.jboss.netty.handler.codec.string.StringDecoder)14 LoggingHandler (org.jboss.netty.handler.logging.LoggingHandler)14