From: Tomas Cere Date: Mon, 24 Oct 2016 07:35:34 +0000 (+0000) Subject: Merge "Remove old clustered netconf topology implementation" X-Git-Tag: release/carbon~159 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=7e616201d2ffeb2e249709b3fff1be1e074ed8ce;hp=69d9dc9dac769ea61baedbbe8aac52c586ac1ab4;p=netconf.git Merge "Remove old clustered netconf topology implementation" --- diff --git a/netconf/netconf-topology-singleton/pom.xml b/netconf/netconf-topology-singleton/pom.xml index 34db91e610..e247fb5071 100644 --- a/netconf/netconf-topology-singleton/pom.xml +++ b/netconf/netconf-topology-singleton/pom.xml @@ -33,6 +33,13 @@ pom import + + org.opendaylight.controller + mdsal-artifacts + 1.5.0-SNAPSHOT + pom + import + @@ -71,6 +78,10 @@ akka-testkit_2.11 test + + org.opendaylight.controller + sal-distributed-datastore + \ No newline at end of file diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java index 7fa8e5aaad..8e45cbc374 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java @@ -131,7 +131,7 @@ class MasterSalFacade implements AutoCloseable, RemoteDeviceHandler(LogicalDatastoreType.OPERATIONAL, NetconfTopologyUtils.createTopologyNodeListPath(key, topologyId)), this); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java index 6cad5c1c04..cfd9dd8113 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java @@ -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(); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java index 47405b87c8..0525789d15 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java @@ -137,23 +137,23 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { Futures.addCallback(future, new FutureCallback() { @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() diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteOperationTxProcessorImpl.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteOperationTxProcessorImpl.java index da95e9f02a..f107966b24 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteOperationTxProcessorImpl.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteOperationTxProcessorImpl.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java index 772020bcaa..877436d6cc 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java @@ -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); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java index 602eb75503..33680f2dfc 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java @@ -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> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + LOG.trace("{}: Read[{}] {} via NETCONF: {}", id, readTx.getIdentifier(), store, path); + final CheckedFuture>, ReadFailedException> readFuture = readTx.read(store, path); final DefaultPromise> promise = new DefaultPromise<>(); @@ -81,6 +86,8 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { @Override public Future exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + LOG.trace("{}: Exists[{}] {} via NETCONF: {}", id, readTx.getIdentifier(), store, path); + final CheckedFuture existsFuture = readTx.exists(store, path); final DefaultPromise 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 submit() { + LOG.trace("{}: Submit[{}} via NETCONF", id, writeTx.getIdentifier()); + final CheckedFuture submitFuture = writeTx.submit(); final DefaultPromise promise = new DefaultPromise<>(); Futures.addCallback(submitFuture, new FutureCallback() { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java index 1b2a5ba37d..9a23a71da5 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java @@ -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 readScalaFuture = Patterns.ask(masterContextRef, new ReadRequest(store, path), NetconfTopologyUtils.TIMEOUT); + LOG.trace("{}: Read {} via NETCONF: {}", id, store, path); + final DefaultPromise> promise = new DefaultPromise<>(); readScalaFuture.onComplete(new OnComplete() { @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 existsScalaFuture = Patterns.ask(masterContextRef, new ExistsRequest(store, path), NetconfTopologyUtils.TIMEOUT); + LOG.trace("{}: Exists {} via NETCONF: {}", id, store, path); + final DefaultPromise promise = new DefaultPromise<>(); existsScalaFuture.onComplete(new OnComplete() { @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 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 submitScalaFuture = Patterns.ask(masterContextRef, new SubmitRequest(), NetconfTopologyUtils.TIMEOUT); + LOG.trace("{}: Submit {} via NETCONF", id); + final DefaultPromise promise = new DefaultPromise<>(); submitScalaFuture.onComplete(new OnComplete() { @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); } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java index 3af25c62b9..9b386c0a47 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java @@ -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>, ReadFailedException> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + + LOG.trace("{}: Read {} via NETCONF: {}", id, store, path); + final Future> future = delegate.read(store, path); final SettableFuture>> settableFuture = SettableFuture.create(); final CheckedFuture>, ReadFailedException> checkedFuture; @@ -82,6 +94,9 @@ public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction { @Override public CheckedFuture exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + + LOG.trace("{}: Exists {} via NETCONF: {}", id, store, path); + final Future existsFuture = delegate.exists(store, path); final SettableFuture settableFuture = SettableFuture.create(); final CheckedFuture checkedFuture; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java index bef72a256b..f938748cbf 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java @@ -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 submit() { + LOG.trace("{}: Submit", id); + final Future submit = delegate.submit(); final SettableFuture settFuture = SettableFuture.create(); final CheckedFuture checkedFuture; @@ -87,6 +106,8 @@ public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction { @Override public ListenableFuture> commit() { + LOG.trace("{}: Commit", id); + final Future commit = delegate.submit(); final SettableFuture> settFuture = SettableFuture.create(); commit.onComplete(new OnComplete() { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/AskForMasterMountPoint.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/AskForMasterMountPoint.java index 9fb3ac2785..4d56e1f17b 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/AskForMasterMountPoint.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/AskForMasterMountPoint.java @@ -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; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/CreateInitialMasterActorData.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/CreateInitialMasterActorData.java index 2117f699df..bab9056742 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/CreateInitialMasterActorData.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/CreateInitialMasterActorData.java @@ -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 allSourceIdentifiers; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/MasterActorDataInitialized.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/MasterActorDataInitialized.java index 51c698be43..fa5482b8fe 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/MasterActorDataInitialized.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/MasterActorDataInitialized.java @@ -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; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java index 48a86749f0..b4ede5bdbf 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/NormalizedNodeMessage.java @@ -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 APPLIER = (instance, path, node) -> { + instance.identifier = path; + instance.node = node; + }; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RefreshSetupMasterActorData.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RefreshSetupMasterActorData.java index f75b034032..fbc43f7cf9 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RefreshSetupMasterActorData.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RefreshSetupMasterActorData.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RegisterMountPoint.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RegisterMountPoint.java index 26c634859d..0023103a5c 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RegisterMountPoint.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/RegisterMountPoint.java @@ -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 allSourceIdentifiers; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/UnregisterSlaveMountPoint.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/UnregisterSlaveMountPoint.java index 7c05b6ae75..303f0b465a 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/UnregisterSlaveMountPoint.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/UnregisterSlaveMountPoint.java @@ -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; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/YangTextSchemaSourceRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/YangTextSchemaSourceRequest.java index f8dab7320f..ffc3d1334b 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/YangTextSchemaSourceRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/YangTextSchemaSourceRequest.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/CancelRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/CancelRequest.java index 902dfdca73..7a73fe2e90 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/CancelRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/CancelRequest.java @@ -9,4 +9,5 @@ package org.opendaylight.netconf.topology.singleton.messages.transactions; public class CancelRequest implements TransactionRequest { + private static final long serialVersionUID = 1L; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/DeleteRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/DeleteRequest.java index 03b3db0c26..1548dc791a 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/DeleteRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/DeleteRequest.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/EmptyReadResponse.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/EmptyReadResponse.java index 6eaea938d2..6e1e1bdc9f 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/EmptyReadResponse.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/EmptyReadResponse.java @@ -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; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ExistsRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ExistsRequest.java index 92266c1773..b5fae5f029 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ExistsRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ExistsRequest.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/MergeRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/MergeRequest.java index 21766264b7..8c03023654 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/MergeRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/MergeRequest.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/PutRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/PutRequest.java index 61294d5ff9..41de9c22b7 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/PutRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/PutRequest.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ReadRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ReadRequest.java index 49c6a40faf..d950f28557 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ReadRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/ReadRequest.java @@ -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; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/SubmitFailedReply.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitFailedReply.java similarity index 79% rename from netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/SubmitFailedReply.java rename to netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitFailedReply.java index 0aa4f7f501..fe077e2fb5 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/SubmitFailedReply.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitFailedReply.java @@ -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; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitReply.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitReply.java index 46e6ee33b7..5ca306c6cd 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitReply.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitReply.java @@ -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; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitRequest.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitRequest.java index d764aa43bd..6b6af7e773 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitRequest.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/transactions/SubmitRequest.java @@ -9,4 +9,5 @@ package org.opendaylight.netconf.topology.singleton.messages.transactions; public class SubmitRequest implements TransactionRequest { + private static final long serialVersionUID = 1L; } diff --git a/netconf/netconf-topology-singleton/src/main/resources/org/opendaylight/blueprint/netconf-topology-singleton.xml b/netconf/netconf-topology-singleton/src/main/resources/org/opendaylight/blueprint/netconf-topology-singleton.xml index 64471a1d9c..8fced1956e 100644 --- a/netconf/netconf-topology-singleton/src/main/resources/org/opendaylight/blueprint/netconf-topology-singleton.xml +++ b/netconf/netconf-topology-singleton/src/main/resources/org/opendaylight/blueprint/netconf-topology-singleton.xml @@ -9,63 +9,46 @@ and is available at http://www.eclipse.org/legal/epl-v10.html --> - - - - + interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker"/> - + interface="org.opendaylight.controller.config.threadpool.ScheduledThreadPool"/> - + interface="org.opendaylight.controller.config.threadpool.ThreadPool"/> - + interface="org.opendaylight.controller.sal.core.api.Broker"/> - + interface="org.opendaylight.controller.cluster.ActorSystemProvider"/> - + interface="org.opendaylight.netconf.client.NetconfClientDispatcher"/> - - - - - - - - - - - - + + + + + + + + + + + - - + diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java index 661c51149f..c491ee6fe4 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java @@ -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); diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java index 97b0cec90a..c9fa38f4bd 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java @@ -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);