Merge "Bug 6895 - Implement Query parameters - depth"
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / TesttoolNegotiationFactory.java
index cb5710749d9de261f54cea5746c715a91c44fbd3..171b0b5af971b8e5716fdb83e908743d0b7d608c 100644 (file)
@@ -19,8 +19,11 @@ import org.opendaylight.netconf.impl.NetconfServerSessionNegotiatorFactoryBuilde
 import org.opendaylight.netconf.impl.SessionIdProvider;
 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TesttoolNegotiationFactory extends NetconfServerSessionNegotiatorFactory {
+    private static final Logger LOG = LoggerFactory.getLogger(TesttoolNegotiationFactory.class);
 
     private final Map<SocketAddress, NetconfOperationService> cachedOperationServices = new HashMap<>();
 
@@ -39,10 +42,14 @@ public class TesttoolNegotiationFactory extends NetconfServerSessionNegotiatorFa
     @Override
     protected NetconfOperationService getOperationServiceForAddress(final String netconfSessionIdForReporting, final SocketAddress socketAddress) {
         if (cachedOperationServices.containsKey(socketAddress)) {
+            LOG.debug("Session {}: Getting cached operation service factory for test tool device on address {}",
+                    netconfSessionIdForReporting, socketAddress);
             return cachedOperationServices.get(socketAddress);
         } else {
             final NetconfOperationService service = getOperationServiceFactory().createService(netconfSessionIdForReporting);
             cachedOperationServices.put(socketAddress, service);
+            LOG.debug("Session {}: Creating new operation service factory for test tool device on address {}",
+                    netconfSessionIdForReporting, socketAddress);
             return service;
         }
     }