X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Fhoneynode%2F2.2.1%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2FAbstractChannelInitializer.java;fp=tests%2Fhoneynode%2F2.2.1%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2FAbstractChannelInitializer.java;h=0000000000000000000000000000000000000000;hb=b90fdacec82f92e07d14ed1df31e3fe53275c676;hp=c967e8f317a03667634f65d3854e2228bea0e882;hpb=1030996d2cfc0cec3c6c2b5d8da37c6188122372;p=transportpce.git diff --git a/tests/honeynode/2.2.1/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractChannelInitializer.java b/tests/honeynode/2.2.1/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractChannelInitializer.java deleted file mode 100644 index c967e8f31..000000000 --- a/tests/honeynode/2.2.1/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractChannelInitializer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.netconf.nettyutil; - -import io.netty.channel.Channel; -import io.netty.util.concurrent.Promise; -import org.opendaylight.netconf.api.NetconfSession; -import org.opendaylight.netconf.nettyutil.handler.FramingMechanismHandlerFactory; -import org.opendaylight.netconf.nettyutil.handler.NetconfEOMAggregator; -import org.opendaylight.netconf.nettyutil.handler.NetconfHelloMessageToXMLEncoder; -import org.opendaylight.netconf.nettyutil.handler.NetconfXMLToHelloMessageDecoder; -import org.opendaylight.netconf.util.messages.FramingMechanism; - -public abstract class AbstractChannelInitializer { - - public static final String NETCONF_MESSAGE_DECODER = "netconfMessageDecoder"; - public static final String NETCONF_MESSAGE_AGGREGATOR = "aggregator"; - public static final String NETCONF_MESSAGE_ENCODER = "netconfMessageEncoder"; - public static final String NETCONF_MESSAGE_FRAME_ENCODER = "frameEncoder"; - public static final String NETCONF_SESSION_NEGOTIATOR = "negotiator"; - - public void initialize(Channel ch, Promise promise) { - ch.pipeline().addLast(NETCONF_MESSAGE_AGGREGATOR, new NetconfEOMAggregator()); - initializeMessageDecoder(ch); - ch.pipeline().addLast(NETCONF_MESSAGE_FRAME_ENCODER, - FramingMechanismHandlerFactory.createHandler(FramingMechanism.EOM)); - initializeMessageEncoder(ch); - - initializeSessionNegotiator(ch, promise); - } - - protected void initializeMessageEncoder(Channel ch) { - // Special encoding handler for hello message to include additional header if available, - // it is thrown away after successful negotiation - ch.pipeline().addLast(NETCONF_MESSAGE_ENCODER, new NetconfHelloMessageToXMLEncoder()); - } - - protected void initializeMessageDecoder(Channel ch) { - // Special decoding handler for hello message to parse additional header if available, - // it is thrown away after successful negotiation - ch.pipeline().addLast(NETCONF_MESSAGE_DECODER, new NetconfXMLToHelloMessageDecoder()); - } - - /** - * Insert session negotiator into the pipeline. It must be inserted after message decoder - * identified by {@link AbstractChannelInitializer#NETCONF_MESSAGE_DECODER}, (or any other custom decoder processor) - */ - protected abstract void initializeSessionNegotiator(Channel ch, Promise promise); - -}