Fix license header violations in sal-rest-connector
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / streams / websockets / WebSocketServerInitializer.java
1 /*
2  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.sal.streams.websockets;
10
11 import io.netty.channel.ChannelInitializer;
12 import io.netty.channel.ChannelPipeline;
13 import io.netty.channel.socket.SocketChannel;
14 import io.netty.handler.codec.http.HttpObjectAggregator;
15 import io.netty.handler.codec.http.HttpServerCodec;
16
17 /**
18  * {@link WebSocketServerInitializer} is used to setup the {@link ChannelPipeline} of a {@link io.netty.channel.Channel}
19  * .
20  */
21 public class WebSocketServerInitializer extends ChannelInitializer<SocketChannel> {
22
23     @Override
24     protected void initChannel(final SocketChannel ch) throws Exception {
25         ChannelPipeline pipeline = ch.pipeline();
26         pipeline.addLast("codec-http", new HttpServerCodec());
27         pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
28         pipeline.addLast("handler", new WebSocketServerHandler());
29     }
30
31 }