From: Marian Dubai Date: Fri, 14 Nov 2014 14:57:14 +0000 (+0100) Subject: Fix checkstyle warnings in netconf-tcp X-Git-Tag: release/lithium~823^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=f2d3fedde9aa2af532096fe726b6522155d873ac;ds=sidebyside Fix checkstyle warnings in netconf-tcp Change-Id: I95e776dde2645288734f7687c22fc158ee7b486d Signed-off-by: Marian Dubai --- diff --git a/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServerHandler.java b/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServerHandler.java index fa8892853b..21ec8e82d6 100644 --- a/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServerHandler.java +++ b/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/netty/ProxyServerHandler.java @@ -22,7 +22,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ProxyServerHandler extends ChannelInboundHandlerAdapter { - private static final Logger logger = LoggerFactory.getLogger(ProxyServerHandler.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(ProxyServerHandler.class); private final Bootstrap clientBootstrap; private final LocalAddress localAddress; @@ -48,32 +48,32 @@ public class ProxyServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelInactive(ChannelHandlerContext ctx) { - logger.trace("channelInactive - closing client channel"); + LOG.trace("channelInactive - closing client channel"); clientChannel.close(); } @Override public void channelRead(ChannelHandlerContext ctx, final Object msg) { - logger.trace("Writing to client channel"); + LOG.trace("Writing to client channel"); clientChannel.write(msg); } @Override public void channelReadComplete(ChannelHandlerContext ctx) { - logger.trace("Flushing client channel"); + LOG.trace("Flushing client channel"); clientChannel.flush(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { // Close the connection when an exception is raised. - logger.warn("Unexpected exception from downstream.", cause); + LOG.warn("Unexpected exception from downstream.", cause); ctx.close(); } } class ProxyClientHandler extends ChannelInboundHandlerAdapter { - private static final Logger logger = LoggerFactory.getLogger(ProxyClientHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ProxyClientHandler.class); private final ChannelHandlerContext remoteCtx; private ChannelHandlerContext localCtx; @@ -85,26 +85,26 @@ class ProxyClientHandler extends ChannelInboundHandlerAdapter { @Override public void channelActive(ChannelHandlerContext ctx) { checkState(this.localCtx == null); - logger.trace("Client channel active"); + LOG.trace("Client channel active"); this.localCtx = ctx; } @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { - logger.trace("Forwarding message"); + LOG.trace("Forwarding message"); remoteCtx.write(msg); } @Override public void channelReadComplete(ChannelHandlerContext ctx) { - logger.trace("Flushing remote ctx"); + LOG.trace("Flushing remote ctx"); remoteCtx.flush(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { // Close the connection when an exception is raised. - logger.warn("Unexpected exception from downstream", cause); + LOG.warn("Unexpected exception from downstream", cause); checkState(this.localCtx.equals(ctx)); ctx.close(); } @@ -112,7 +112,7 @@ class ProxyClientHandler extends ChannelInboundHandlerAdapter { // called both when local or remote connection dies @Override public void channelInactive(ChannelHandlerContext ctx) { - logger.trace("channelInactive() called, closing remote client ctx"); + LOG.trace("channelInactive() called, closing remote client ctx"); remoteCtx.close(); } diff --git a/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/osgi/NetconfTCPActivator.java b/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/osgi/NetconfTCPActivator.java index bc94e596d7..355041f8df 100644 --- a/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/osgi/NetconfTCPActivator.java +++ b/opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/netconf/tcp/osgi/NetconfTCPActivator.java @@ -22,22 +22,22 @@ import org.slf4j.LoggerFactory; * Opens TCP port specified in config.ini, creates bridge between this port and local netconf server. */ public class NetconfTCPActivator implements BundleActivator { - private static final Logger logger = LoggerFactory.getLogger(NetconfTCPActivator.class); + private static final Logger LOG = LoggerFactory.getLogger(NetconfTCPActivator.class); private ProxyServer proxyServer; @Override public void start(BundleContext context) { final Optional maybeAddress = NetconfConfigUtil.extractNetconfServerAddress(context, InfixProp.tcp); if (maybeAddress.isPresent() == false) { - logger.debug("Netconf tcp server is not configured to start"); + LOG.debug("Netconf tcp server is not configured to start"); return; } InetSocketAddress address = maybeAddress.get(); if (address.getAddress().isAnyLocalAddress()) { - logger.warn("Unprotected netconf TCP address is configured to ANY local address. This is a security risk. " + - "Consider changing {} to 127.0.0.1", NetconfConfigUtil.getNetconfServerAddressKey(InfixProp.tcp)); + LOG.warn("Unprotected netconf TCP address is configured to ANY local address. This is a security risk. Consider changing {} to 127.0.0.1", + NetconfConfigUtil.getNetconfServerAddressKey(InfixProp.tcp)); } - logger.info("Starting TCP netconf server at {}", address); + LOG.info("Starting TCP netconf server at {}", address); proxyServer = new ProxyServer(address, NetconfConfigUtil.getNetconfLocalAddress()); }