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=f8024922cfc5a5ba021e97b519493ae80a02c4d2;hb=e159106bc148e76fc1e3e3c780bdd740d99e74ed;hpb=8f15fef884bc20239625850c4a2fcdaf36395526 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..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 @@ -10,6 +10,7 @@ package org.opendaylight.controller.netconf.impl; 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; @@ -34,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(); @@ -52,4 +61,4 @@ public class NetconfServerSessionNegotiator extends return new NetconfServerSession(sessionListener, channel, getSessionPreferences().getSessionId(), parsedHeader); } - } +}