X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2FAbstractNetconfSessionNegotiator.java;h=f8f486b2a0f63770b984e66a532ec332c7c9e7d0;hb=4e39e49ef541d25099afc4c2ff80d89b04b24103;hp=b3d35dc3c0d05bd8811505b4c450948052c9f0ff;hpb=f0821760fcf5054e0e0e8cfd3453e7cf10252757;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index b3d35dc3c0..f8f486b2a0 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -41,7 +41,8 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.NodeList; -public abstract class AbstractNetconfSessionNegotiator
, L extends NetconfSessionListener>
+public abstract class AbstractNetconfSessionNegotiator
, L extends NetconfSessionListener promise, final Channel channel, final Timer timer,
- final L sessionListener, final long connectionTimeoutMillis) {
+ protected AbstractNetconfSessionNegotiator(final P sessionPreferences, final Promise sslHandler = getSslHandler(channel);
- if (sslHandler.isPresent()) {
- Future () {
@Override
public void operationComplete(final ChannelFuture future) throws Exception {
- if(future.isSuccess()) {
+ if (future.isSuccess()) {
LOG.debug("Channel {} closed: success", future.channel());
} else {
LOG.warn("Channel {} closed: fail", future.channel());
@@ -138,7 +150,7 @@ public abstract class AbstractNetconfSessionNegotiator
* Inbound hello message handler should be kept until negotiation is successful
* It caches any non-hello messages while negotiation is still in progress
*/
protected final void replaceHelloMessageInboundHandler(final S session) {
- ChannelHandler helloMessageHandler = replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, new NetconfXMLToMessageDecoder());
+ ChannelHandler helloMessageHandler = replaceChannelHandler(channel,
+ AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, new NetconfXMLToMessageDecoder());
Preconditions.checkState(helloMessageHandler instanceof NetconfXMLToHelloMessageDecoder,
"Pipeline handlers misplaced on session: %s, pipeline: %s", session, channel.pipeline());
@@ -200,7 +215,8 @@ public abstract class AbstractNetconfSessionNegotiator>
extends AbstractSessionNegotiator promise,
+ final Channel channel, final Timer timer,
+ final L sessionListener, final long connectionTimeoutMillis) {
super(promise, channel);
this.sessionPreferences = sessionPreferences;
this.promise = promise;
@@ -77,25 +79,34 @@ public abstract class AbstractNetconfSessionNegotiator