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=a9adf2a668177af9dc0e5c165e028a96cea5def1;hb=45cfee1861924b4a8086d38079ce8cbd320386d6;hp=b3d35dc3c0d05bd8811505b4c450948052c9f0ff;hpb=01a3b9adce74d7c6a10646ebbf0a3f4998a76d41;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..a9adf2a668 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> extends AbstractSessionNegotiator { private static final Logger LOG = LoggerFactory.getLogger(AbstractNetconfSessionNegotiator.class); @@ -54,7 +55,7 @@ public abstract class AbstractNetconfSessionNegotiator

promise, final Channel channel, final Timer timer, - final L sessionListener, final long connectionTimeoutMillis) { + protected AbstractNetconfSessionNegotiator(final P sessionPreferences, final Promise promise, + final Channel channel, final Timer timer, + final L sessionListener, final long connectionTimeoutMillis) { super(promise, channel); this.sessionPreferences = sessionPreferences; this.promise = promise; @@ -95,7 +97,7 @@ public abstract class AbstractNetconfSessionNegotiator

getSslHandler(final Channel channel) { final SslHandler sslHandler = channel.pipeline().get(SslHandler.class); - return sslHandler == null ? Optional. absent() : Optional.of(sslHandler); + return sslHandler == null ? Optional.absent() : Optional.of(sslHandler); } public P getSessionPreferences() { @@ -115,6 +117,7 @@ public abstract class AbstractNetconfSessionNegotiator

() { @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 +141,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 +206,8 @@ public abstract class AbstractNetconfSessionNegotiator