X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2FNetconfServerSessionNegotiator.java;h=a48cbbe24106411451cc4726d6e3ca153f3166cb;hp=f8024922cfc5a5ba021e97b519493ae80a02c4d2;hb=c3108b4e80ec9f6ee6c8cf96df3009bb91dc8bc0;hpb=13a76258537f64367e3036925a0331522a571705 diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java index f8024922cf..a48cbbe241 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java @@ -8,21 +8,19 @@ package org.opendaylight.controller.netconf.impl; +import com.google.common.base.Optional; +import io.netty.channel.Channel; +import io.netty.util.Timer; +import io.netty.util.concurrent.Promise; import java.net.InetSocketAddress; - +import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences; -import org.opendaylight.controller.netconf.util.AbstractNetconfSessionNegotiator; +import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSessionNegotiator; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Optional; - -import io.netty.channel.Channel; -import io.netty.util.Timer; -import io.netty.util.concurrent.Promise; - public class NetconfServerSessionNegotiator extends AbstractNetconfSessionNegotiator { @@ -34,6 +32,14 @@ public class NetconfServerSessionNegotiator extends super(sessionPreferences, promise, channel, timer, sessionListener, connectionTimeoutMillis); } + @Override + protected void handleMessage(NetconfHelloMessage netconfMessage) throws NetconfDocumentedException { + NetconfServerSession session = getSessionForHelloMessage(netconfMessage); + replaceHelloMessageInboundHandler(session); + // Negotiation successful after all non hello messages were processed + negotiationSuccessful(session); + } + @Override protected NetconfServerSession getSession(NetconfServerSessionListener sessionListener, Channel channel, NetconfHelloMessage message) { Optional additionalHeader = message.getAdditionalHeader(); @@ -52,4 +58,4 @@ public class NetconfServerSessionNegotiator extends return new NetconfServerSession(sessionListener, channel, getSessionPreferences().getSessionId(), parsedHeader); } - } +}