2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
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
9 package org.opendaylight.openflowjava.protocol.impl.core;
11 import io.netty.channel.socket.nio.NioDatagramChannel;
14 * @author michal.polkorab
17 public class UdpChannelInitializer extends ProtocolChannelInitializer<NioDatagramChannel> {
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();