Merge "Remove old clustered netconf topology implementation"
authorTomas Cere <tcere@cisco.com>
Mon, 24 Oct 2016 07:35:34 +0000 (07:35 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 24 Oct 2016 07:35:34 +0000 (07:35 +0000)
33 files changed:
netconf/netconf-topology-singleton/pom.xml
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfDOMDataBroker.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManager.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteOperationTxProcessorImpl.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/AskForMasterMountPoint.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/CreateInitialMasterActorData.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/MasterActorDataInitialized.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RefreshSetupMasterActorData.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RegisterMountPoint.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/UnregisterSlaveMountPoint.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/YangTextSchemaSourceRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/CancelRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/DeleteRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/EmptyReadResponse.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ExistsRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/MergeRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/PutRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ReadRequest.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitFailedReply.java [moved from netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/SubmitFailedReply.java with 79% similarity]
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitReply.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitRequest.java
netconf/netconf-topology-singleton/src/main/resources/org/opendaylight/blueprint/netconf-topology-singleton.xml
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java

index 34db91e61010099c84fbac4c554a7e40645eb086..e247fb5071c1a62541c62a932c60493b8990919c 100644 (file)
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.controller</groupId>
+                <artifactId>mdsal-artifacts</artifactId>
+                <version>1.5.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
             <artifactId>akka-testkit_2.11</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-distributed-datastore</artifactId>
+        </dependency>
     </dependencies>
 
 </project>
\ No newline at end of file
index 7fa8e5aaad39464a9758b7183a6025eb98b4eff5..8e45cbc37462965dcb324e75c62c7d470723fc9f 100644 (file)
@@ -131,7 +131,7 @@ class MasterSalFacade implements AutoCloseable, RemoteDeviceHandler<NetconfSessi
 
         final NetconfDeviceNotificationService notificationService = new NetconfDeviceNotificationService();
 
-        LOG.info("Creating master data broker for device {}", id);
+        LOG.info("{}: Creating master data broker for device", id);
 
         final NetconfDOMTransaction masterDOMTransactions =
                 new NetconfMasterDOMTransaction(id, remoteSchemaContext, deviceRpc, netconfSessionPreferences);
@@ -169,7 +169,7 @@ class MasterSalFacade implements AutoCloseable, RemoteDeviceHandler<NetconfSessi
             try {
                 resource.close();
             } catch (final Exception e) {
-                LOG.warn("{}: Ignoring exception while closing {}", id, resource, e);
+                LOG.error("{}: Ignoring exception while closing {}", id, resource, e);
             }
         }
     }
index 99ddc7fa30b7549f63cef6284c156f99eb405cf3..4fadb08ee41725ff58a582989982665928f63dff 100644 (file)
@@ -44,18 +44,18 @@ public class NetconfDOMDataBroker implements DOMDataBroker {
 
     @Override
     public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
-        return new NetconfReadOnlyTransaction(actorSystem, masterDataBroker);
+        return new NetconfReadOnlyTransaction(id, actorSystem, masterDataBroker);
     }
 
     @Override
     public DOMDataReadWriteTransaction newReadWriteTransaction() {
-        return new ReadWriteTx(new NetconfReadOnlyTransaction(actorSystem, masterDataBroker),
-                new NetconfWriteOnlyTransaction(actorSystem, masterDataBroker));
+        return new ReadWriteTx(new NetconfReadOnlyTransaction(id, actorSystem, masterDataBroker),
+                new NetconfWriteOnlyTransaction(id, actorSystem, masterDataBroker));
     }
 
     @Override
     public DOMDataWriteTransaction newWriteOnlyTransaction() {
-        return new NetconfWriteOnlyTransaction(actorSystem, masterDataBroker);
+        return new NetconfWriteOnlyTransaction(id, actorSystem, masterDataBroker);
     }
 
     @Override
index e90ea662531d35ae1c8cd2988b4e5ef228660274..7cc3d29b86bacd555d37c669a4f1fba41fa52865 100644 (file)
@@ -67,23 +67,23 @@ class NetconfNodeManager
             final NodeId nodeId = NetconfTopologyUtils.getNodeId(rootNode.getIdentifier());
             switch (rootNode.getModificationType()) {
                 case SUBTREE_MODIFIED:
-                    LOG.debug("Operational for node {} updated. Trying to register slave mount point", nodeId);
+                    LOG.debug("{}: Operational for node {} updated. Trying to register slave mount point", id, nodeId);
                     handleSlaveMountPoint(rootNode);
                     break;
                 case WRITE:
                     if (rootNode.getDataBefore() != null) {
-                        LOG.debug("Operational for node {} rewrited. Trying to register slave mount point", nodeId);
+                        LOG.debug("{}: Operational for node {} rewrited. Trying to register slave mount point", id, nodeId);
                     } else {
-                        LOG.debug("Operational for node {} created. Trying to register slave mount point", nodeId);
+                        LOG.debug("{}: Operational for node {} created. Trying to register slave mount point", id, nodeId);
                     }
                     handleSlaveMountPoint(rootNode);
                     break;
                 case DELETE:
-                    LOG.debug("Operational for node {} deleted. Trying to remove slave mount point", nodeId);
+                    LOG.debug("{}: Operational for node {} deleted. Trying to remove slave mount point", id, nodeId);
                     closeActor();
                     break;
                 default:
-                    LOG.debug("Uknown operation for node: {}", nodeId);
+                    LOG.debug("{}: Uknown operation for node: {}", id, nodeId);
             }
         }
     }
