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=6528fe251775694e8ea47cf59b094d0efcc07ddf;hp=5c389fa966af340ef277f5d51ebe992b2c6081ff;hb=87837c5398976e1f44418e9f161efea9d5fa4e7c;hpb=7f0272398ce3dab7ceddd998c7bb510df3b28838 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 5c389fa966..6528fe2517 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,10 +8,9 @@ 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.util.messages.NetconfHelloMessage; @@ -19,7 +18,11 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.InetSocketAddress; +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 { @@ -32,6 +35,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();