Added move of branding jar to assembly
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / streams / websockets / WebSocketServerInitializer.java
1 package org.opendaylight.controller.sal.streams.websockets;
2
3 import io.netty.channel.Channel;
4 import io.netty.channel.ChannelInitializer;
5 import io.netty.channel.ChannelPipeline;
6 import io.netty.channel.socket.SocketChannel;
7 import io.netty.handler.codec.http.HttpObjectAggregator;
8 import io.netty.handler.codec.http.HttpServerCodec;
9
10 /**
11  * {@link WebSocketServerInitializer} is used to setup the
12  * {@link ChannelPipeline} of a {@link Channel}.
13  */
14 public class WebSocketServerInitializer extends
15                 ChannelInitializer<SocketChannel> {
16
17         @Override
18         protected void initChannel(SocketChannel ch) throws Exception {
19                 ChannelPipeline pipeline = ch.pipeline();
20                 pipeline.addLast("codec-http", new HttpServerCodec());
21                 pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
22                 pipeline.addLast("handler", new WebSocketServerHandler());
23         }
24
25 }