@@ -107,7 +107,7 @@ class NetconfNodeManager
     }
 
     void registerDataTreeChangeListener(final String topologyId, final NodeKey key) {
-        LOG.debug("Registering data tree change listener on node {}", key);
+        LOG.debug("{}: Registering data tree change listener on node {}", id, key);
         dataChangeListenerRegistration = setup.getDataBroker().registerDataTreeChangeListener(
                 new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
                         NetconfTopologyUtils.createTopologyNodeListPath(key, topologyId)), this);
index 6cad5c1c04775f958478f2ad322246414a66c1fc..cfd9dd81131d438f55665b2c473ee652bc270d00 100644 (file)
@@ -176,14 +176,14 @@ public class NetconfTopologyManager
             try {
                 netconfTopologyContext.closeFinal();
             } catch (Exception e) {
-                LOG.warn("Error at closing topology context. InstanceIdentifier: " + instanceIdentifier);
+                LOG.error("Error at closing topology context. InstanceIdentifier: " + instanceIdentifier, e);
             }
         });
         clusterRegistrations.forEach((instanceIdentifier, clusterSingletonServiceRegistration) -> {
             try {
                 clusterSingletonServiceRegistration.close();
             } catch (Exception e) {
-                LOG.warn("Error at unregistering from cluster. InstanceIdentifier: " + instanceIdentifier);
+                LOG.error("Error at unregistering from cluster. InstanceIdentifier: " + instanceIdentifier, e);
             }
         });
         contexts.clear();
index 47405b87c8fc86c57bac02d096efb630d4704c40..0525789d153eac9f575ee8b05423e075345c2d43 100644 (file)
@@ -137,23 +137,23 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
         Futures.addCallback(future, new FutureCallback<NetconfDeviceCapabilities>() {
             @Override
             public void onSuccess(NetconfDeviceCapabilities result) {
-                LOG.debug("{}: Connector started succesfully", nodeId.getValue());
+                LOG.debug("{}: Connector started successfully", remoteDeviceId);
             }
 
             @Override
             public void onFailure(@Nullable Throwable throwable) {
-                LOG.error("{}: Connector failed, {}", nodeId.getValue(), throwable);
+                LOG.error("{}: Connector failed, {}", remoteDeviceId, throwable);
             }
         });
     }
 
     @Override
     public void stopRemoteDeviceConnection() {
-        Preconditions.checkNotNull(deviceCommunicatorDTO, "Device communicator was not created.");
+        Preconditions.checkNotNull(deviceCommunicatorDTO, remoteDeviceId + ": Device communicator was not created.");
         try {
             deviceCommunicatorDTO.close();
         } catch (Exception e) {
-            LOG.warn("{}: Error at closing device communicator.", remoteDeviceId);
+            LOG.error("{}: Error at closing device communicator.", remoteDeviceId, e);
         }
     }
 
