Centralized pipeline creation
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / OFFrameDecoder.java
index db7181d3473b3faf31eec76ca9c8e360beb6f728..677bab0c327da24285e0403b89b88a6e89aff902 100644 (file)
@@ -10,7 +10,6 @@ import java.util.List;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler.COMPONENT_NAMES;
 
 /**
  * Class for decoding incoming messages into message frames.
@@ -50,27 +49,12 @@ public class OFFrameDecoder extends ByteToMessageDecoder {
                     bb.readableBytes() + " < " + length);
             return;
         }
-
         LOGGER.info("OF Protocol message received");
 
-        enableOFVersionDetector(chc);
-
-        List<String> componentList = chc.pipeline().names();
-        LOGGER.debug(componentList.toString());
-
         ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length);
         list.add(messageBuffer);
         messageBuffer.retain();
         bb.skipBytes(length);
     }
 
-    private static void enableOFVersionDetector(ChannelHandlerContext ctx) {
-        if (ctx.pipeline().get(COMPONENT_NAMES.OF_VERSION_DETECTOR.name()) == null) {
-            LOGGER.info("Adding OFVD");
-            ctx.pipeline().addAfter(COMPONENT_NAMES.OF_FRAME_DECODER.name(), 
-                    COMPONENT_NAMES.OF_VERSION_DETECTOR.name(), new OFVersionDetector());
-        } else {
-            LOGGER.debug("OFVD already in pipeline");
-        }
-    }
 }