Bug 8032 - Initialization in sal failed, disconnecting from device
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / impl / actors / NetconfNodeActor.java
index fbd0422b692c66129f336dbb0f38bd8440ef31fe..f04430f6660d02ad9898b9097b97856d4862158d 100644 (file)
@@ -26,6 +26,7 @@ import org.opendaylight.controller.cluster.schema.provider.impl.YangTextSchemaSo
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
@@ -74,6 +75,7 @@ public class NetconfNodeActor extends UntypedActor {
     private final SchemaRepository schemaRepository;
     private final Timeout actorResponseWaitTime;
     private final Duration writeTxIdleTimeout;
+    private final DOMMountPointService mountPointService;
 
     private RemoteDeviceId id;
     private NetconfTopologySetup setup;
@@ -87,20 +89,24 @@ public class NetconfNodeActor extends UntypedActor {
 
     public static Props props(final NetconfTopologySetup setup,
                               final RemoteDeviceId id, final SchemaSourceRegistry schemaRegistry,
-                              final SchemaRepository schemaRepository, final Timeout actorResponseWaitTime) {
+                              final SchemaRepository schemaRepository, final Timeout actorResponseWaitTime,
+                              final DOMMountPointService mountPointService) {
         return Props.create(NetconfNodeActor.class, () ->
-                new NetconfNodeActor(setup, id, schemaRegistry, schemaRepository, actorResponseWaitTime));
+                new NetconfNodeActor(setup, id, schemaRegistry, schemaRepository, actorResponseWaitTime,
+                        mountPointService));
     }
 
     private NetconfNodeActor(final NetconfTopologySetup setup,
                              final RemoteDeviceId id, final SchemaSourceRegistry schemaRegistry,
-                             final SchemaRepository schemaRepository, final Timeout actorResponseWaitTime) {
+                             final SchemaRepository schemaRepository, final Timeout actorResponseWaitTime,
+                             final DOMMountPointService mountPointService) {
         this.setup = setup;
         this.id = id;
         this.schemaRegistry = schemaRegistry;
         this.schemaRepository = schemaRepository;
         this.actorResponseWaitTime = actorResponseWaitTime;
         this.writeTxIdleTimeout = setup.getIdleTimeout();
+        this.mountPointService = mountPointService;
     }
 
     @Override
@@ -225,7 +231,8 @@ public class NetconfNodeActor extends UntypedActor {
             slaveSalManager.close();
         }
         closeSchemaSourceRegistrations();
-        slaveSalManager = new SlaveSalFacade(id, setup.getDomBroker(), setup.getActorSystem(), actorResponseWaitTime);
+        slaveSalManager = new SlaveSalFacade(id, setup.getActorSystem(), actorResponseWaitTime,
+                mountPointService);
 
         final CheckedFuture<SchemaContext, SchemaResolutionException> remoteSchemaContext =
                 getSchemaContext(masterReference);