@@ -172,7 +172,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
                 netconfTopologyDeviceSetup.getDomBroker(), netconfTopologyDeviceSetup.getBindingAwareBroker(),
                 netconfTopologyDeviceSetup.getActorSystem(), deviceContextActorRef);
         if (keepaliveDelay > 0) {
-            LOG.info("Device: {} , Adding keepalive facade.", nodeId);
+            LOG.info("{}: Adding keepalive facade.", remoteDeviceId);
             salFacade = new KeepaliveSalFacade(remoteDeviceId, salFacade,
                     netconfTopologyDeviceSetup.getKeepaliveExecutor().getExecutor(), keepaliveDelay,
                     defaultRequestTimeoutMillis);
@@ -226,7 +226,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
                         ? NetconfTopologyUtils.DEFAULT_CONCURRENT_RPC_LIMIT : node.getConcurrentRpcLimit();
 
         if (rpcMessageLimit < 1) {
-            LOG.info("Device: {}, Concurrent rpc limit is smaller than 1, no limit will be enforced.", remoteDeviceId);
+            LOG.info("{}: Concurrent rpc limit is smaller than 1, no limit will be enforced.", remoteDeviceId);
         }
 
         return new NetconfConnectorDTO(
@@ -249,8 +249,8 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
 
         final NetconfSessionPreferences parsedOverrideCapabilities =
                 NetconfSessionPreferences.fromStrings(capabilities);
-        Preconditions.checkState(parsedOverrideCapabilities.getNonModuleCaps().isEmpty(),
-                "Capabilities to override can only contain module based capabilities, non-module capabilities "
+        Preconditions.checkState(parsedOverrideCapabilities.getNonModuleCaps().isEmpty(), remoteDeviceId +
+                "Capabilities to override can only contain module based capabilities, non-module capabilities "
                         + "will be retrieved from the device, configured non-module capabilities: "
                         + parsedOverrideCapabilities.getNonModuleCaps());
 
@@ -283,11 +283,11 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
                     }
                 }
                 LOG.info("{} : netconf connector will use schema cache directory {} instead of {}",
-                        nodeId.getValue(), moduleSchemaCacheDirectory, NetconfTopologyUtils.DEFAULT_CACHE_DIRECTORY);
+                        remoteDeviceId, moduleSchemaCacheDirectory, NetconfTopologyUtils.DEFAULT_CACHE_DIRECTORY);
             }
         } else {
             LOG.info("{} : using the default directory {}",
-                    nodeId.getValue(), NetconfTopologyUtils.QUALIFIED_DEFAULT_CACHE_DIRECTORY);
+                    remoteDeviceId, NetconfTopologyUtils.QUALIFIED_DEFAULT_CACHE_DIRECTORY);
         }
 
         if (schemaResourcesDTO == null) {
@@ -402,7 +402,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
                     ((org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword) credentials).getUsername(),
                     ((org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword) credentials).getPassword());
         } else {
-            throw new IllegalStateException("Only login/password authentification is supported");
+            throw new IllegalStateException(remoteDeviceId + ": Only login/password authentication is supported");
         }
 
         return NetconfReconnectingClientConfigurationBuilder.create()
index da95e9f02afada156b16b34754d39757d31fe500..f107966b24ea18bdd034586bb1acfd42f8ba419b 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.api.RemoteOperationTxProcessor;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
-import org.opendaylight.netconf.topology.singleton.messages.SubmitFailedReply;
+import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitFailedReply;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.EmptyReadResponse;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitReply;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
index 772020bcaa69a7a09fae5a4528af486d7a2772cf..877436d6cc1d637a525249e775e56f6fa4f3c5d7 100644 (file)
@@ -50,7 +50,7 @@ public class SlaveSalFacade {
         final NetconfDeviceNotificationService notificationService = new NetconfDeviceNotificationService();
 
         final NetconfDOMTransaction proxyDOMTransactions =
-                new NetconfProxyDOMTransaction(actorSystem, masterActorRef);
+                new NetconfProxyDOMTransaction(id, actorSystem, masterActorRef);
 
         final NetconfDOMDataBroker netconfDeviceDataBroker =
                 new NetconfDOMDataBroker(actorSystem, id, proxyDOMTransactions);
index 602eb755032c78b046c7dbbdea573eb711d650a9..33680f2dfc2701212e17ae068b54a82f04528d74 100644 (file)
@@ -28,27 +28,30 @@ import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessag
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import scala.concurrent.Future;
 import scala.concurrent.impl.Promise.DefaultPromise;
 
 public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
 
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMasterDOMTransaction.class);
+
+    private final RemoteDeviceId id;
     private final DOMDataBroker delegateBroker;
 
     private DOMDataReadOnlyTransaction readTx;
     private DOMDataWriteTransaction writeTx;
 
     public NetconfMasterDOMTransaction(final RemoteDeviceId id,
-                                       final SchemaContext schemaContext, final DOMRpcService rpc,
+                                       final SchemaContext schemaContext,
+                                       final DOMRpcService rpc,
                                        final NetconfSessionPreferences netconfSessionPreferences) {
-
-        delegateBroker = new NetconfDeviceDataBroker(id, schemaContext, rpc, netconfSessionPreferences);
-
-        // only ever need 1 readTx since it doesnt need to be closed
-        readTx = delegateBroker.newReadOnlyTransaction();
+        this(id, new NetconfDeviceDataBroker(id, schemaContext, rpc, netconfSessionPreferences));
     }
 
