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%2FNetconfServerSessionListener.java;h=951d0dd98d7d2b52bb13e6fc21a8f88673c74de6;hp=4f2f65c1a00732137229fba7e1416d9c1db70904;hb=d762fe6c823ad1ba21db1cad627a1cbd6d7c6d8e;hpb=0d596e1bc7abf0b9702269236633225f28df77e6 diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java index 4f2f65c1a0..951d0dd98d 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java @@ -11,7 +11,6 @@ package org.opendaylight.controller.netconf.impl; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; - import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.NetconfSessionListener; @@ -31,54 +30,54 @@ import org.w3c.dom.Node; public class NetconfServerSessionListener implements NetconfSessionListener { - static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionListener.class); + private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionListener.class); private final SessionMonitoringService monitoringService; private final NetconfOperationRouter operationRouter; private final AutoCloseable onSessionDownCloseable; - public NetconfServerSessionListener(NetconfOperationRouter operationRouter, SessionMonitoringService monitoringService, - AutoCloseable onSessionDownCloseable) { + public NetconfServerSessionListener(final NetconfOperationRouter operationRouter, final SessionMonitoringService monitoringService, + final AutoCloseable onSessionDownCloseable) { this.operationRouter = operationRouter; this.monitoringService = monitoringService; this.onSessionDownCloseable = onSessionDownCloseable; } @Override - public void onSessionUp(NetconfServerSession netconfNetconfServerSession) { + public void onSessionUp(final NetconfServerSession netconfNetconfServerSession) { monitoringService.onSessionUp(netconfNetconfServerSession); } @Override - public void onSessionDown(NetconfServerSession netconfNetconfServerSession, Exception cause) { - logger.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage()); + public void onSessionDown(final NetconfServerSession netconfNetconfServerSession, final Exception cause) { + LOG.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage()); onDown(netconfNetconfServerSession); } - public void onDown(NetconfServerSession netconfNetconfServerSession) { + public void onDown(final NetconfServerSession netconfNetconfServerSession) { monitoringService.onSessionDown(netconfNetconfServerSession); try { operationRouter.close(); } catch (Exception closingEx) { - logger.debug("Ignoring exception while closing operationRouter", closingEx); + LOG.debug("Ignoring exception while closing operationRouter", closingEx); } try { onSessionDownCloseable.close(); } catch(Exception ex){ - logger.debug("Ignoring exception while closing onSessionDownCloseable", ex); + LOG.debug("Ignoring exception while closing onSessionDownCloseable", ex); } } @Override - public void onSessionTerminated(NetconfServerSession netconfNetconfServerSession, - NetconfTerminationReason netconfTerminationReason) { - logger.debug("Session {} terminated, reason: {}", netconfNetconfServerSession, + public void onSessionTerminated(final NetconfServerSession netconfNetconfServerSession, + final NetconfTerminationReason netconfTerminationReason) { + LOG.debug("Session {} terminated, reason: {}", netconfNetconfServerSession, netconfTerminationReason.getErrorMessage()); onDown(netconfNetconfServerSession); } @Override - public void onMessage(NetconfServerSession session, NetconfMessage netconfMessage) { + public void onMessage(final NetconfServerSession session, final NetconfMessage netconfMessage) { try { Preconditions.checkState(operationRouter != null, "Cannot handle message, session up was not yet received"); @@ -86,7 +85,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener