Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / UdpChannelInitializer.java
1 /*
2  * Copyright (c) 2014 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.core;
10
11 import io.netty.channel.socket.nio.NioDatagramChannel;
12
13 /**
14  * @author michal.polkorab
15  *
16  */
17 public class UdpChannelInitializer extends ProtocolChannelInitializer<NioDatagramChannel> {
18
19     @Override
20     protected void initChannel(NioDatagramChannel ch) throws Exception {
21         ch.pipeline().addLast(PipelineHandlers.OF_DATAGRAMPACKET_HANDLER.name(),
22                 new OFDatagramPacketHandler(getSwitchConnectionHandler()));
23         OFDatagramPacketDecoder ofDatagramPacketDecoder = new OFDatagramPacketDecoder();
24         ofDatagramPacketDecoder.setDeserializationFactory(getDeserializationFactory());
25         ch.pipeline().addLast(PipelineHandlers.OF_DATAGRAMPACKET_DECODER.name(),
26                 ofDatagramPacketDecoder);
27         OFDatagramPacketEncoder ofDatagramPacketEncoder = new OFDatagramPacketEncoder();
28         ofDatagramPacketEncoder.setSerializationFactory(getSerializationFactory());
29         ch.pipeline().addLast(PipelineHandlers.OF_ENCODER.name(), ofDatagramPacketEncoder);
30 //        connectionFacade.fireConnectionReadyNotification();
31     }
32 }