-    public NetconfMasterDOMTransaction(final DOMDataBroker delegateBroker) {
+    public NetconfMasterDOMTransaction(final RemoteDeviceId id, final DOMDataBroker delegateBroker) {
+        this.id = id;
         this.delegateBroker = delegateBroker;
 
         // only ever need 1 readTx since it doesnt need to be closed
@@ -58,6 +61,8 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
     @Override
     public Future<Optional<NormalizedNodeMessage>> read(final LogicalDatastoreType store,
                                                         final YangInstanceIdentifier path) {
+        LOG.trace("{}: Read[{}] {} via NETCONF: {}", id, readTx.getIdentifier(), store, path);
+
         final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> readFuture = readTx.read(store, path);
 
         final DefaultPromise<Optional<NormalizedNodeMessage>> promise = new DefaultPromise<>();
@@ -81,6 +86,8 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
 
     @Override
     public Future<Boolean> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+        LOG.trace("{}: Exists[{}] {} via NETCONF: {}", id, readTx.getIdentifier(), store, path);
+
         final CheckedFuture<Boolean, ReadFailedException> existsFuture = readTx.exists(store, path);
 
         final DefaultPromise<Boolean> promise = new DefaultPromise<>();
@@ -103,6 +110,10 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
         if (writeTx == null) {
             writeTx = delegateBroker.newWriteOnlyTransaction();
         }
+
+        LOG.trace("{}: Write[{}] {} via NETCONF: {} with payload {}", id, writeTx.getIdentifier(), store,
+                data.getIdentifier(), data.getNode());
+
         writeTx.put(store, data.getIdentifier(), data.getNode());
     }
 
@@ -111,6 +122,10 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
         if (writeTx == null) {
             writeTx = delegateBroker.newWriteOnlyTransaction();
         }
+
+        LOG.trace("{}: Merge[{}] {} via NETCONF: {} with payload {}", id, writeTx.getIdentifier(),store,
+                data.getIdentifier(), data.getNode());
+
         writeTx.merge(store, data.getIdentifier(), data.getNode());
     }
 
@@ -119,16 +134,23 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
         if (writeTx == null) {
             writeTx = delegateBroker.newWriteOnlyTransaction();
         }
+
+        LOG.trace("{}: Delete[{}} {} via NETCONF: {}", id, writeTx.getIdentifier(), store, path);
+
         writeTx.delete(store, path);
     }
 
     @Override
     public boolean cancel() {
+        LOG.trace("{}: Cancel[{}} via NETCONF", id, writeTx.getIdentifier());
+
         return writeTx.cancel();
     }
 
     @Override
     public Future<Void> submit() {
+        LOG.trace("{}: Submit[{}} via NETCONF", id, writeTx.getIdentifier());
+
         final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTx.submit();
         final DefaultPromise<Void> promise = new DefaultPromise<>();
         Futures.addCallback(submitFuture, new FutureCallback<Void>() {
index 1b2a5ba37d0f036de726d6bf5f3d4c2e6b1519fe..9a23a71da50583ccb764b9d829da60321af3541c 100644 (file)
@@ -15,10 +15,11 @@ import akka.pattern.Patterns;
 import com.google.common.base.Optional;
 import org.opendaylight.controller.config.util.xml.DocumentedException;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction;
 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologyUtils;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
-import org.opendaylight.netconf.topology.singleton.messages.SubmitFailedReply;
+import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitFailedReply;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.CancelRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.DeleteRequest;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.EmptyReadResponse;
@@ -39,10 +40,14 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfProxyDOMTransaction.class);
 
+    private final RemoteDeviceId id;
     private final ActorSystem actorSystem;
     private final ActorRef masterContextRef;
 
-    public NetconfProxyDOMTransaction(final ActorSystem actorSystem, final ActorRef masterContextRef) {
+    public NetconfProxyDOMTransaction(final RemoteDeviceId id,
+                                      final ActorSystem actorSystem,
+                                      final ActorRef masterContextRef) {
+        this.id = id;
         this.actorSystem = actorSystem;
         this.masterContextRef = masterContextRef;
     }
@@ -54,13 +59,15 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
         final Future<Object> readScalaFuture =
                 Patterns.ask(masterContextRef, new ReadRequest(store, path), NetconfTopologyUtils.TIMEOUT);
 
+        LOG.trace("{}: Read {} via NETCONF: {}", id, store, path);
+
         final DefaultPromise<Optional<NormalizedNodeMessage>> promise = new DefaultPromise<>();
 
         readScalaFuture.onComplete(new OnComplete<Object>() {
             @Override
             public void onComplete(final Throwable failure, final Object success) throws Throwable {
                 if (failure != null) { // ask timeout
-                    Exception exception = new DocumentedException("Master is down. Please try again.",
+                    Exception exception = new DocumentedException(id + ":Master is down. Please try again.",
                             DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_FAILED,
                             DocumentedException.ErrorSeverity.WARNING);
                     promise.failure(exception);
@@ -87,12 +94,14 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
         final Future<Object> existsScalaFuture =
                 Patterns.ask(masterContextRef, new ExistsRequest(store, path), NetconfTopologyUtils.TIMEOUT);
 
+        LOG.trace("{}: Exists {} via NETCONF: {}", id, store, path);
+
         final DefaultPromise<Boolean> promise = new DefaultPromise<>();
         existsScalaFuture.onComplete(new OnComplete<Object>() {
             @Override
             public void onComplete(final Throwable failure, final Object success) throws Throwable {
                 if (failure != null) { // ask timeout
-                    Exception exception = new DocumentedException("Master is down. Please try again.",
+                    Exception exception = new DocumentedException(id + ":Master is down. Please try again.",
                             DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_FAILED,
                             DocumentedException.ErrorSeverity.WARNING);
                     promise.failure(exception);
@@ -110,17 +119,23 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
 
     @Override
     public void put(final LogicalDatastoreType store, final NormalizedNodeMessage data) {
+        LOG.trace("{}: Write {} via NETCONF: {} with payload {}", id, store, data.getIdentifier(), data.getNode());
+
         masterContextRef.tell(new PutRequest(store, data), ActorRef.noSender());
 
     }
 
     @Override
     public void merge(final LogicalDatastoreType store, final NormalizedNodeMessage data) {
+        LOG.trace("{}: Merge {} via NETCONF: {} with payload {}", id, store, data.getIdentifier(), data.getNode());
+
         masterContextRef.tell(new MergeRequest(store, data), ActorRef.noSender());
     }
 
     @Override
     public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+        LOG.trace("{}: Delete {} via NETCONF: {}", id, store, path);
+
         masterContextRef.tell(new DeleteRequest(store, path), ActorRef.noSender());
     }
 
@@ -128,6 +143,9 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
     public boolean cancel() {
         final Future<Object> cancelScalaFuture =
                 Patterns.ask(masterContextRef, new CancelRequest(), NetconfTopologyUtils.TIMEOUT);
+
+        LOG.trace("{}: Cancel {} via NETCONF", id);
+
         try {
             // here must be Await because AsyncWriteTransaction do not return future
             return (boolean) Await.result(cancelScalaFuture, NetconfTopologyUtils.TIMEOUT.duration());
@@ -141,13 +159,15 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
         final Future<Object> submitScalaFuture =
                 Patterns.ask(masterContextRef, new SubmitRequest(), NetconfTopologyUtils.TIMEOUT);
 
+        LOG.trace("{}: Submit {} via NETCONF", id);
+
         final DefaultPromise<Void> promise = new DefaultPromise<>();
 
         submitScalaFuture.onComplete(new OnComplete<Object>() {
             @Override
             public void onComplete(final Throwable failure, final Object success) throws Throwable {
                 if (failure != null) { // ask timeout
-                    Exception exception = new DocumentedException("Master is down. Please try again.",
+                    Exception exception = new DocumentedException(id + ":Master is down. Please try again.",
                             DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_FAILED,
                             DocumentedException.ErrorSeverity.WARNING);
                     promise.failure(exception);
@@ -157,7 +177,7 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction {
                     promise.failure((Throwable) success);
                 } else {
                     if (success instanceof SubmitFailedReply) {
-                        LOG.error("Transaction was not submitted.");
+                        LOG.error("{}: Transaction was not submitted because already closed.", id);
                     }
                     promise.success(null);
                 }
index 3af25c62b9da599d5aed57466f5af23a78c55dd2..9b386c0a477c80809d7ced1027fa5ea8c01150e6 100644 (file)
@@ -19,18 +19,27 @@ import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import scala.concurrent.Future;
 
 public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction {
 
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfReadOnlyTransaction.class);
+
+    private final RemoteDeviceId id;
     private final NetconfDOMTransaction delegate;
     private final ActorSystem actorSystem;
 
-    public NetconfReadOnlyTransaction(final ActorSystem actorSystem, final NetconfDOMTransaction delegate) {
+    public NetconfReadOnlyTransaction(final RemoteDeviceId id,
+                                      final ActorSystem actorSystem,
+                                      final NetconfDOMTransaction delegate) {
+        this.id = id;
         this.delegate = delegate;
         this.actorSystem = actorSystem;
     }
@@ -43,6 +52,9 @@ public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction {
     @Override
     public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
                                                                                    final YangInstanceIdentifier path) {
+
+        LOG.trace("{}: Read {} via NETCONF: {}", id, store, path);
+
         final Future<Optional<NormalizedNodeMessage>> future = delegate.read(store, path);
         final SettableFuture<Optional<NormalizedNode<?, ?>>> settableFuture = SettableFuture.create();
         final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> checkedFuture;
@@ -82,6 +94,9 @@ public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction {
     @Override
     public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
                                                               final YangInstanceIdentifier path) {
+
+        LOG.trace("{}: Exists {} via NETCONF: {}", id, store, path);
+
         final Future<Boolean> existsFuture = delegate.exists(store, path);
         final SettableFuture<Boolean> settableFuture = SettableFuture.create();
         final CheckedFuture<Boolean, ReadFailedException> checkedFuture;
index bef72a256b7f0cba591feabb06c543e99d321210..f938748cbfacda14e00829ae3f484e52a036b7c4 100644 (file)
@@ -20,20 +20,29 @@ import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import scala.concurrent.Future;
 
 public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction {
 
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfWriteOnlyTransaction.class);
+
+    private final RemoteDeviceId id;
     private final NetconfDOMTransaction delegate;
     private final ActorSystem actorSystem;
 
-    public NetconfWriteOnlyTransaction(final ActorSystem actorSystem, final NetconfDOMTransaction delegate) {
+    public NetconfWriteOnlyTransaction(final RemoteDeviceId id,
+                                       final ActorSystem actorSystem,
+                                       final NetconfDOMTransaction delegate) {
+        this.id = id;
         this.delegate = delegate;
         this.actorSystem = actorSystem;
     }
@@ -41,27 +50,37 @@ public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction {
     @Override
     public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
                     final NormalizedNode<?,?> data) {
+        LOG.trace("{}: Write {} via NETCONF: {} with payload {}", id, store, path, data);
+
         delegate.put(store, new NormalizedNodeMessage(path, data));
     }
 
     @Override
     public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
                       final NormalizedNode<?,?> data) {
+        LOG.trace("{}: Merge {} via NETCONF: {} with payload {}", id, store, path, data);
+
         delegate.merge(store, new NormalizedNodeMessage(path, data));
     }
 
     @Override
     public boolean cancel() {
+        LOG.trace("{}: Cancel", id);
+
         return delegate.cancel();
     }
 
     @Override
     public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+        LOG.trace("{}: Delete {} via NETCONF: {}", id, store, path);
+
         delegate.delete(store, path);
     }
 
     @Override
     public CheckedFuture<Void, TransactionCommitFailedException> submit() {
+        LOG.trace("{}: Submit", id);
+
         final Future<Void> submit = delegate.submit();
         final SettableFuture<Void> settFuture = SettableFuture.create();
         final CheckedFuture<Void, TransactionCommitFailedException> checkedFuture;
@@ -87,6 +106,8 @@ public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction {
 
     @Override
     public ListenableFuture<RpcResult<TransactionStatus>> commit() {
+        LOG.trace("{}: Commit", id);
+
         final Future<Void> commit = delegate.submit();
         final SettableFuture<RpcResult<TransactionStatus>> settFuture = SettableFuture.create();
         commit.onComplete(new OnComplete<Void>() {
index 9fb3ac27850dc963f5dc220a46b20485f4204c5c..4d56e1f17b13983947e70283c764d25fae25e28a 100644 (file)
@@ -15,4 +15,5 @@ import java.io.Serializable;
  * with reply 'RegisterMountPoint' which includes needed parameters.
  */
 public class AskForMasterMountPoint implements Serializable {
+    private static final long serialVersionUID = 1L;
 }
index 2117f699df721518a981cc331222e06f5ce33a06..bab905674254dac1391730393b3480bcb0e609ff 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
  * Master sends this message to the own actor to set necessary parameters.
  */
 public class CreateInitialMasterActorData implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     private final DOMDataBroker deviceDataBroker;
     private final List<SourceIdentifier> allSourceIdentifiers;
index 51c698be4341eef2839dfa81646d93a7990a76e7..fa5482b8fe187a60d5e4890ea694d949c01f557b 100644 (file)
@@ -15,4 +15,5 @@ import java.io.Serializable;
  * when this message is received by master, operational data-store is changed.
  */
 public class MasterActorDataInitialized implements Serializable {
+    private static final long serialVersionUID = 1L;
 }
index 48a86749f01127a903a02138d8d3078e9151764d..b4ede5bdbf5046c7388467523f50f618cf3b5289 100644 (file)
@@ -12,13 +12,9 @@ import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataInput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeInputOutput;
+import org.opendaylight.controller.cluster.datastore.utils.SerializationUtils;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter;
 
 /**
  * Message which holds node data, prepared to sending between remote hosts with serialization.
@@ -48,20 +44,16 @@ public class NormalizedNodeMessage implements Externalizable {
 
     @Override
     public void writeExternal(final ObjectOutput out) throws IOException {
-        final NormalizedNodeDataOutput dataOutput = NormalizedNodeInputOutput.newDataOutput(out);
-        final NormalizedNodeWriter normalizedNodeWriter =
-                NormalizedNodeWriter.forStreamWriter((NormalizedNodeStreamWriter) dataOutput);
-
-        dataOutput.writeYangInstanceIdentifier(identifier);
-
-        normalizedNodeWriter.write(node);
+        SerializationUtils.serializePathAndNode(getIdentifier(), node, out);
     }
 
     @Override
     public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
-        final NormalizedNodeDataInput dataInput = NormalizedNodeInputOutput.newDataInput(in);
-
-        identifier = dataInput.readYangInstanceIdentifier();
-        node = dataInput.readNormalizedNode();
+        SerializationUtils.deserializePathAndNode(in, this, APPLIER);
     }
+
+    private static final SerializationUtils.Applier<NormalizedNodeMessage> APPLIER = (instance, path, node) -> {
+        instance.identifier = path;
+        instance.node = node;
+    };
 }
index f75b0340327f6cf037dace3fb5bca26fd85931bf..fbc43f7cf90672437dd322b7394a3cbce49deeb3 100644 (file)
@@ -9,16 +9,14 @@
 package org.opendaylight.netconf.topology.singleton.messages;
 
 import java.io.Serializable;
-import java.util.List;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup;
-import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 
 /**
  * Master sends this message to the own actor to refresh setup data
  */
 public class RefreshSetupMasterActorData implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     private final NetconfTopologySetup netconfTopologyDeviceSetup;
     private final RemoteDeviceId remoteDeviceId;
index 26c634859dcfe858f0a48fca3f7e841bf201c4df..0023103a5c227ab1a790540a509156b081da7772 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
  * Master sends the message to slave with necessary parameters for creating slave mount point.
  */
 public class RegisterMountPoint implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     private final List<SourceIdentifier> allSourceIdentifiers;
 
index 7c05b6ae754ed14d7027bc6fa92d0f4745f4b917..303f0b465ae9f96176e4282f92ed658a98afa85b 100644 (file)
@@ -15,4 +15,5 @@ import java.io.Serializable;
  * close method). Message must be sended before slave actor is poisoned.
  */
 public class UnregisterSlaveMountPoint implements Serializable {
+    private static final long serialVersionUID = 1L;
 }
index f8dab7320ff573ec4c1054d341ead69455bd1493..ffc3d1334b864610d28b81efc992095a31b09332 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
  * Master responds with resolved schema source.
  */
 public class YangTextSchemaSourceRequest implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     private final SourceIdentifier sourceIdentifier;
 
index 03b3db0c266e0f70646555fc14fc2aa569f2cdf7..1548dc791ae4e639231a1c8ebe504e79fac3612e 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class DeleteRequest implements TransactionRequest {
+    private static final long serialVersionUID = 1L;
 
     private final LogicalDatastoreType store;
     private final YangInstanceIdentifier path;
index 6eaea938d2b314cb4683aad90812bc488e8b4445..6e1e1bdc9f3f6e00858c279cd7daf7848363b7d4 100644 (file)
@@ -14,4 +14,5 @@ import java.io.Serializable;
  * Message is sended when read result do not present any value.
  */
 public class EmptyReadResponse implements Serializable {
+    private static final long serialVersionUID = 1L;
 }
index 92266c1773ca9e0114c661a6562321d561fd982c..b5fae5f02931f434babca317b12e22c33b77855d 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class ExistsRequest implements TransactionRequest {
+    private static final long serialVersionUID = 1L;
 
     private final LogicalDatastoreType store;
     private final YangInstanceIdentifier path;
index 21766264b787d480933d8c3bec7ad3a42c74a2c6..8c03023654f295393e791819cdf20cb3cf22dcf7 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
 
 public class MergeRequest implements TransactionRequest {
+    private static final long serialVersionUID = 1L;
 
     private final NormalizedNodeMessage data;
     private final LogicalDatastoreType store;
index 61294d5ff9fe21ab9db8219272c052d173fa84f5..41de9c22b7daf1a0ef434ad79633a4e780793d95 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
 
 public class PutRequest implements TransactionRequest {
+    private static final long serialVersionUID = 1L;
 
     private final LogicalDatastoreType store;
     private final NormalizedNodeMessage data;
index 49c6a40faf41b995860742cea658dcec84b12bd0..d950f285576bd8a1a3fcfda8c8eb13554ed1efbd 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class ReadRequest implements TransactionRequest {
+    private static final long serialVersionUID = 1L;
 
     private final LogicalDatastoreType store;
     private final YangInstanceIdentifier path;
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.netconf.topology.singleton.messages;
+package org.opendaylight.netconf.topology.singleton.messages.transactions;
 
 import java.io.Serializable;
 
@@ -14,4 +14,5 @@ import java.io.Serializable;
  * Message sent from master back to the slave when submit is not performed, tx is closed
  */
 public class SubmitFailedReply implements Serializable {
+    private static final long serialVersionUID = 1L;
 }
index 46e6ee33b7bbb0edeb75a332d5ca9bf5a344f557..5ca306c6cde5f23d711abb7b366a1d705a3b2289 100644 (file)
@@ -14,4 +14,5 @@ import java.io.Serializable;
  * Message sent from master back to the slave when submit is successfully performed.
  */
 public class SubmitReply implements Serializable {
+    private static final long serialVersionUID = 1L;
 }
index 64471a1d9c113a08e5a35c9ad4d17859e0e9bb6c..8fced1956ea89d516b1ecb6c83ec60a3f3233bb8 100644 (file)
@@ -9,63 +9,46 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
-           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
            odl:use-default-for-reference-types="true">
 
     <reference id="dataBroker"
                interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
-
     <reference id="rpcRegistry"
                interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
-
     <reference id="clusterSingletonService"
                interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
-
     <reference id="bindingAwareBroker"
-               interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker"
-                />
-
+               interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker"/>
     <reference id="keepAliveExecutor"
-               interface="org.opendaylight.controller.config.threadpool.ScheduledThreadPool"
-                />
-
+               interface="org.opendaylight.controller.config.threadpool.ScheduledThreadPool"/>
     <reference id="processingExecutor"
-               interface="org.opendaylight.controller.config.threadpool.ThreadPool"
-                />
-
+               interface="org.opendaylight.controller.config.threadpool.ThreadPool"/>
     <reference id="domBroker"
-               interface="org.opendaylight.controller.sal.core.api.Broker"
-                />
-
+               interface="org.opendaylight.controller.sal.core.api.Broker"/>
     <reference id="actorSystemProvider"
-               interface="org.opendaylight.controller.cluster.ActorSystemProvider"
-                />
-
+               interface="org.opendaylight.controller.cluster.ActorSystemProvider"/>
     <reference id="eventExecutor"
                interface="io.netty.util.concurrent.EventExecutor"
                odl:type="global-event-executor"/>
-
     <reference id="clientDispatcherDependency"
-               interface="org.opendaylight.netconf.client.NetconfClientDispatcher"
-               />
+               interface="org.opendaylight.netconf.client.NetconfClientDispatcher"/>
 
-    <bean id="netconfTopologyServiceProvider"
+    <bean id="netconfTopologyManager"
           class="org.opendaylight.netconf.topology.singleton.impl.NetconfTopologyManager"
           init-method="init" destroy-method="close">
-        <argument ref="dataBroker" />
-        <argument ref="rpcRegistry" />
-        <argument ref="clusterSingletonService" />
-        <argument ref="bindingAwareBroker" />
-        <argument ref="keepAliveExecutor" />
-        <argument ref="processingExecutor" />
-        <argument ref="domBroker" />
-        <argument ref="actorSystemProvider" />
-        <argument ref="eventExecutor" />
-        <argument ref="clientDispatcherDependency" />
-        <argument value="topology-netconf" />
+        <argument ref="dataBroker"/>
+        <argument ref="rpcRegistry"/>
+        <argument ref="clusterSingletonService"/>
+        <argument ref="bindingAwareBroker"/>
+        <argument ref="keepAliveExecutor"/>
+        <argument ref="processingExecutor"/>
+        <argument ref="domBroker"/>
+        <argument ref="actorSystemProvider"/>
+        <argument ref="eventExecutor"/>
+        <argument ref="clientDispatcherDependency"/>
+        <argument value="topology-netconf"/>
     </bean>
-
-    <service ref="netconfTopologyServiceProvider" interface="org.opendaylight.netconf.topology.singleton.api.NetconfTopologySingletonService"
-            />
+    <service ref="netconfTopologyManager"
+             interface="org.opendaylight.netconf.topology.singleton.api.NetconfTopologySingletonService"/>
 
 </blueprint>
index 661c51149f64e34b90b3ffd259b7a066af0caaee..c491ee6fe4a41023e18e018bbaedac602cbbdbd9 100644 (file)
@@ -99,7 +99,7 @@ public class ReadOnlyTransactionTest {
         doReturn(readTx).when(delegateDataBroker).newReadOnlyTransaction();
 
         final NetconfDOMTransaction masterDOMTransactions =
-                new NetconfMasterDOMTransaction(delegateDataBroker);
+                new NetconfMasterDOMTransaction(remoteDeviceId, delegateDataBroker);
 
         masterDataBroker =
                 new NetconfDOMDataBroker(system, remoteDeviceId, masterDOMTransactions);
@@ -107,7 +107,7 @@ public class ReadOnlyTransactionTest {
         // Create slave data broker for testing proxy
 
         final NetconfDOMTransaction proxyDOMTransactions =
-                new NetconfProxyDOMTransaction(system, masterRef);
+                new NetconfProxyDOMTransaction(remoteDeviceId, system, masterRef);
 
         slaveDataBroker = new NetconfDOMDataBroker(system, remoteDeviceId, proxyDOMTransactions);
 
index 97b0cec90a2c3784b374b91b91fb09aac7a61ac3..c9fa38f4bd6ba06410079732fbcabb0a879fa637 100644 (file)
@@ -41,6 +41,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.Mock;
+import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
@@ -106,7 +107,7 @@ public class WriteOnlyTransactionTest {
         doReturn(readTx).when(delegateDataBroker).newReadOnlyTransaction();
 
         final NetconfDOMTransaction masterDOMTransactions =
-                new NetconfMasterDOMTransaction(delegateDataBroker);
+                new NetconfMasterDOMTransaction(remoteDeviceId, delegateDataBroker);
 
         masterDataBroker =
                 new NetconfDOMDataBroker(system, remoteDeviceId, masterDOMTransactions);
@@ -114,7 +115,7 @@ public class WriteOnlyTransactionTest {
         // Create slave data broker for testing proxy
 
         final NetconfDOMTransaction proxyDOMTransactions =
-                new NetconfProxyDOMTransaction(system, masterRef);
+                new NetconfProxyDOMTransaction(remoteDeviceId, system, masterRef);
 
         slaveDataBroker = new NetconfDOMDataBroker(system, remoteDeviceId, proxyDOMTransactions);