Bump upstreams 44/110144/35
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 5 Feb 2024 11:59:44 +0000 (12:59 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 29 Feb 2024 15:54:17 +0000 (16:54 +0100)
Adopt:
- yangtools-13.0.1
- mdsal-13.0.0
- controller-9.0.0
- aaa-0.19.1
- netconf-7.0.0

Change-Id: Id7893692f463b1841c8a051e11737bddd54163bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
97 files changed:
applications/arbitratorreconciliation/impl/src/main/java/org/opendaylight/openflowplugin/applications/arbitratorreconciliation/impl/ArbitratorReconciliationManagerImpl.java
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterTxChain.java
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/SalBulkFlowRpcs.java
applications/bulk-o-matic/src/test/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterTxChainTest.java
applications/bulk-o-matic/src/test/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/SalBulkFlowRpcsTest.java
applications/device-ownership-service/src/main/java/org/opendaylight/openflowplugin/applications/deviceownershipservice/impl/DeviceOwnershipServiceImpl.java
applications/forwardingrules-manager/pom.xml
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractNodeConnectorCommitter.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/DeviceMastership.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/DeviceMastershipManager.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ForwardingRulesManagerImpl.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelper.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelperImpl.java
applications/forwardingrules-manager/src/main/resources/OSGI-INF/blueprint/forwardingrules-manager.xml
applications/forwardingrules-manager/src/test/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractFRMTest.java
applications/forwardingrules-manager/src/test/java/org/opendaylight/openflowplugin/applications/frm/impl/DeviceMastershipManagerTest.java
applications/forwardingrules-sync/pom.xml
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/AbstractFrmSyncListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/ForwardingRulesSyncProvider.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedConfigListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastership.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastershipManager.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/GroupForwarder.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/MeterForwarder.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/ForwardingRulesSyncProviderTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedConfigListenerTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalListenerTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastershipManagerTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastershipTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/GroupForwarderTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/MeterForwarderTest.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/LLDPSpeaker.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/NodeConnectorInventoryEventTranslator.java
applications/lldp-speaker/src/main/resources/OSGI-INF/blueprint/lldp-speaker.xml
applications/lldp-speaker/src/test/java/org/opendaylight/openflowplugin/applications/lldpspeaker/LLDPSpeakerTest.java
applications/lldp-speaker/src/test/java/org/opendaylight/openflowplugin/applications/lldpspeaker/NodeConnectorInventoryEventTranslatorTest.java
applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java
applications/of-switch-config-pusher/src/test/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusherTest.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/DefaultDpnTracker.java
applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPPacketPuntEnforcer.java
applications/table-miss-enforcer/src/test/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPDataTreeChangeListenerTest.java
applications/topology-lldp-discovery/pom.xml
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java
applications/topology-manager/pom.xml
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/DataTreeChangeListenerImpl.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/NodeChangeListenerImpl.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/TerminationPointChangeListenerImpl.java
applications/topology-manager/src/test/java/org/opendaylight/openflowplugin/applications/topology/manager/DataTreeChangeListenerBase.java
applications/topology-manager/src/test/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyExporterTest.java
applications/topology-manager/src/test/java/org/opendaylight/openflowplugin/applications/topology/manager/NodeChangeListenerImplTest.java
applications/topology-manager/src/test/java/org/opendaylight/openflowplugin/applications/topology/manager/TerminationPointChangeListenerImplTest.java
extension/openflowjava-extension-nicira/pom.xml
extension/test-extension/src/main/java/org/opendaylight/openflowplugin/extension/test/Test.java
features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml
features-aggregator/odl-openflowplugin-flow-services-rest/src/main/feature/feature.xml
features-aggregator/odl-openflowplugin-nsf-model/pom.xml
features-aggregator/odl-openflowplugin-nsf-model/src/main/feature/feature.xml
features-aggregator/odl-openflowplugin-southbound/pom.xml
features-aggregator/odl-openflowplugin-southbound/src/main/feature/feature.xml
openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml
openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml
openflowplugin-api/pom.xml
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OFPContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceInfo.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/lifecycle/ContextChain.java
openflowplugin-common/src/main/java/org/opendaylight/openflowplugin/common/txchain/TransactionChainManager.java
openflowplugin-common/src/test/java/org/opendaylight/openflowplugin/common/txchain/TransactionChainManagerTest.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/ForwardingPingPongDataBroker.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/BarrierUtil.java
openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/openflowplugin-impl.xml
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImplTest.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PacketOutConvertor.java
parent/pom.xml
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/DataTreeChangeListenerRegistrationHolder.java
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/LearningSwitchManagerSimpleImpl.java
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/WakeupOnNode.java
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/multi/LearningSwitchManagerMultiImpl.java
samples/sample-bundles/src/main/java/org/opendaylight/openflowplugin/samples/sample/bundles/SampleFlowCapableNodeListener.java
samples/sample-consumer/src/main/java/org/opendaylight/openflowplugin/openflow/samples/consumer/SimpleDropFirewall.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java

index b8e605c3e64a2f52634295ef9af550e229abad9c..0b6c59de79c2f94d4be0c5b0faf2c5e3cf885d63 100644 (file)
@@ -30,8 +30,8 @@ import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.applications.reconciliation.NotificationRegistration;
@@ -129,7 +129,7 @@ public final class ArbitratorReconciliationManagerImpl implements Reconciliation
     @Inject
     @Activate
     public ArbitratorReconciliationManagerImpl(@Reference final ReconciliationManager reconciliationManager,
-            @Reference final RpcProviderService rpcProviderService, @Reference final RpcConsumerRegistry rpcService,
+            @Reference final RpcProviderService rpcProviderService, @Reference final RpcService rpcService,
             @Reference final UpgradeState upgradeState) {
         this.rpcProviderService = requireNonNull(rpcProviderService);
         this.upgradeState = requireNonNull(upgradeState);
index 91dbcaa471313190fef9e905a68602750579ce6e..067b6d34395556afcf7295f0a7c16af3c568d0a9 100644 (file)
@@ -13,14 +13,13 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.Transaction;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Empty;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,14 +32,14 @@ public class FlowWriterTxChain implements FlowCounterMBean {
     private final AtomicInteger countDpnWriteCompletion = new AtomicInteger();
     private final AtomicLong taskCompletionTime = new AtomicLong();
 
-    public FlowWriterTxChain(final DataBroker dataBroker, ExecutorService flowPusher) {
+    public FlowWriterTxChain(final DataBroker dataBroker, final ExecutorService flowPusher) {
         this.dataBroker = dataBroker;
         this.flowPusher = flowPusher;
         LOG.info("Using Ping Pong Flow Tester Impl");
     }
 
-    public void addFlows(Integer dpnCount, Integer flowsPerDPN, int batchSize, int sleepMillis, int sleepAfter,
-            short startTableId, short endTableId, boolean isCreateParents) {
+    public void addFlows(final Integer dpnCount, final Integer flowsPerDPN, final int batchSize, final int sleepMillis,
+            final int sleepAfter, final short startTableId, final short endTableId, final boolean isCreateParents) {
         LOG.info("Using Transaction Chain Flow Writer Impl");
         countDpnWriteCompletion.set(dpnCount);
         startTime = System.nanoTime();
@@ -51,8 +50,8 @@ public class FlowWriterTxChain implements FlowCounterMBean {
         }
     }
 
-    public void deleteFlows(Integer dpnCount, Integer flowsPerDPN, int batchSize, short startTableId,
-            short endTableId) {
+    public void deleteFlows(final Integer dpnCount, final Integer flowsPerDPN, final int batchSize,
+            final short startTableId, final short endTableId) {
         LOG.info("Using Transaction Chain Flow Writer Impl");
         countDpnWriteCompletion.set(dpnCount);
         for (int i = 1; i <= dpnCount; i++) {
@@ -72,7 +71,7 @@ public class FlowWriterTxChain implements FlowCounterMBean {
         return taskCompletionTime.get();
     }
 
-    private class FlowHandlerTask implements Runnable, TransactionChainListener {
+    private class FlowHandlerTask implements Runnable, FutureCallback<Empty> {
         private final String dpId;
         private final boolean add;
         private final int flowsPerDpn;
@@ -84,7 +83,7 @@ public class FlowWriterTxChain implements FlowCounterMBean {
         private final boolean isCreateParents;
         private final AtomicInteger remainingTxReturn = new AtomicInteger(0);
 
-        private TransactionChain txChain;
+        private TransactionChain txChain = null;
 
         FlowHandlerTask(final String dpId,
                         final int flowsPerDpn,
@@ -116,7 +115,8 @@ public class FlowWriterTxChain implements FlowCounterMBean {
             int newBatchSize = batchSize;
             LOG.info("Number of Txn for dpId: {} is: {}", dpId, numSubmits);
 
-            txChain = dataBroker.createMergingTransactionChain(this);
+            txChain = dataBroker.createMergingTransactionChain();
+            txChain.addCallback(this);
             LOG.info("Creating new txChain: {} for dpid: {}", txChain, dpId);
 
             for (int i = 1; i <= numSubmits; i++) {
@@ -160,20 +160,18 @@ public class FlowWriterTxChain implements FlowCounterMBean {
         }
 
         @Override
-        public void onTransactionChainFailed(TransactionChain transactionChain,
-                Transaction asyncTransaction, Throwable throwable) {
-            LOG.error("Transaction chain: {} FAILED at asyncTransaction: {} due to: ", transactionChain,
-                    asyncTransaction.getIdentifier(), throwable);
-            transactionChain.close();
+        public void onFailure(final Throwable throwable) {
+            LOG.error("Transaction chain: {} FAILED due to: ", txChain, throwable);
+            txChain.close();
         }
 
         @Override
-        public void onTransactionChainSuccessful(TransactionChain transactionChain) {
-            LOG.info("Transaction chain: {} closed successfully.", transactionChain);
+        public void onSuccess(final Empty result) {
+            LOG.info("Transaction chain: {} closed successfully.", txChain);
         }
 
-        private void writeTxToDs(WriteTransaction writeTransaction, String flowId, InstanceIdentifier<Flow> flowIid,
-                Flow flow, Integer sourceIp, Short tableId) {
+        private void writeTxToDs(final WriteTransaction writeTransaction, final String flowId,
+                final InstanceIdentifier<Flow> flowIid, final Flow flow, final Integer sourceIp, final Short tableId) {
             if (add) {
                 LOG.trace("Adding flow for flowId: {}, flowIid: {}", flowId, flowIid);
                 if (isCreateParents) {
@@ -194,8 +192,8 @@ public class FlowWriterTxChain implements FlowCounterMBean {
             private final short beginTableId;
             private final TransactionChain txChain;
 
-            DsCallBack(String dpId, short beginTableId, short endTableId, int sourceIp,
-                    TransactionChain txChain) {
+            DsCallBack(final String dpId, final short beginTableId, final short endTableId, final int sourceIp,
+                    final TransactionChain txChain) {
                 this.dpId = dpId;
                 this.sourceIp = sourceIp;
                 this.endTableId = endTableId;
@@ -204,7 +202,7 @@ public class FlowWriterTxChain implements FlowCounterMBean {
             }
 
             @Override
-            public void onSuccess(Object notUsed) {
+            public void onSuccess(final Object notUsed) {
                 if (remainingTxReturn.decrementAndGet() <= 0) {
                     long dur = System.nanoTime() - startTime;
                     LOG.info("Completed all flows installation for: dpid: {} in {}ns", dpId, dur);
@@ -218,7 +216,7 @@ public class FlowWriterTxChain implements FlowCounterMBean {
             }
 
             @Override
-            public void onFailure(Throwable error) {
+            public void onFailure(final Throwable error) {
                 if (remainingTxReturn.decrementAndGet() <= 0) {
                     long dur = System.nanoTime() - startTime;
                     LOG.info("Completed all flows installation for: dpid: {} in {}ns", dpId, dur);
index 2ae748b89ea785a1c0dfe4d47901b6486e4f64c9..22aa5d4a56af93d5b9b397cd8bcf3696d51d1d20 100644 (file)
@@ -36,8 +36,8 @@ import javax.management.NotCompliantMBeanException;
 import javax.management.ObjectName;
 import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.bulk.flow.service.rev150608.AddFlowsDs;
@@ -117,7 +117,7 @@ public final class SalBulkFlowRpcs implements AutoCloseable {
 
     @Inject
     @Activate
-    public SalBulkFlowRpcs(@Reference final DataBroker dataBroker, @Reference final RpcConsumerRegistry rpcService,
+    public SalBulkFlowRpcs(@Reference final DataBroker dataBroker, @Reference final RpcService rpcService,
             @Reference final RpcProviderService rpcProviderService) {
         this.dataBroker = requireNonNull(dataBroker);
         addFlow = rpcService.getRpc(AddFlow.class);
index 5ed37cb015852148ed74677fb77f403397298dfd..882ee60d3c6d907fcd210b00d0ed6671ca7872c6 100644 (file)
@@ -53,8 +53,7 @@ public class FlowWriterTxChainTest {
 
         final TransactionChain mockedTxChain = mock(TransactionChain.class);
         when(mockedTxChain.newWriteOnlyTransaction()).thenReturn(writeTransaction);
-        doReturn(mockedTxChain).when(mockDataBroker)
-                .createMergingTransactionChain(ArgumentMatchers.any());
+        doReturn(mockedTxChain).when(mockDataBroker).createMergingTransactionChain();
 
         doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit();
 
index 5abbb00765d8475b7e88a849cab0410ed799aa31..3de08eed6b4577a1735fb0cf8858bb2bb475eff7 100644 (file)
@@ -30,8 +30,8 @@ import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -84,7 +84,7 @@ public class SalBulkFlowRpcsTest {
     @Mock
     private DataBroker mockDataBroker;
     @Mock
-    private RpcConsumerRegistry mockRpcService;
+    private RpcService mockRpcService;
     @Mock
     private RpcProviderService mockRpcProviderService;
     @Mock
index 9133fd71acc1b0c59db88cf11f1863c10c487754..892b2d33b8bd9112f0f28b81f537c709a4afd5a9 100644 (file)
@@ -16,10 +16,10 @@ import java.util.regex.Pattern;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
-import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
 import org.opendaylight.mdsal.eos.common.api.EntityOwnershipState;
+import org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.core.general.entity.rev150930.Entity;
 import org.opendaylight.yangtools.concepts.Registration;
@@ -75,17 +75,17 @@ public final class DeviceOwnershipServiceImpl
     }
 
     @Override
-    public void ownershipChanged(final EntityOwnershipChange ownershipChange) {
-        final String entityName = ownershipChange.getEntity().getIdentifier().firstKeyOf(Entity.class).getName();
+    public void ownershipChanged(final org.opendaylight.mdsal.eos.binding.api.Entity entity,
+            final EntityOwnershipStateChange change, final boolean inJeopardy) {
+        final String entityName = entity.getIdentifier().firstKeyOf(Entity.class).getName();
         if (entityName != null && isOpenFlowEntity(entityName)) {
-            LOG.info("Entity ownership change received for node : {} : {}", entityName, ownershipChange);
-            if (!ownershipChange.getState().isOwner() && !ownershipChange.getState().hasOwner()
-                    && !ownershipChange.inJeopardy()) {
+            LOG.info("Entity ownership change received for node : {} : {}", entityName, change);
+            if (!change.isOwner() && !change.hasOwner() && !inJeopardy) {
                 LOG.debug("Entity for node {} is unregistered.", entityName);
                 ownershipStateCache.remove(entityName);
-            } else if (!ownershipChange.getState().isOwner() && ownershipChange.getState().hasOwner()) {
+            } else if (!change.isOwner() && change.hasOwner()) {
                 ownershipStateCache.put(entityName, EntityOwnershipState.OWNED_BY_OTHER);
-            } else if (ownershipChange.getState().isOwner()) {
+            } else if (change.isOwner()) {
                 LOG.trace("Entity for node : {} is registered", entityName);
                 ownershipStateCache.put(entityName, EntityOwnershipState.IS_OWNER);
             }
index 7e0d981586ef167b5256607167de5c7b58d0cb1e..b969317217b73bff151d7e7d431a129f413e1f1c 100644 (file)
   <packaging>bundle</packaging>
 
   <dependencies>
+    <dependency>
+      <groupId>com.github.spotbugs</groupId>
+      <artifactId>spotbugs-annotations</artifactId>
+      <optional>true</optional>
+    </dependency>
     <dependency>
       <groupId>com.guicedee.services</groupId>
       <artifactId>javax.inject</artifactId>
@@ -41,7 +46,7 @@
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal</groupId>
-      <artifactId>mdsal-singleton-common-api</artifactId>
+      <artifactId>mdsal-singleton-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.openflowplugin</groupId>
index a7eea7b85f4ec28b14fef038b5b000ecc222e3c3..7634e13a4066c08a84775ac9bf85223f1b0de19d 100644 (file)
@@ -13,7 +13,7 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.util.Collection;
+import java.util.List;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
@@ -24,7 +24,6 @@ import org.opendaylight.openflowplugin.applications.frm.ForwardingRulesManager;
 import org.opendaylight.openflowplugin.applications.frm.NodeConfigurator;
 import org.opendaylight.serviceutils.srm.RecoverableListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -61,7 +60,7 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
 
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
+    public void onDataTreeChanged(final List<DataTreeModification<T>> changes) {
         LOG.trace("Received data changes :{}", requireNonNull(changes, "Changes may not be null!"));
 
         for (DataTreeModification<T> change : changes) {
@@ -113,11 +112,11 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
     @Override
     public final void registerListener() {
         Futures.addCallback(registrationHelper.checkedRegisterListener(
-            DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath()), this),
-            new FutureCallback<>() {
+            DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, getWildCardPath()), this),
+            new FutureCallback<Registration>() {
                 @Override
-                public void onSuccess(final ObjectRegistration<?> flowListenerRegistration) {
-                    LOG.info("{} registered successfully", flowListenerRegistration.getInstance());
+                public void onSuccess(final Registration flowListenerRegistration) {
+                    LOG.info("{} registered successfully", this);
                     listenerRegistration = flowListenerRegistration;
                 }
 
index b693452f657062503a8a86bd501e20672a81a0e6..1f4145cba520460d132ec232a24799d1d294e876 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.openflowplugin.applications.frm.impl;
 
 import static java.util.Objects.requireNonNull;
 
-import java.util.Collection;
+import java.util.List;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.openflowplugin.applications.frm.FlowCapableNodeConnectorCommitter;
@@ -21,7 +21,7 @@ public abstract class AbstractNodeConnectorCommitter<T extends DataObject>
         implements FlowCapableNodeConnectorCommitter<T> {
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
+    public void onDataTreeChanged(final List<DataTreeModification<T>> changes) {
         requireNonNull(changes, "Changes may not be null!");
 
         for (DataTreeModification<T> change : changes) {
index 6aa463b3ad11ba4a6684dc36425b66d972ca3376..e860de0d4a96370e91774dca3c65d763c9db51a8 100644 (file)
@@ -12,8 +12,8 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
@@ -42,7 +42,7 @@ public class DeviceMastership implements ClusterSingletonService, AutoCloseable
 
     public DeviceMastership(final NodeId nodeId) {
         this.nodeId = nodeId;
-        identifier = ServiceGroupIdentifier.create(nodeId.getValue());
+        identifier = new ServiceGroupIdentifier(nodeId.getValue());
         fcnIID = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId))
                 .augmentation(FlowCapableNode.class);
         path = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId));
index 3299043337915f4fc01993e54a7e39605ce9e319..35c764223c1c9ba4df7fedc12198f332788d143d 100644 (file)
@@ -15,7 +15,7 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.util.Collection;
+import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.ReentrantLock;
@@ -97,7 +97,7 @@ public class DeviceMastershipManager implements ClusteredDataTreeChangeListener<
     }
 
     @Override
-    public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<FlowCapableNode>> changes) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> changes) {
         for (DataTreeModification<FlowCapableNode> change : changes) {
             final InstanceIdentifier<FlowCapableNode> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<FlowCapableNode> mod = change.getRootNode();
index b7b18084844b90e7153899c66f9528fb435d8c1b..38ae60307c255648d373111e4999495a3ca62c7a 100644 (file)
@@ -18,8 +18,8 @@ import javax.inject.Singleton;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.openflow.FlowGroupCacheManager;
 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
@@ -110,7 +110,7 @@ public final class ForwardingRulesManagerImpl implements ForwardingRulesManager,
 
     @Inject
     public ForwardingRulesManagerImpl(final DataBroker dataBroker,
-                                      final RpcConsumerRegistry rpcRegistry,
+                                      final RpcService rpcRegistry,
                                       final RpcProviderService rpcProviderService,
                                       final ForwardingRulesManagerConfig config,
                                       final MastershipChangeServiceManager mastershipChangeServiceManager,
index 9b3b98928296deefb8496111f2c8e717f7a75b28..ba11fc35970278630b8cbe26f120be0d2894b37f 100644 (file)
@@ -11,12 +11,12 @@ import com.google.common.util.concurrent.ListenableFuture;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 
 // Needed only for BluePrint coexistence
 public interface ListenerRegistrationHelper {
 
-    <T extends DataObject> @NonNull ListenableFuture<ObjectRegistration<?>> checkedRegisterListener(
-        DataTreeIdentifier<T> treeId, ClusteredDataTreeChangeListener<T> listener);
+    <T extends DataObject> @NonNull ListenableFuture<Registration> checkedRegisterListener(DataTreeIdentifier<T> treeId,
+        ClusteredDataTreeChangeListener<T> listener);
 }
\ No newline at end of file
index c00dff38afeedcdc114887bdfdbe5b50911eea3e..f222771e6ff28842ce598950ca73e623bf270180 100644 (file)
@@ -26,7 +26,7 @@ import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -62,7 +62,7 @@ public final class ListenerRegistrationHelperImpl implements AutoCloseable, List
     }
 
     @Override
-    public <T extends DataObject> ListenableFuture<ObjectRegistration<?>> checkedRegisterListener(
+    public <T extends DataObject> ListenableFuture<Registration> checkedRegisterListener(
             final DataTreeIdentifier<T> treeId, final ClusteredDataTreeChangeListener<T> listener) {
         return Futures.submit(() -> {
             while (!getInventoryConfigDataStoreStatus().equals("OPERATIONAL")) {
index 717892aa1121420a36433d81ed51a8b759d2602b..bc9086c07639b4bd393fdbda5ebaf50878b43ac3 100644 (file)
@@ -6,7 +6,7 @@
   <reference id="dataBroker"
              interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
   <reference id="rpcConsumerRegistry"
-             interface="org.opendaylight.mdsal.binding.api.RpcConsumerRegistry"/>
+             interface="org.opendaylight.mdsal.binding.api.RpcService"/>
   <reference id="rpcProviderService"
              interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
   <reference id="mastershipChangeServiceManager"
index d2d694419d2781b554885f290f100892e7ff8a22..e1b2ff5cb52ff1c8b1a261e8f46ff429e1f40be0 100644 (file)
@@ -14,8 +14,8 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import org.mockito.Mock;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataBrokerTest;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -54,7 +54,7 @@ public abstract class AbstractFRMTest extends AbstractDataBrokerTest {
     private ForwardingRulesManagerImpl forwardingRulesManager;
 
     @Mock
-    private RpcConsumerRegistry rpcConsumerRegistry;
+    private RpcService rpcConsumerRegistry;
     @Mock
     private RpcProviderService rpcProviderService;
     @Mock
index aefeff030d83fdd7a345a2499c2ae05aaa2c02bf..e3efc8e0755328baa186516428efe20c0ced04cb 100644 (file)
@@ -17,12 +17,12 @@ import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
 import org.opendaylight.openflowplugin.applications.frm.FlowNodeReconciliation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yangtools.concepts.Registration;
 
 /**
  * Test for {@link DeviceMastershipManager}.
@@ -31,7 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 public class DeviceMastershipManagerTest {
     private DeviceMastershipManager deviceMastershipManager;
     @Mock
-    private ClusterSingletonServiceRegistration registration;
+    private Registration registration;
     @Mock
     private ClusterSingletonServiceProvider clusterSingletonService;
     @Mock
index 5266aa91f1fd585d472b3e38d77af0181b796368..2f8923bfc908bbec6bcd3ba462936fa8bf409c0e 100644 (file)
@@ -33,7 +33,7 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>mdsal-singleton-common-api</artifactId>
+            <artifactId>mdsal-singleton-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.openflowplugin.model</groupId>
index 54fc53345e95cb97a0257ef053aff9a8eb7f2432..6c2e8f3fd9f5444956015d5fd3875d4abe42f9f8 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Collection;
+import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
@@ -29,7 +29,7 @@ public abstract class AbstractFrmSyncListener<T extends DataObject> implements N
     private static final Logger LOG = LoggerFactory.getLogger(AbstractFrmSyncListener.class);
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<T>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<T>> modifications) {
         for (DataTreeModification<T> modification : modifications) {
             final NodeId nodeId = PathUtil.digNodeId(modification.getRootPath().getRootIdentifier());
             if (LOG.isTraceEnabled()) {
index b4db87d40da7d66206c2020ae827de6bcc43416f..dc1e1c47dc03a4252f412bab807332218130e83b 100644 (file)
@@ -17,9 +17,9 @@ import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.applications.frsync.NodeListener;
 import org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeCachedDao;
 import org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeOdlDao;
@@ -32,7 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.Fl
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTable;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -65,17 +65,17 @@ public class ForwardingRulesSyncProvider implements AutoCloseable {
     private final DataTreeIdentifier<FlowCapableNode> nodeConfigDataTreePath;
     private final DataTreeIdentifier<Node> nodeOperationalDataTreePath;
 
-    private ListenerRegistration<?> dataTreeConfigChangeListener;
-    private ListenerRegistration<?> dataTreeOperationalChangeListener;
+    private Registration dataTreeConfigChangeListener;
+    private Registration dataTreeOperationalChangeListener;
 
     private final ExecutorService syncThreadPool;
 
     @Inject
     @Activate
     public ForwardingRulesSyncProvider(@Reference final DataBroker dataBroker,
-            @Reference final RpcConsumerRegistry rpcRegistry,
+            @Reference final RpcService rpcRegistry,
             @Reference final ClusterSingletonServiceProvider clusterSingletonService) {
-        requireNonNull(rpcRegistry, "RpcConsumerRegistry can not be null!");
+        requireNonNull(rpcRegistry, "RpcService can not be null!");
         dataService = requireNonNull(dataBroker, "DataBroker can not be null!");
         this.clusterSingletonService = requireNonNull(clusterSingletonService,
                 "ClusterSingletonServiceProvider can not be null!");
index ef4de28ce689f44128c7e48c64e5f64587404b93..a8246111eebae5d7a1a6cbc5ac587aedb74b9479 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Collection;
+import java.util.List;
 import java.util.Optional;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
@@ -43,7 +43,7 @@ public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapabl
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNode>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> modifications) {
         super.onDataTreeChanged(modifications);
     }
 
index 6152d37957e288db4b979790fd3ea5b70551fa13..4e74e244e625b870e7985f08f29e295e9e611b82 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.openflowplugin.applications.frsync.impl;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -64,7 +64,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<Node>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<Node>> modifications) {
         super.onDataTreeChanged(modifications);
     }
 
index 49c15ca0123884b6ce40aae322e12479fa5fb929..9e84f575f5c5bf0396c29e52dd8c868610f75651 100644 (file)
@@ -9,12 +9,12 @@ package org.opendaylight.openflowplugin.applications.frsync.impl.clustering;
 
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -26,14 +26,14 @@ public final class DeviceMastership implements ClusterSingletonService, AutoClos
     private final NodeId nodeId;
     private final ServiceGroupIdentifier identifier;
     private final ReconciliationRegistry reconciliationRegistry;
-    private final ClusterSingletonServiceRegistration clusterSingletonServiceRegistration;
+    private final Registration clusterSingletonServiceRegistration;
     private boolean deviceMastered;
 
     public DeviceMastership(final NodeId nodeId,
                             final ReconciliationRegistry reconciliationRegistry,
                             final ClusterSingletonServiceProvider clusterSingletonService) {
         this.nodeId = nodeId;
-        identifier = ServiceGroupIdentifier.create(nodeId.getValue());
+        identifier = new ServiceGroupIdentifier(nodeId.getValue());
         this.reconciliationRegistry = reconciliationRegistry;
         deviceMastered = false;
         clusterSingletonServiceRegistration = clusterSingletonService.registerClusterSingletonService(this);
index b9f05ffe85fda60840a7cefc121ab090ba57adef..555e5c2038bdfa4625c5e6eecb5da3eac45334f4 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.openflowplugin.applications.frsync.impl.clustering;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.concurrent.ConcurrentHashMap;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.slf4j.Logger;
index 5db595e67e1c9d00a797c1928c3cf132b9f03abc..7c86643be6a6bc0cdfac20e869ae0e75fe82ece9 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.applications.frsync.impl.strategy;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.openflowplugin.applications.frsync.ForwardingRulesCommitter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroup;
@@ -42,7 +42,7 @@ public class GroupForwarder
     private final UpdateGroup updateGroupRpc;
     private final RemoveGroup removeGroupRpc;
 
-    public GroupForwarder(final RpcConsumerRegistry rpcConsumerRegistry) {
+    public GroupForwarder(final RpcService rpcConsumerRegistry) {
         addGroupRpc = rpcConsumerRegistry.getRpc(AddGroup.class);
         updateGroupRpc = rpcConsumerRegistry.getRpc(UpdateGroup.class);
         removeGroupRpc = rpcConsumerRegistry.getRpc(RemoveGroup.class);
index 6ea8a43b11a509ce612527285fdcc03430750149..f62c829425a687bc0a5a4895fb671a673355d36a 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.applications.frsync.impl.strategy;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.openflowplugin.applications.frsync.ForwardingRulesCommitter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
@@ -42,7 +42,7 @@ public class MeterForwarder
     private final AddMeter addMeter;
     private final UpdateMeter updateMeter;
 
-    public MeterForwarder(final RpcConsumerRegistry rpcConsumerRegistry) {
+    public MeterForwarder(final RpcService rpcConsumerRegistry) {
         addMeter = rpcConsumerRegistry.getRpc(AddMeter.class);
         removeMeter = rpcConsumerRegistry.getRpc(RemoveMeter.class);
         updateMeter = rpcConsumerRegistry.getRpc(UpdateMeter.class);
index 5f953be95aad92692364916200f788e5982e0841..30697cdf45328cc4f417c788ce0cbeb7cdd5ad30 100644 (file)
@@ -18,8 +18,8 @@ import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.binding.api.RpcService;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatch;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTable;
 
@@ -31,7 +31,7 @@ public class ForwardingRulesSyncProviderTest {
     @Mock
     private DataBroker dataBroker;
     @Mock
-    private RpcConsumerRegistry rpcRegistry;
+    private RpcService rpcRegistry;
     @Mock
     private ClusterSingletonServiceProvider clusterSingletonService;
 
index 044d5f05f7f2fd338cf893ec27c58b3f530173b8..fe31d1ff9db1be837e5e48e0d3d7bf1f41653903 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
 import com.google.common.util.concurrent.Futures;
-import java.util.Collections;
+import java.util.List;
 import java.util.Optional;
 import org.junit.Assert;
 import org.junit.Before;
@@ -95,7 +95,7 @@ public class SimplifiedConfigListenerTest {
         final SyncupEntry syncupEntry =
                 loadOperationalDSAndPrepareSyncupEntry(dataAfter, confgDS, dataBefore, operationalDS);
 
-        nodeListenerConfig.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerConfig.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(reactor).syncup(fcNodePath, syncupEntry);
         Mockito.verifyNoMoreInteractions(reactor);
@@ -108,7 +108,7 @@ public class SimplifiedConfigListenerTest {
         Mockito.when(configModification.getDataAfter()).thenReturn(dataAfter);
         final SyncupEntry syncupEntry = loadOperationalDSAndPrepareSyncupEntry(dataAfter, confgDS, dataBefore, confgDS);
 
-        nodeListenerConfig.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerConfig.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(reactor).syncup(fcNodePath, syncupEntry);
         Mockito.verifyNoMoreInteractions(reactor);
@@ -121,7 +121,7 @@ public class SimplifiedConfigListenerTest {
         Mockito.when(configModification.getDataAfter()).thenReturn(null);
         final SyncupEntry syncupEntry = loadOperationalDSAndPrepareSyncupEntry(null, confgDS, dataBefore, confgDS);
 
-        nodeListenerConfig.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerConfig.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(reactor).syncup(fcNodePath, syncupEntry);
         Mockito.verifyNoMoreInteractions(reactor);
@@ -133,7 +133,7 @@ public class SimplifiedConfigListenerTest {
         Mockito.doReturn(FluentFutures.immediateFluentFuture(Optional.empty())).when(roTx)
             .read(LogicalDatastoreType.OPERATIONAL, fcNodePath);
 
-        nodeListenerConfig.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerConfig.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verifyNoMoreInteractions(reactor);
         Mockito.verify(roTx).close();
index be4a21de52f0aaba59e1a0c73fb27043aa3e846e..b33ebecc18a1454629464ee4012ef81e78c99708 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.openflowplugin.applications.frsync.impl;
 import com.google.common.util.concurrent.Futures;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import org.junit.Assert;
@@ -121,7 +121,7 @@ public class SimplifiedOperationalListenerTest {
     @Test
     public void testOnDataTreeChangedAddPhysical() {
         operationalAdd();
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
         Mockito.verify(deviceMastershipManager).onDeviceConnected(NODE_ID);
         Mockito.verifyNoMoreInteractions(reactor);
     }
@@ -131,7 +131,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.when(operationalModification.getDataBefore()).thenReturn(operationalNode);
         Mockito.when(operationalModification.getDataAfter()).thenReturn(null);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(deviceMastershipManager).onDeviceDisconnected(NODE_ID);
         Mockito.verifyNoMoreInteractions(reactor);
@@ -145,7 +145,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.when(operationalModification.getDataAfter()).thenReturn(operationalNodeEmpty);
         Mockito.when(operationalNodeEmpty.getNodeConnector()).thenReturn(null);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(deviceMastershipManager).onDeviceDisconnected(NODE_ID);
         Mockito.verifyNoMoreInteractions(reactor);
@@ -156,7 +156,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.when(reconciliationRegistry.isRegistered(NODE_ID)).thenReturn(false);
         operationalUpdate();
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verifyNoMoreInteractions(reactor);
     }
@@ -167,7 +167,7 @@ public class SimplifiedOperationalListenerTest {
         operationalUpdate();
         Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class)).thenReturn(null);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verifyNoMoreInteractions(reactor);
     }
@@ -180,7 +180,7 @@ public class SimplifiedOperationalListenerTest {
             .thenReturn(statisticsGatheringStatus);
         Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(null);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verifyNoMoreInteractions(reactor);
     }
@@ -194,7 +194,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(snapshotGatheringStatusEnd);
         Mockito.when(snapshotGatheringStatusEnd.getSucceeded()).thenReturn(false);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verifyNoMoreInteractions(reactor);
     }
@@ -205,7 +205,7 @@ public class SimplifiedOperationalListenerTest {
         operationalUpdate();
         prepareFreshOperational(false);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verifyNoMoreInteractions(reactor);
     }
@@ -218,7 +218,7 @@ public class SimplifiedOperationalListenerTest {
         final SyncupEntry syncupEntry = loadConfigDSAndPrepareSyncupEntry(
                 configNode, configDS, fcOperationalNode, operationalDS);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(reactor).syncup(fcNodePath, syncupEntry);
         Mockito.verify(roTx).close();
@@ -233,7 +233,7 @@ public class SimplifiedOperationalListenerTest {
         final SyncupEntry syncupEntry = loadConfigDSAndPrepareSyncupEntry(
                 configNode, configDS, fcOperationalNode, operationalDS);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(reactor).syncup(fcNodePath, syncupEntry);
         Mockito.verify(roTx).close();
@@ -249,7 +249,7 @@ public class SimplifiedOperationalListenerTest {
         Mockito.doReturn(FluentFutures.immediateFluentFuture(Optional.empty())).when(roTx)
             .read(LogicalDatastoreType.CONFIGURATION, fcNodePath);
 
-        nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeListenerOperational.onDataTreeChanged(List.of(dataTreeModification));
 
         Mockito.verify(reconciliationRegistry).unregisterIfRegistered(NODE_ID);
         Mockito.verifyNoMoreInteractions(reactor);
index 5ab167b6c2e7a17590c183e1b17b1de8474cf078..5a6e1055206f02699f8043458a5f224c03817583 100644 (file)
@@ -15,10 +15,10 @@ import org.mockito.ArgumentMatchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yangtools.concepts.Registration;
 
 /**
  * Test for {@link DeviceMastershipManager}.
@@ -28,7 +28,7 @@ public class DeviceMastershipManagerTest {
     private static final NodeId NODE_ID = new NodeId("testNode");
     private DeviceMastershipManager deviceMastershipManager;
     @Mock
-    private ClusterSingletonServiceRegistration registration;
+    private Registration registration;
     @Mock
     private ClusterSingletonServiceProvider clusterSingletonService;
 
index fae363e2d75d8004c8bac251f101158471bff8ba..bec197dcf558a0c5839e8c36b1d9e106f8f1a81a 100644 (file)
@@ -14,7 +14,7 @@ import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.applications.frsync.util.ReconciliationRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 
index ad33b0ed8b1f20bf6b98ea09c281ef2dd753c8e4..128af47e97c1c0afdce41b8f0f5457fe6b291b1e 100644 (file)
@@ -19,7 +19,7 @@ import org.mockito.Captor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroup;
@@ -72,7 +72,7 @@ public class GroupForwarderTest {
     private final InstanceIdentifier<Group> groupPath = flowCapableNodePath.child(Group.class, groupKey);
 
     @Mock
-    private RpcConsumerRegistry rpcConsumerRegistry;
+    private RpcService rpcConsumerRegistry;
     @Mock
     private AddGroup addGroup;
     @Mock
index d043b74f39d2277953dd781a5c5949e75937a384..8a7af3807d683b0d7a50bcf0dd326a645fa4f01d 100644 (file)
@@ -19,7 +19,7 @@ import org.mockito.Captor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
@@ -70,7 +70,7 @@ public class MeterForwarderTest {
     private final InstanceIdentifier<Meter> meterPath = flowCapableNodePath.child(Meter.class, meterKey);
 
     @Mock
-    private RpcConsumerRegistry rpcRegistry;
+    private RpcService rpcRegistry;
     @Mock
     private AddMeter addMeter;
     @Mock
index d3a353796025b5797e6ad02c49c2bc58f412d7fc..635fdd32a0663993a64bbf6a447f820399b8323f 100644 (file)
@@ -22,8 +22,8 @@ import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
 import org.opendaylight.openflowplugin.libraries.liblldp.PacketException;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
@@ -87,7 +87,7 @@ public final class LLDPSpeaker implements NodeConnectorEventsObserver, Runnable,
 
     private volatile OperStatus operationalStatus = OperStatus.RUN;
 
-    public LLDPSpeaker(final DeviceOwnershipService deviceOwnershipService, final RpcConsumerRegistry rpcService,
+    public LLDPSpeaker(final DeviceOwnershipService deviceOwnershipService, final RpcService rpcService,
             final RpcProviderService rpcProviderService, final LldpSpeakerConfig config) {
         this(Executors.newSingleThreadScheduledExecutor(THREAD_FACTORY), deviceOwnershipService, rpcService,
             rpcProviderService, config.getAddressDestination());
@@ -95,7 +95,7 @@ public final class LLDPSpeaker implements NodeConnectorEventsObserver, Runnable,
 
     @VisibleForTesting
     LLDPSpeaker(final ScheduledExecutorService scheduledExecutorService,
-            final DeviceOwnershipService deviceOwnershipService, final RpcConsumerRegistry rpcService,
+            final DeviceOwnershipService deviceOwnershipService, final RpcService rpcService,
             final RpcProviderService rpcProviderService, final MacAddress addressDestination) {
         this.scheduledExecutorService = requireNonNull(scheduledExecutorService);
         this.deviceOwnershipService = requireNonNull(deviceOwnershipService);
index 4a0f6fbf005238214a42d7491be6614f9372b046..c1c351d8d795100f7b77711fd1431a3e580f0666 100644 (file)
@@ -9,13 +9,13 @@ package org.opendaylight.openflowplugin.applications.lldpspeaker;
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
-import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
  * and update LLDPSpeaker and topology.
  */
 public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
-        implements ClusteredDataTreeChangeListener<T>, AutoCloseable {
+        implements DataTreeChangeListener<T>, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(NodeConnectorInventoryEventTranslator.class);
     private static final InstanceIdentifier<FlowCapableNodeConnector> II_TO_FLOW_CAPABLE_NODE_CONNECTOR =
         InstanceIdentifier.builder(Nodes.class)
@@ -58,12 +58,12 @@ public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
             final NodeConnectorEventsObserver... observers) {
         this.observers = ImmutableSet.copyOf(observers);
 
-        final DataTreeIdentifier dtiToNodeConnector = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
+        final DataTreeIdentifier dtiToNodeConnector = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
                                                                                    II_TO_FLOW_CAPABLE_NODE_CONNECTOR);
-        final DataTreeIdentifier dtiToNodeConnectorState = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
+        final DataTreeIdentifier dtiToNodeConnectorState = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
                                                                                    II_TO_STATE);
-        listenerOnPortRegistration = dataBroker.registerDataTreeChangeListener(dtiToNodeConnector, this);
-        listenerOnPortStateRegistration = dataBroker.registerDataTreeChangeListener(dtiToNodeConnectorState, this);
+        listenerOnPortRegistration = dataBroker.registerTreeChangeListener(dtiToNodeConnector, this);
+        listenerOnPortStateRegistration = dataBroker.registerTreeChangeListener(dtiToNodeConnectorState, this);
         LOG.info("NodeConnectorInventoryEventTranslator has started.");
     }
 
@@ -78,10 +78,10 @@ public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
     }
 
     @Override
-    public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<T>> modifications) {
-        for (DataTreeModification modification : modifications) {
-            LOG.trace("Node connectors in inventory changed -> {}", modification.getRootNode().getModificationType());
-            switch (modification.getRootNode().getModificationType()) {
+    public void onDataTreeChanged(@NonNull final List<DataTreeModification<T>> modifications) {
+        for (var modification : modifications) {
+            LOG.trace("Node connectors in inventory changed -> {}", modification.getRootNode().modificationType());
+            switch (modification.getRootNode().modificationType()) {
                 case WRITE:
                     processAddedConnector(modification);
                     break;
@@ -93,17 +93,17 @@ public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
                     break;
                 default:
                     throw new IllegalArgumentException(
-                            "Unhandled modification type: {}" + modification.getRootNode().getModificationType());
+                        "Unhandled modification type: " + modification.getRootNode().modificationType());
             }
         }
     }
 
     private void processAddedConnector(final DataTreeModification<T> modification) {
-        final InstanceIdentifier<T> identifier = modification.getRootPath().getRootIdentifier();
+        final InstanceIdentifier<T> identifier = modification.getRootPath().path();
         InstanceIdentifier<NodeConnector> nodeConnectorInstanceId = identifier.firstIdentifierOf(NodeConnector.class);
         if (compareIITail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
             FlowCapableNodeConnector flowConnector = (FlowCapableNodeConnector) modification.getRootNode()
-                    .getDataAfter();
+                    .dataAfter();
             if (!isPortDown(flowConnector)) {
                 notifyNodeConnectorAppeared(nodeConnectorInstanceId, flowConnector);
             } else {
@@ -113,11 +113,11 @@ public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
     }
 
     private void processUpdatedConnector(final DataTreeModification<T> modification) {
-        final InstanceIdentifier<T> identifier = modification.getRootPath().getRootIdentifier();
+        final InstanceIdentifier<T> identifier = modification.getRootPath().path();
         InstanceIdentifier<NodeConnector> nodeConnectorInstanceId = identifier.firstIdentifierOf(NodeConnector.class);
         if (compareIITail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
             FlowCapableNodeConnector flowConnector = (FlowCapableNodeConnector) modification.getRootNode()
-                    .getDataAfter();
+                    .dataAfter();
             if (isPortDown(flowConnector)) {
                 notifyNodeConnectorDisappeared(nodeConnectorInstanceId);
             } else {
@@ -126,7 +126,7 @@ public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
         } else if (compareIITail(identifier, II_TO_STATE)) {
             FlowCapableNodeConnector flowNodeConnector = iiToDownFlowCapableNodeConnectors.get(nodeConnectorInstanceId);
             if (flowNodeConnector != null) {
-                State state = (State) modification.getRootNode().getDataAfter();
+                State state = (State) modification.getRootNode().dataAfter();
                 if (!state.getLinkDown()) {
                     FlowCapableNodeConnectorBuilder flowCapableNodeConnectorBuilder
                             = new FlowCapableNodeConnectorBuilder(flowNodeConnector);
@@ -139,7 +139,7 @@ public final class NodeConnectorInventoryEventTranslator<T extends DataObject>
     }
 
     private void processRemovedConnector(final DataTreeModification<T> modification) {
-        final InstanceIdentifier<T> identifier = modification.getRootPath().getRootIdentifier();
+        final InstanceIdentifier<T> identifier = modification.getRootPath().path();
         if (compareIITail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
             InstanceIdentifier<NodeConnector> nodeConnectorInstanceId = identifier
                     .firstIdentifierOf(NodeConnector.class);
index 7db3f3a03fabce2891243f2bbb46b9c1192c9f87..710ccb000428222801919c42cee989d66992e73b 100644 (file)
@@ -4,7 +4,7 @@
            odl:use-default-for-reference-types="true">
 
   <reference id="dataBroker" interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
-  <reference id="rpcService" interface="org.opendaylight.mdsal.binding.api.RpcConsumerRegistry"/>
+  <reference id="rpcService" interface="org.opendaylight.mdsal.binding.api.RpcService"/>
   <reference id="rpcProviderService" interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
   <reference id="deviceOwnershipService" interface="org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService"/>
 
index de41bcf6509a99044f0c744ad1cad2e252c3b11d..6b034de02eda361349965f433af73e7270cf2291 100644 (file)
@@ -26,8 +26,8 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
 import org.opendaylight.openflowplugin.libraries.liblldp.PacketException;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
@@ -68,7 +68,7 @@ public class LLDPSpeakerTest {
     @Mock
     private DeviceOwnershipService deviceOwnershipService;
     @Mock
-    private RpcConsumerRegistry rpcService;
+    private RpcService rpcService;
     @Mock
     private RpcProviderService rpcProviderService;
 
index 7d5508084b10a1bb55c250932191b6638de11094..9db3e2fe7396d6637acc60b33e1ad4aaa294d643 100644 (file)
@@ -176,10 +176,10 @@ public class NodeConnectorInventoryEventTranslatorTest {
             final InstanceIdentifier<T> ii, final FlowCapableNodeConnector connector) {
         final DataTreeModification dataTreeModification = mock(DataTreeModification.class);
         when(dataTreeModification.getRootNode()).thenReturn(mock(DataObjectModification.class));
-        DataTreeIdentifier<T> identifier = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, ii);
-        when(dataTreeModification.getRootNode().getModificationType()).thenReturn(type);
+        DataTreeIdentifier<T> identifier = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, ii);
+        when(dataTreeModification.getRootNode().modificationType()).thenReturn(type);
         when(dataTreeModification.getRootPath()).thenReturn(identifier);
-        when(dataTreeModification.getRootNode().getDataAfter()).thenReturn(connector);
+        when(dataTreeModification.getRootNode().dataAfter()).thenReturn(connector);
         return dataTreeModification;
     }
 }
index 7e307c18e7c76d148df7080b6586ce701adcc039..5ae80a8e3c15f914cafed84dcde5a61ede2e474e 100644 (file)
@@ -9,17 +9,17 @@ package org.opendaylight.openflowplugin.openflow.ofswitch.config;
 
 import static java.util.Objects.requireNonNull;
 
-import java.util.Collection;
+import java.util.List;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
-import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
 
 @Singleton
 @Component(service = { })
-public final class DefaultConfigPusher implements AutoCloseable, ClusteredDataTreeChangeListener<FlowCapableNode> {
+public final class DefaultConfigPusher implements AutoCloseable, DataTreeChangeListener<FlowCapableNode> {
     private static final Logger LOG = LoggerFactory.getLogger(DefaultConfigPusher.class);
 
     private final DeviceOwnershipService deviceOwnershipService;
@@ -50,12 +50,12 @@ public final class DefaultConfigPusher implements AutoCloseable, ClusteredDataTr
 
     @Inject
     @Activate
-    public DefaultConfigPusher(@Reference final DataBroker dataBroker, @Reference final RpcConsumerRegistry rpcService,
+    public DefaultConfigPusher(@Reference final DataBroker dataBroker, @Reference final RpcService rpcService,
             @Reference final DeviceOwnershipService deviceOwnershipService) {
         this.deviceOwnershipService = requireNonNull(deviceOwnershipService);
         setConfig = rpcService.getRpc(SetConfig.class);
-        reg = dataBroker.registerDataTreeChangeListener(
-            DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
+        reg = dataBroker.registerTreeChangeListener(
+            DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
                 InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)), this);
         LOG.info("DefaultConfigPusher has started.");
     }
@@ -68,17 +68,15 @@ public final class DefaultConfigPusher implements AutoCloseable, ClusteredDataTr
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNode>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> modifications) {
         for (var modification : modifications) {
-            if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {
-                final var nodeId = modification.getRootPath().getRootIdentifier().firstKeyOf(Node.class)
-                    .getId().getValue();
+            if (modification.getRootNode().modificationType() == ModificationType.WRITE) {
+                final var nodeId = modification.getRootPath().path().firstKeyOf(Node.class).getId().getValue();
                 if (deviceOwnershipService.isEntityOwned(nodeId)) {
                     LoggingFutures.addErrorLogging(setConfig.invoke(new SetConfigInputBuilder()
                         .setFlag(SwitchConfigFlag.FRAGNORMAL.toString())
                         .setMissSearchLength(OFConstants.OFPCML_NO_BUFFER)
-                        .setNode(new NodeRef(
-                            modification.getRootPath().getRootIdentifier().firstIdentifierOf(Node.class)))
+                        .setNode(new NodeRef(modification.getRootPath().path().firstIdentifierOf(Node.class)))
                         .build()), LOG, "addFlow");
                 } else {
                     LOG.debug("Node {} is not owned by this controller, so skip setting config", nodeId);
index 68a312adcfd694490194219458a75c40290c2e0b..4d032569caa5b7ceb875865d64b985eb6a55eeba 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
@@ -40,7 +40,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
@@ -55,7 +55,7 @@ public class DefaultConfigPusherTest {
     @Mock
     private DataBroker dataBroker;
     @Mock
-    private RpcConsumerRegistry rpcService;
+    private RpcService rpcService;
     @Mock
     private SetConfig setConfig;
     @Mock
@@ -67,21 +67,21 @@ public class DefaultConfigPusherTest {
     @Mock
     private DeviceOwnershipService deviceOwnershipService;
     @Mock
-    private  ListenerRegistration<?> reg;
+    private Registration reg;
     @Captor
     private ArgumentCaptor<SetConfigInput> setConfigInputCaptor;
 
     @Before
     public void setUp() {
         doReturn(RpcResultBuilder.success().buildFuture()).when(setConfig).invoke(any());
-        doReturn(reg).when(dataBroker).registerDataTreeChangeListener(any(), any());
+        doReturn(reg).when(dataBroker).registerTreeChangeListener(any(), any());
         doReturn(setConfig).when(rpcService).getRpc(any());
         defaultConfigPusher = new DefaultConfigPusher(dataBroker, rpcService, deviceOwnershipService);
-        final var identifier = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
+        final var identifier = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
             NODE_IID.augmentation(FlowCapableNode.class));
         when(dataTreeModification.getRootPath()).thenReturn(identifier);
         when(dataTreeModification.getRootNode()).thenReturn(dataObjectModification);
-        when(dataTreeModification.getRootNode().getModificationType()).thenReturn(ModificationType.WRITE);
+        when(dataTreeModification.getRootNode().modificationType()).thenReturn(ModificationType.WRITE);
         when(deviceOwnershipService.isEntityOwned(any())).thenReturn(true);
     }
 
index 1a0e6b52b7095c4fe7bffefaa238d81582166edf..97a267ccaf2bca6c84605849c58120f3ebd1bb09 100644 (file)
@@ -8,15 +8,14 @@
 package org.opendaylight.openflowplugin.applications.southboundcli;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
-import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -24,7 +23,7 @@ import org.opendaylight.openflowplugin.applications.southboundcli.util.OFNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -35,20 +34,19 @@ import org.slf4j.LoggerFactory;
 
 @Singleton
 @Component(service = DpnTracker.class)
-public final class DefaultDpnTracker
-        implements DpnTracker, ClusteredDataTreeChangeListener<FlowCapableNode>, AutoCloseable {
+public final class DefaultDpnTracker implements DpnTracker, DataTreeChangeListener<FlowCapableNode>, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(DefaultDpnTracker.class);
     public static final String DEFAULT_DPN_NAME = "UNKNOWN";
     public static final String SEPARATOR = ":";
 
     private final Map<Long, String> dpnIdToNameCache = new HashMap<>();
-    private final ListenerRegistration<?> listenerReg;
+    private final Registration listenerReg;
 
     @Inject
     @Activate
     public DefaultDpnTracker(@Reference final DataBroker dataBroker) {
-        listenerReg = dataBroker.registerDataTreeChangeListener(
-            DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
+        listenerReg = dataBroker.registerTreeChangeListener(
+            DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
                 InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)), this);
     }
 
@@ -72,27 +70,27 @@ public final class DefaultDpnTracker
     }
 
     @Override
-    public synchronized void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNode>> changes) {
+    public synchronized void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> changes) {
         for (var change : changes) {
-            final var key = change.getRootPath().getRootIdentifier();
+            final var key = change.getRootPath().path();
             final var mod = change.getRootNode();
             final var nodeIdent = key.firstIdentifierOf(FlowCapableNode.class);
-            switch (mod.getModificationType()) {
+            switch (mod.modificationType()) {
                 case DELETE:
-                    remove(nodeIdent, mod.getDataBefore());
+                    remove(nodeIdent, mod.dataBefore());
                     break;
                 case SUBTREE_MODIFIED:
-                    update(nodeIdent, mod.getDataBefore(), mod.getDataAfter());
+                    update(nodeIdent, mod.dataBefore(), mod.dataAfter());
                     break;
                 case WRITE:
                     if (mod.getDataBefore() == null) {
-                        add(nodeIdent, mod.getDataAfter());
+                        add(nodeIdent, mod.dataAfter());
                     } else {
-                        update(nodeIdent, mod.getDataBefore(), mod.getDataAfter());
+                        update(nodeIdent, mod.dataBefore(), mod.dataAfter());
                     }
                     break;
                 default:
-                    throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
+                    throw new IllegalArgumentException("Unhandled modification type " + mod.modificationType());
             }
         }
     }
index f628621cdea806d12e4677ffbc06a52bb0f78225..0ff33f476e8cbdb438324e1e43501b75f514b79a 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.openflowplugin.applications.tablemissenforcer;
 
 import static java.util.Objects.requireNonNull;
 
-import java.util.Collection;
+import java.util.List;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
@@ -19,7 +19,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
@@ -74,7 +74,7 @@ public final class LLDPPacketPuntEnforcer implements AutoCloseable, ClusteredDat
     @Activate
     public LLDPPacketPuntEnforcer(@Reference final DataBroker dataBroker,
             @Reference final DeviceOwnershipService deviceOwnershipService,
-            @Reference final RpcConsumerRegistry rpcService) {
+            @Reference final RpcService rpcService) {
         this.deviceOwnershipService = requireNonNull(deviceOwnershipService);
         addFlow = rpcService.getRpc(AddFlow.class);
         listenerRegistration = dataBroker.registerDataTreeChangeListener(
@@ -91,15 +91,13 @@ public final class LLDPPacketPuntEnforcer implements AutoCloseable, ClusteredDat
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNode>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> modifications) {
         for (var modification : modifications) {
-            if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {
-                final var nodeId = modification.getRootPath().getRootIdentifier()
-                        .firstKeyOf(Node.class).getId().getValue();
+            if (modification.getRootNode().modificationType() == ModificationType.WRITE) {
+                final var nodeId = modification.getRootPath().path().firstKeyOf(Node.class).getId().getValue();
                 if (deviceOwnershipService.isEntityOwned(nodeId)) {
                     LoggingFutures.addErrorLogging(addFlow.invoke(new AddFlowInputBuilder(createFlow())
-                        .setNode(new NodeRef(modification.getRootPath()
-                            .getRootIdentifier().firstIdentifierOf(Node.class)))
+                        .setNode(new NodeRef(modification.getRootPath().path().firstIdentifierOf(Node.class)))
                         .build()), LOG, "addFlow");
                 } else {
                     LOG.debug("Node {} is not owned by this controller, so skip adding LLDP table miss flow", nodeId);
index 5507eea97669c0d4b55507e7884f1a40cb25b808..57372e07e776d1765d30683f0fe43bcef7103be3 100644 (file)
@@ -17,7 +17,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 import org.junit.After;
 import org.junit.Before;
@@ -32,7 +32,7 @@ import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
@@ -49,7 +49,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint16;
@@ -64,9 +64,9 @@ public class LLDPDataTreeChangeListenerTest {
     @Mock
     private DataBroker dataBroker;
     @Mock
-    private ListenerRegistration<?> reg;
+    private Registration reg;
     @Mock
-    private RpcConsumerRegistry rpcService;
+    private RpcService rpcService;
     @Mock
     private AddFlow addFlow;
     @Mock
@@ -88,7 +88,7 @@ public class LLDPDataTreeChangeListenerTest {
                 LogicalDatastoreType.OPERATIONAL, NODE_IID.augmentation(FlowCapableNode.class));
         when(dataTreeModification.getRootPath()).thenReturn(identifier);
         when(dataTreeModification.getRootNode()).thenReturn(mock(DataObjectModification.class));
-        when(dataTreeModification.getRootNode().getModificationType()).thenReturn(ModificationType.WRITE);
+        when(dataTreeModification.getRootNode().modificationType()).thenReturn(ModificationType.WRITE);
         when(deviceOwnershipService.isEntityOwned(any())).thenReturn(true);
     }
 
@@ -99,7 +99,7 @@ public class LLDPDataTreeChangeListenerTest {
 
     @Test
     public void testOnDataTreeChanged() {
-        lldpPacketPuntEnforcer.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        lldpPacketPuntEnforcer.onDataTreeChanged(List.of(dataTreeModification));
         verify(addFlow).invoke(addFlowInputCaptor.capture());
         AddFlowInput captured = addFlowInputCaptor.getValue();
         assertEquals(NODE_IID, captured.getNode().getValue());
index ed96629bc873740e16075082d9ad782952eda8c2..a8989e9c57343d65d7ea6b061ac4ceebd9afe330 100644 (file)
   <packaging>bundle</packaging>
 
   <dependencies>
+    <dependency>
+      <groupId>com.github.spotbugs</groupId>
+      <artifactId>spotbugs-annotations</artifactId>
+      <optional>true</optional>
+    </dependency>
     <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
index bb8c47440a28300660c765c2ca1e16862745b021..c4a67e02927abeb18dff06c634791762cad2497c 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.openflowplugin.applications.topology.lldp;
 
 import com.google.common.annotations.VisibleForTesting;
-import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.Map.Entry;
 import java.util.Timer;
 import java.util.TimerTask;
@@ -41,7 +41,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -60,7 +60,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
     private final NotificationPublishService notificationService;
     private final AutoCloseable configurationServiceRegistration;
     private final EntityOwnershipService eos;
-    private ListenerRegistration<?> listenerRegistration;
+    private Registration listenerRegistration;
 
     /**
      * default ctor - start timer.
@@ -76,7 +76,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
         this.notificationService = notificationService;
         configurationServiceRegistration = configurationService.registerListener(this);
         eos = entityOwnershipService;
-        final DataTreeIdentifier<Link> dtiToNodeConnector = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
+        final DataTreeIdentifier<Link> dtiToNodeConnector = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
                 II_TO_LINK);
         try {
             listenerRegistration = dataBroker.registerDataTreeChangeListener(dtiToNodeConnector, LLDPLinkAger.this);
@@ -88,7 +88,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
             topologyLldpDiscoveryConfig.getTopologyLldpInterval().getValue().toJava());
     }
 
-    public void put(LinkDiscovered link) {
+    public void put(final LinkDiscovered link) {
         Date expires = new Date();
         expires.setTime(expires.getTime() + linkExpirationTime);
         linkToDate.put(link, expires);
@@ -107,9 +107,9 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
     }
 
     @Override
-    public void onDataTreeChanged(@NonNull Collection<DataTreeModification<Link>> changes) {
+    public void onDataTreeChanged(final List<DataTreeModification<Link>> changes) {
         for (DataTreeModification<Link> modification : changes) {
-            switch (modification.getRootNode().getModificationType()) {
+            switch (modification.getRootNode().modificationType()) {
                 case WRITE:
                     break;
                 case SUBTREE_MODIFIED:
@@ -119,7 +119,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
                     processLinkDeleted(modification.getRootNode());
                     break;
                 default:
-                    LOG.error("Unhandled modification type: {}", modification.getRootNode().getModificationType());
+                    LOG.error("Unhandled modification type: {}", modification.getRootNode().modificationType());
             }
         }
     }
@@ -151,7 +151,7 @@ public final class LLDPLinkAger implements ConfigurationListener, ClusteredDataT
         return linkToDate.containsKey(linkDiscovered);
     }
 
-    private void processLinkDeleted(DataObjectModification<Link> rootNode) {
+    private void processLinkDeleted(final DataObjectModification<Link> rootNode) {
         Link link = rootNode.getDataBefore();
         LOG.trace("Removing link {} from linkToDate cache", link);
         LinkDiscovered linkDiscovered = LLDPDiscoveryUtils.toLLDPLinkDiscovered(link);
index f02c871e0a1aa785f3039ff2877f50fb25132e39..c2dbb257fa78ee036a0c56ba7b5465d9997fa7c1 100644 (file)
@@ -38,7 +38,7 @@
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal</groupId>
-      <artifactId>mdsal-singleton-common-api</artifactId>
+      <artifactId>mdsal-singleton-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.openflowplugin.model</groupId>
index a75dcd5cc60963ec61b50f84e4bb2ce00692f6ba..056d07e7661d9c1efb7eadb6ccfe5e070934a1fc 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -30,7 +30,7 @@ public abstract class DataTreeChangeListenerImpl<T extends DataObject> implement
     static final InstanceIdentifier<Topology> II_TO_TOPOLOGY = InstanceIdentifier.create(NetworkTopology.class)
         .child(Topology.class, new TopologyKey(new TopologyId(FlowCapableTopologyProvider.TOPOLOGY_ID)));
 
-    protected final ListenerRegistration<?> listenerRegistration;
+    protected final Registration listenerRegistration;
     protected OperationProcessor operationProcessor;
 
     @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR",
@@ -39,7 +39,7 @@ public abstract class DataTreeChangeListenerImpl<T extends DataObject> implement
             final InstanceIdentifier<T> ii) {
         this.operationProcessor = requireNonNull(operationProcessor);
         listenerRegistration = dataBroker.registerDataTreeChangeListener(
-            DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, ii), this);
+            DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, ii), this);
     }
 
     @Override
index e8b1adf7fe6d8466fad59e9c4a66648a77cb7975..a190b265f6192f8cbeb848d8371567e40464ddb2 100644 (file)
@@ -19,10 +19,9 @@ import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.common.txchain.TransactionChainManager;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
@@ -50,7 +49,7 @@ public final class FlowCapableTopologyProvider implements ClusterSingletonServic
     private final OperationProcessor processor;
 
     private Registration listenerRegistration;
-    private ClusterSingletonServiceRegistration singletonServiceRegistration;
+    private Registration singletonServiceRegistration;
 
     @Inject
     @Activate
@@ -108,7 +107,7 @@ public final class FlowCapableTopologyProvider implements ClusterSingletonServic
 
     @Override
     public ServiceGroupIdentifier getIdentifier() {
-        return ServiceGroupIdentifier.create(TOPOLOGY_PROVIDER);
+        return new ServiceGroupIdentifier(TOPOLOGY_PROVIDER);
     }
 
     private boolean isFlowTopologyExist(final InstanceIdentifier<Topology> path) {
index 4935309e9d78326b98179f5ace0df983bdf6878e..eb999bdb7e6994cd7ee8b295b4b681dbcfd51c62 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.applications.topology.manager;
 
-import java.util.Collection;
+import java.util.List;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
@@ -45,9 +45,9 @@ public final class NodeChangeListenerImpl extends DataTreeChangeListenerImpl<Flo
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNode>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> modifications) {
         for (DataTreeModification<FlowCapableNode> modification : modifications) {
-            switch (modification.getRootNode().getModificationType()) {
+            switch (modification.getRootNode().modificationType()) {
                 case WRITE:
                     processAddedNode(modification);
                     break;
@@ -59,7 +59,7 @@ public final class NodeChangeListenerImpl extends DataTreeChangeListenerImpl<Flo
                     break;
                 default:
                     throw new IllegalArgumentException(
-                            "Unhandled modification type: {}" + modification.getRootNode().getModificationType());
+                            "Unhandled modification type: {}" + modification.getRootNode().modificationType());
             }
         }
     }
@@ -72,7 +72,7 @@ public final class NodeChangeListenerImpl extends DataTreeChangeListenerImpl<Flo
     }
 
     private void processRemovedNode(final DataTreeModification<FlowCapableNode> modification) {
-        final var iiToNodeInInventory = modification.getRootPath().getRootIdentifier();
+        final var iiToNodeInInventory = modification.getRootPath().path();
         final var nodeId = provideTopologyNodeId(iiToNodeInInventory);
         final var iiToTopologyRemovedNode = provideIIToTopologyNode(nodeId);
         if (iiToTopologyRemovedNode != null) {
@@ -86,7 +86,7 @@ public final class NodeChangeListenerImpl extends DataTreeChangeListenerImpl<Flo
     }
 
     private void processAddedNode(final DataTreeModification<FlowCapableNode> modification) {
-        final InstanceIdentifier<FlowCapableNode> iiToNodeInInventory = modification.getRootPath().getRootIdentifier();
+        final InstanceIdentifier<FlowCapableNode> iiToNodeInInventory = modification.getRootPath().path();
         final NodeId nodeIdInTopology = provideTopologyNodeId(iiToNodeInInventory);
         if (nodeIdInTopology != null) {
             final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology
index 0636657d17cdb82dbcb23ee082dab3d8a673f9e0..f6697969841911ac7f034fb954b02a65151f1c61 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.applications.topology.manager;
 
-import java.util.Collection;
+import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import javax.annotation.PreDestroy;
@@ -51,9 +51,9 @@ public class TerminationPointChangeListenerImpl extends DataTreeChangeListenerIm
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNodeConnector>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNodeConnector>> modifications) {
         for (DataTreeModification<FlowCapableNodeConnector> modification : modifications) {
-            switch (modification.getRootNode().getModificationType()) {
+            switch (modification.getRootNode().modificationType()) {
                 case WRITE:
                     processAddedTerminationPoints(modification);
                     break;
@@ -65,7 +65,7 @@ public class TerminationPointChangeListenerImpl extends DataTreeChangeListenerIm
                     break;
                 default:
                     throw new IllegalArgumentException(
-                            "Unhandled modification type: {}" + modification.getRootNode().getModificationType());
+                            "Unhandled modification type: {}" + modification.getRootNode().modificationType());
             }
         }
     }
@@ -78,7 +78,7 @@ public class TerminationPointChangeListenerImpl extends DataTreeChangeListenerIm
     }
 
     private void processRemovedTerminationPoints(final DataTreeModification<FlowCapableNodeConnector> modification) {
-        final InstanceIdentifier<FlowCapableNodeConnector> removedNode = modification.getRootPath().getRootIdentifier();
+        final InstanceIdentifier<FlowCapableNodeConnector> removedNode = modification.getRootPath().path();
         final TpId terminationPointId = provideTopologyTerminationPointId(removedNode);
         final InstanceIdentifier<TerminationPoint> iiToTopologyTerminationPoint = provideIIToTopologyTerminationPoint(
                 terminationPointId, removedNode);
@@ -116,15 +116,14 @@ public class TerminationPointChangeListenerImpl extends DataTreeChangeListenerIm
     }
 
     private void processAddedTerminationPoints(final DataTreeModification<FlowCapableNodeConnector> modification) {
-        final InstanceIdentifier<FlowCapableNodeConnector> iiToNodeInInventory = modification.getRootPath()
-                .getRootIdentifier();
+        final InstanceIdentifier<FlowCapableNodeConnector> iiToNodeInInventory = modification.getRootPath().path();
         TpId terminationPointIdInTopology = provideTopologyTerminationPointId(iiToNodeInInventory);
         if (terminationPointIdInTopology != null) {
             InstanceIdentifier<TerminationPoint> iiToTopologyTerminationPoint = provideIIToTopologyTerminationPoint(
                     terminationPointIdInTopology, iiToNodeInInventory);
             TerminationPoint point = prepareTopologyTerminationPoint(terminationPointIdInTopology, iiToNodeInInventory);
             sendToTransactionChain(point, iiToTopologyTerminationPoint);
-            removeLinks(modification.getRootNode().getDataAfter(), point);
+            removeLinks(modification.getRootNode().dataAfter(), point);
         } else {
             LOG.debug("Inventory node connector key is null. Data can't be written to topology termination point");
         }
index 256aaada0766ad1327b8cc365e98e427072e7590..6baf89023fa7701ade5253ec323ce0bb30852481 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.applications.topology.manager;
 
-import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -25,7 +24,6 @@ import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationTyp
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
@@ -54,7 +52,7 @@ public abstract class DataTreeChangeListenerBase {
 
     @Before
     public void setUp() {
-        doReturn(mockTxChain).when(mockDataBroker).createTransactionChain(any(TransactionChainListener.class));
+        doReturn(mockTxChain).when(mockDataBroker).createTransactionChain();
 
         processor = new OperationProcessor(mockDataBroker);
 
@@ -83,12 +81,12 @@ public abstract class DataTreeChangeListenerBase {
                                                                                  final InstanceIdentifier<T> ii,
                                                                                  final boolean getDataAfter) {
         final DataTreeModification dataTreeModification = mock(DataTreeModification.class);
-        final DataTreeIdentifier<T> identifier = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, ii);
+        final DataTreeIdentifier<T> identifier = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, ii);
         when(dataTreeModification.getRootNode()).thenReturn(mock(DataObjectModification.class));
-        when(dataTreeModification.getRootNode().getModificationType()).thenReturn(type);
+        when(dataTreeModification.getRootNode().modificationType()).thenReturn(type);
         when(dataTreeModification.getRootPath()).thenReturn(identifier);
         if (getDataAfter) {
-            when(dataTreeModification.getRootNode().getDataAfter()).thenReturn(mock(FlowCapableNodeConnector.class));
+            when(dataTreeModification.getRootNode().dataAfter()).thenReturn(mock(FlowCapableNodeConnector.class));
         }
         return dataTreeModification;
     }
index 344473aa26dc9effa590a5ffda60a8ccb5eac75a..c2b1c18ba039331e0fae5a68cdfa3bccf54e76dd 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.applications.topology.manager;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -37,7 +36,6 @@ import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscoveredBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemovedBuilder;
@@ -66,8 +64,7 @@ public class FlowCapableTopologyExporterTest {
 
     @Before
     public void setUp() {
-        doReturn(mockTxChain).when(mockDataBroker)
-                .createTransactionChain(any(TransactionChainListener.class));
+        doReturn(mockTxChain).when(mockDataBroker).createTransactionChain();
 
         processor = new OperationProcessor(mockDataBroker);
 
index 6ad359e5cc4a678502b2bc7591600577efbd8507..16bb5e388eba598465adb51a3d26a915cbfdfc3c 100644 (file)
@@ -30,7 +30,6 @@ import static org.opendaylight.openflowplugin.applications.topology.manager.Test
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.CountDownLatch;
@@ -93,14 +92,13 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
 
         int expDeleteCalls = expDeletedIIDs.length;
         CountDownLatch deleteLatch = new CountDownLatch(expDeleteCalls);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
+        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs = ArgumentCaptor.forClass(InstanceIdentifier.class);
         setupStubbedDeletes(mockTx1, deletedLinkIDs, deleteLatch);
 
         doReturn(mockTx1).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(DELETE, invNodeID, false);
-        nodeChangeListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeChangeListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForSubmit(submitLatch1);
 
@@ -144,7 +142,7 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
         doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(DELETE, invNodeID, false);
-        nodeChangeListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeChangeListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForSubmit(submitLatch);
 
@@ -167,7 +165,7 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
         doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(WRITE, invNodeID, false);
-        nodeChangeListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        nodeChangeListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForSubmit(submitLatch);
 
index 7764242662a9d6566980cfba7db1c49116d02182..5e699cf79ca01ee5c8b4676b24ab9a9facf258cc 100644 (file)
@@ -34,7 +34,6 @@ import static org.opendaylight.openflowplugin.applications.topology.manager.Test
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.CountDownLatch;
@@ -113,7 +112,7 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         doReturn(mockTx1).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(DELETE, invNodeConnID, false);
-        terminationPointListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        terminationPointListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForSubmit(submitLatch1);
 
@@ -165,7 +164,7 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(DELETE, invNodeConnID, false);
-        terminationPointListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        terminationPointListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForSubmit(submitLatch);
 
@@ -190,7 +189,7 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(WRITE, invNodeConnID, true);
-        terminationPointListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        terminationPointListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForSubmit(submitLatch);
 
@@ -240,9 +239,9 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(WRITE, invNodeConnID, false);
-        when(dataTreeModification.getRootNode().getDataAfter())
+        when(dataTreeModification.getRootNode().dataAfter())
                 .thenReturn(provideFlowCapableNodeConnector(true, false));
-        terminationPointListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        terminationPointListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForDeletes(1, deleteLatch);
 
@@ -287,9 +286,9 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
 
         DataTreeModification dataTreeModification = setupDataTreeChange(WRITE, invNodeConnID, false);
-        when(dataTreeModification.getRootNode().getDataAfter())
+        when(dataTreeModification.getRootNode().dataAfter())
                 .thenReturn(provideFlowCapableNodeConnector(false, true));
-        terminationPointListener.onDataTreeChanged(Collections.singleton(dataTreeModification));
+        terminationPointListener.onDataTreeChanged(List.of(dataTreeModification));
 
         waitForDeletes(1, deleteLatch);
 
index 15fb4e7e81b8048e612aa97da7342db66ce36a50..367dec3d4789b24fb7fb4908534a0adac25996a0 100644 (file)
 
     <dependencies>
         <dependency>
-            <groupId>${project.groupId}.openflowjava</groupId>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-buffer</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin.openflowjava</groupId>
             <artifactId>openflow-protocol-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}.openflowjava</groupId>
+            <groupId>org.opendaylight.openflowplugin.openflowjava</groupId>
             <artifactId>openflow-protocol-spi</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}.openflowjava</groupId>
+            <groupId>org.opendaylight.openflowplugin.openflowjava</groupId>
             <artifactId>openflowjava-util</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
+            <groupId>org.opendaylight.openflowplugin</groupId>
             <artifactId>openflowjava-extension-nicira-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-buffer</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-common-netty</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 696afcc33996a1a2f5ee00454677f933fa462fe4..5d9f7496a9c4eedc88ab5af40094c3648d964379 100644 (file)
@@ -13,8 +13,8 @@ import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
@@ -77,8 +77,7 @@ public final class Test implements TestFlow, AutoCloseable {
 
     @Inject
     @Activate
-    public Test(@Reference final RpcConsumerRegistry rpcService,
-            @Reference final RpcProviderService rpcProviderService) {
+    public Test(@Reference final RpcService rpcService, @Reference final RpcProviderService rpcProviderService) {
         addFlow = rpcService.getRpc(AddFlow.class);
         reg = rpcProviderService.registerRpcImplementation(this);
     }
index fbbbd30d6f7d4bffe34bc64f6b6cb432cf36ac6c..f1a469b78d0683f2e66eb71a4bc8ac90f58387c5 100644 (file)
@@ -21,7 +21,7 @@
             <dependency>
                 <groupId>org.opendaylight.netconf</groupId>
                 <artifactId>netconf-artifacts</artifactId>
-                <version>6.0.6</version>
+                <version>7.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index ada7d8e21c967c910e872afedd14a19f240ee060..19c6f1dd1b00f6dc92ad0d19bac2f10e309049ea 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-openflowplugin-flow-services-rest">
     <feature name="odl-openflowplugin-flow-services-rest">
-        <feature version="[6,7)">odl-restconf</feature>
+        <feature version="[7,8)">odl-restconf</feature>
     </feature>
 </features>
index 43b83a29d596f80cd6d8e4aa5d824630fa8386a4..064356eb0acd71b774f0ddaa5eab8337e8c95bc4 100644 (file)
@@ -21,7 +21,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>12.0.4</version>
+                <version>13.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
@@ -30,7 +30,7 @@
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>8.0.4</version>
+                <version>9.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 08fba54e14a487782d9d8afbc801dcb8df7685b5..92b039a34dc664e75463cf6380d5f892caf70eb3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <features name="odl-openflowplugin-nsf-model-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
     <feature name="odl-openflowplugin-nsf-model" version="${project.version}">
-        <feature version="[12,13)">odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal</feature>
-        <feature version="[12,13)">odl-mdsal-model-odl-l2-types</feature>
+        <feature version="[13,14)">odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal</feature>
+        <feature version="[13,14)">odl-mdsal-model-odl-l2-types</feature>
     </feature>
 </features>
index cd2f9dbd3d7fe4e1c08f11f36294e1dbdf29966b..b80a764981b77d84f7c580923c783118838065ce 100644 (file)
@@ -29,7 +29,7 @@
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>8.0.4</version>
+                <version>9.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index d09aad69054ef62aa1a449ca92f1d0d63c4c367e..25fde05857ff63269b46923a4d2f459e7aed7388 100644 (file)
@@ -2,7 +2,7 @@
 <features name="openflowplugin-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
     <feature name="odl-openflowplugin-southbound" version="${project.version}">
         <configfile finalname="etc/org.opendaylight.openflowplugin.cfg">mvn:org.opendaylight.openflowplugin/openflowplugin-blueprint-config/${project.version}/cfg/config</configfile>
-        <feature version="[8,9)">odl-mdsal-broker</feature>
+        <feature version="[9,10)">odl-mdsal-broker</feature>
         <feature version="[6,7)">odl-infrautils-diagstatus</feature>
     </feature>
 </features>
index 45bc304fcda8a31f7573d87f206ab6103beb4d03..84e5abfe3d4500669afefe46c8947c87967f709a 100644 (file)
@@ -42,7 +42,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>11.0.5</version>
+                <version>13.0.1</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
@@ -51,7 +51,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>12.0.4</version>
+                <version>13.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 687ffb891c173a8678823ccc5a0f3c49d0923e32..fdd305b8121450135a2141f8c73677fd558132d5 100644 (file)
@@ -4,8 +4,8 @@
     <feature name='odl-openflowjava-protocol' version='${project.version}'>
         <configfile finalname="etc/opendaylight/datastore/initial/config/default-openflow-connection-config.xml">mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/config</configfile>
         <configfile finalname="etc/opendaylight/datastore/initial/config/legacy-openflow-connection-config.xml">mvn:org.opendaylight.openflowplugin.openflowjava/openflowjava-blueprint-config/${project.version}/xml/legacyConfig</configfile>
-        <feature version="[11,12)">odl-yangtools-netty</feature>
-        <feature version="[12,13)">odl-mdsal-model-rfc6991</feature>
+        <feature version="[13,14)">odl-yangtools-netty</feature>
+        <feature version="[13,14)">odl-mdsal-model-rfc6991</feature>
         <feature version="[6,7)">odl-infrautils-diagstatus</feature>
     </feature>
 </features>
index b31b0725fcf18b21a91dd1b2671e0846777b084b..ae32af498571812fa614700ff934fb4fbcea038c 100644 (file)
@@ -27,7 +27,7 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>mdsal-singleton-common-api</artifactId>
+            <artifactId>mdsal-singleton-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
index 855114d948e3a0a3e0ab5c20c32eb4f353cd2357..bc770d2db50e2db19c4961d81bfea837d16dc762 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.api.openflow;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonService;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher;
 
@@ -30,4 +30,4 @@ public interface OFPContext extends AutoCloseable, ClusterSingletonService {
 
     @Override
     void close();
-}
\ No newline at end of file
+}
index f9a59868a184bdb4ea21c2a19cca45f9c6040dcf..c2def9e68db785e074f09c1eda4361184c92a139 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.openflowplugin.api.openflow.device;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
index d48af6f5057a5ef2beff5dfd60a4e1f2a424496f..1955a4e5e728e720ec2f9818c903b3af30a64e35 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.api.openflow.OFPContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceRemovedHandler;
@@ -79,4 +79,4 @@ public interface ContextChain extends ClusterSingletonService, AutoCloseable, Re
      * @param deviceRemovedHandler device removed handler
      */
     void registerDeviceRemovedHandler(@NonNull DeviceRemovedHandler deviceRemovedHandler);
-}
\ No newline at end of file
+}
index ba3fcda84f15a58a8e6cd1994f211607fd286aa1..1e45dee0f101ab2ed9ed327acef3ebc6fc5effef 100755 (executable)
@@ -9,6 +9,7 @@ package org.opendaylight.openflowplugin.common.txchain;
 
 import static java.util.Objects.requireNonNull;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.FutureCallback;
@@ -24,28 +25,26 @@ import org.checkerframework.checker.lock.qual.GuardedBy;
 import org.checkerframework.checker.lock.qual.Holding;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
-import org.opendaylight.mdsal.binding.api.Transaction;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
 import org.opendaylight.mdsal.binding.api.TransactionChainClosedException;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Empty;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * The openflowplugin-impl.org.opendaylight.openflowplugin.impl.device
- * package protected class for controlling {@link WriteTransaction} life cycle. It is
- * a {@link TransactionChainListener} and provide package protected methods for writeToTransaction
+ * package protected class for controlling {@link WriteTransaction} life cycle. It listens on chains and provides
+ * package-protected methods for writeToTransaction
  * method (wrapped {@link WriteTransaction#put(LogicalDatastoreType, InstanceIdentifier, DataObject)})
  * and submitTransaction method (wrapped {@link WriteTransaction#commit()}).
  */
-public class TransactionChainManager implements TransactionChainListener, AutoCloseable {
-
+public class TransactionChainManager implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(TransactionChainManager.class);
     private static final String CANNOT_WRITE_INTO_TRANSACTION = "Cannot write into transaction.";
 
@@ -74,11 +73,23 @@ public class TransactionChainManager implements TransactionChainListener, AutoCl
 
     @Holding("txLock")
     private void createTxChain() {
-        TransactionChain txChainFactoryTemp = transactionChain;
-        transactionChain = dataBroker.createTransactionChain(TransactionChainManager.this);
-        if (txChainFactoryTemp != null) {
-            txChainFactoryTemp.close();
+        final var prev = transactionChain;
+        final var next = dataBroker.createTransactionChain();
+        transactionChain = next;
+        if (prev != null) {
+            prev.close();
         }
+        next.addCallback(new FutureCallback<Empty>() {
+            @Override
+            public void onSuccess(final Empty result) {
+                // No-op
+            }
+
+            @Override
+            public void onFailure(final Throwable cause) {
+                onTransactionChainFailed(next, cause);
+            }
+        });
     }
 
     public boolean initialSubmitWriteTransaction() {
@@ -87,21 +98,16 @@ public class TransactionChainManager implements TransactionChainListener, AutoCl
     }
 
     /**
-     * Method change status for TxChainManager to WORKING and it has to make
-     * registration for this class instance as {@link TransactionChainListener} to provide possibility a make DS
-     * transactions. Call this method for MASTER role only.
+     * Method change status for TxChainManager to WORKING and it has to make registration for this instance as
+     * a {@link TransactionChain} callback to provide possibility a make DS transactions. Call this method for MASTER
+     * role only.
      */
     public void activateTransactionManager() {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("activateTransactionManager for node {} transaction submit is set to {}",
-                    nodeId, submitIsEnabled);
-        }
+        LOG.debug("activateTransactionManager for node {} transaction submit is set to {}", nodeId, submitIsEnabled);
         synchronized (txLock) {
             if (TransactionChainManagerStatus.SLEEPING == transactionChainManagerStatus) {
-                Preconditions.checkState(transactionChain == null,
-                        "TxChainFactory survive last close.");
-                Preconditions.checkState(writeTx == null,
-                        "We have some unexpected WriteTransaction.");
+                Preconditions.checkState(transactionChain == null, "TxChainFactory survive last close.");
+                Preconditions.checkState(writeTx == null, "We have some unexpected WriteTransaction.");
                 transactionChainManagerStatus = TransactionChainManagerStatus.WORKING;
                 submitIsEnabled = false;
                 initCommit = true;
@@ -111,22 +117,19 @@ public class TransactionChainManager implements TransactionChainListener, AutoCl
     }
 
     /**
-     * Method change status for TxChainManger to SLEEPING and it unregisters
-     * this class instance as {@link TransactionChainListener} so it broke a possibility to write something to DS.
-     * Call this method for SLAVE only.
-     * @return Future
+     * Method change status for TxChainManger to SLEEPING and it unregisters this instance so it broke a possibility to
+     * write something to DS. Call this method for SLAVE only.
+     *
+     * @return Future competing when deactivation completes
      */
     public FluentFuture<?> deactivateTransactionManager() {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("deactivateTransactionManager for node {}", nodeId);
-        }
+        LOG.debug("deactivateTransactionManager for node {}", nodeId);
         final FluentFuture<? extends CommitInfo> future;
         synchronized (txLock) {
             if (TransactionChainManagerStatus.WORKING == transactionChainManagerStatus) {
                 transactionChainManagerStatus = TransactionChainManagerStatus.SLEEPING;
-                future =  txChainShuttingDown();
-                Preconditions.checkState(writeTx == null,
-                        "We have some unexpected WriteTransaction.");
+                future = txChainShuttingDown();
+                Preconditions.checkState(writeTx == null, "We have some unexpected WriteTransaction.");
                 future.addCallback(new FutureCallback<CommitInfo>() {
                     @Override
                     public void onSuccess(final CommitInfo result) {
@@ -280,9 +283,8 @@ public class TransactionChainManager implements TransactionChainListener, AutoCl
         }
     }
 
-    @Override
-    public void onTransactionChainFailed(final TransactionChain chain,
-                                         final Transaction transaction, final Throwable cause) {
+    @VisibleForTesting
+    void onTransactionChainFailed(final TransactionChain chain, final Throwable cause) {
         synchronized (txLock) {
             if (TransactionChainManagerStatus.WORKING == transactionChainManagerStatus
                     && chain.equals(transactionChain)) {
@@ -294,11 +296,6 @@ public class TransactionChainManager implements TransactionChainListener, AutoCl
         }
     }
 
-    @Override
-    public void onTransactionChainSuccessful(final TransactionChain chain) {
-        // NOOP
-    }
-
     @Holding("txLock")
     private void ensureTransaction() {
         if (writeTx == null && TransactionChainManagerStatus.WORKING == transactionChainManagerStatus
index 776813c9a21524d6e4799bec1ae03005d66ea2e8..efc63e65eadcbe3032af75e0682f6b4fbacab1b6 100644 (file)
@@ -7,22 +7,23 @@
  */
 package org.opendaylight.openflowplugin.common.txchain;
 
-import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.util.concurrent.ExecutionException;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
-import org.opendaylight.mdsal.binding.api.Transaction;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -34,9 +35,8 @@ import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.StrictStubs.class)
 public class TransactionChainManagerTest {
-
     @Mock
     private DataBroker dataBroker;
     @Mock
@@ -55,31 +55,25 @@ public class TransactionChainManagerTest {
 
     @Before
     public void setUp() {
-        final ReadTransaction readOnlyTx = Mockito.mock(ReadTransaction.class);
-        Mockito.when(dataBroker.createTransactionChain(any(TransactionChainListener.class)))
-                .thenReturn(txChain);
+        final ReadTransaction readOnlyTx = mock(ReadTransaction.class);
+        when(dataBroker.createTransactionChain()).thenReturn(txChain);
         nodeId = new NodeId("h2g2:42");
         nodeKeyIdent = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId));
         txChainManager = new TransactionChainManager(dataBroker, nodeId.getValue());
-        Mockito.when(txChain.newReadWriteTransaction()).thenReturn(writeTx);
+        when(txChain.newReadWriteTransaction()).thenReturn(writeTx);
 
         path = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-        Mockito.doReturn(CommitInfo.emptyFluentFuture()).when(writeTx).commit();
+        doReturn(CommitInfo.emptyFluentFuture()).when(writeTx).commit();
         txChainManager.activateTransactionManager();
     }
 
-    @After
-    public void tearDown() {
-        Mockito.verifyNoMoreInteractions(txChain, writeTx);
-    }
-
     @Test
     public void testWriteToTransaction() {
         final Node data = new NodeBuilder().setId(nodeId).build();
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
     }
 
     /**
@@ -92,9 +86,9 @@ public class TransactionChainManagerTest {
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
         txChainManager.submitTransaction();
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
-        Mockito.verify(writeTx).commit();
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(writeTx).commit();
     }
 
     /**
@@ -106,23 +100,23 @@ public class TransactionChainManagerTest {
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
         txChainManager.submitTransaction();
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
-        Mockito.verify(writeTx, Mockito.never()).commit();
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(writeTx, never()).commit();
     }
 
     @Test
     public void testSubmitTransactionFailed() {
-        Mockito.doReturn(FluentFutures.immediateFailedFluentFuture(new ExecutionException(new Throwable("mock"))))
+        doReturn(FluentFutures.immediateFailedFluentFuture(new ExecutionException(new Throwable("mock"))))
             .when(writeTx).commit();
         final Node data = new NodeBuilder().setId(nodeId).build();
         txChainManager.initialSubmitWriteTransaction();
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
         txChainManager.submitTransaction();
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
-        Mockito.verify(writeTx).commit();
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(writeTx).commit();
     }
 
     /**
@@ -134,39 +128,31 @@ public class TransactionChainManagerTest {
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx, Mockito.times(2)).put(LogicalDatastoreType.CONFIGURATION, path, data);
-        Mockito.verify(writeTx, Mockito.never()).commit();
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx, times(2)).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(writeTx, never()).commit();
     }
 
     @Test
     public void testOnTransactionChainFailed() {
-        txChainManager.onTransactionChainFailed(txChain, Mockito.mock(Transaction.class),
-            Mockito.mock(Throwable.class));
-        Mockito.verify(txChain).close();
-        Mockito.verify(dataBroker, Mockito.times(2)).createTransactionChain(txChainManager);
-    }
-
-    @Test
-    public void testOnTransactionChainSuccessful() {
-        txChainManager.onTransactionChainSuccessful(transactionChain);
-        // NOOP
-        Mockito.verifyNoInteractions(transactionChain);
+        txChainManager.onTransactionChainFailed(txChain, mock(Throwable.class));
+        verify(txChain).close();
+        verify(dataBroker, times(2)).createTransactionChain();
     }
 
     @Test
     public void testAddDeleteOperationTotTxChain() {
         txChainManager.addDeleteOperationToTxChain(LogicalDatastoreType.CONFIGURATION, path);
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).delete(LogicalDatastoreType.CONFIGURATION, path);
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).delete(LogicalDatastoreType.CONFIGURATION, path);
     }
 
     @Test
     public void testDeactivateTransactionChainManager() {
         txChainManager.deactivateTransactionManager();
 
-        Mockito.verify(txChain).close();
+        verify(txChain).close();
     }
 
     @Test
@@ -176,11 +162,11 @@ public class TransactionChainManagerTest {
 
         txChainManager.deactivateTransactionManager();
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
-        Mockito.verify(writeTx, Mockito.never()).commit();
-        Mockito.verify(writeTx).cancel();
-        Mockito.verify(txChain).close();
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(writeTx, never()).commit();
+        verify(writeTx).cancel();
+        verify(txChain).close();
     }
 
     @Test
@@ -190,15 +176,15 @@ public class TransactionChainManagerTest {
         txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
         txChainManager.shuttingDown();
 
-        Mockito.verify(txChain).newReadWriteTransaction();
-        Mockito.verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
-        Mockito.verify(writeTx).commit();
+        verify(txChain).newReadWriteTransaction();
+        verify(writeTx).put(LogicalDatastoreType.CONFIGURATION, path, data);
+        verify(writeTx).commit();
     }
 
     @Test
     public void testClose() {
         txChainManager.shuttingDown();
         txChainManager.close();
-        Mockito.verify(txChain).close();
+        verify(txChain).close();
     }
 }
index d3baa88ed8ee1713da2cd48f61114fbfb8f4a65e..e6e30a0bc32c7649aee27d5ad158dfbe2375ab5a 100644 (file)
@@ -7,9 +7,11 @@
  */
 package org.opendaylight.openflowplugin.impl;
 
+import static java.util.Objects.requireNonNull;
+
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.TransactionChain;
-import org.opendaylight.mdsal.binding.api.TransactionChainListener;
 import org.opendaylight.mdsal.binding.spi.ForwardingDataBroker;
 
 /**
@@ -20,11 +22,10 @@ import org.opendaylight.mdsal.binding.spi.ForwardingDataBroker;
  */
 // FIXME: this should not be necessary
 public class ForwardingPingPongDataBroker extends ForwardingDataBroker implements PingPongDataBroker {
+    private final @NonNull DataBroker delegate;
 
-    private final DataBroker delegate;
-
-    public ForwardingPingPongDataBroker(DataBroker delegate) {
-        this.delegate = delegate;
+    public ForwardingPingPongDataBroker(final DataBroker delegate) {
+        this.delegate = requireNonNull(delegate);
     }
 
     @Override
@@ -33,7 +34,7 @@ public class ForwardingPingPongDataBroker extends ForwardingDataBroker implement
     }
 
     @Override
-    public TransactionChain createTransactionChain(final TransactionChainListener listener) {
-        return delegate().createMergingTransactionChain(listener);
+    public TransactionChain createTransactionChain() {
+        return delegate().createMergingTransactionChain();
     }
 }
index 6890f037821ce374f1fce07547f2fc2e8c6336d1..f5b4afd14b7c14f3d2aa1609cd16e8d0dff28699 100644 (file)
@@ -44,7 +44,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList;
 import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories;
index e4834f2ad869ef37b697057f41ff80c64d9250a6..439aa10cc4f600c30ef54c847ca9d4eaece22af7 100644 (file)
@@ -13,7 +13,7 @@ import static java.util.Objects.requireNonNullElse;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
 import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueHandlerRegistration;
@@ -313,7 +313,7 @@ public class ConnectionContextImpl implements ConnectionContext {
             this.version = requireNonNull(version);
             this.datapathId = datapathId;
             this.outboundQueueProvider = outboundQueueProvider;
-            serviceGroupIdentifier = ServiceGroupIdentifier.create(this.nodeId.getValue());
+            serviceGroupIdentifier = new ServiceGroupIdentifier(this.nodeId.getValue());
         }
 
         @Override
index 3810f3e08fec5a5a781636cf8348a677d88d68b7..d08c1254729c0d82a90801ca44c0ecfd9a70592b 100644 (file)
@@ -14,16 +14,16 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import java.math.BigInteger;
 import java.net.InetAddress;
 import java.time.LocalDateTime;
-import java.util.Collection;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
@@ -47,7 +47,7 @@ import org.opendaylight.openflowplugin.impl.connection.listener.SystemNotificati
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -160,19 +160,17 @@ public class ConnectionManagerImpl implements ConnectionManager {
         }
     }
 
-    class DeviceConnectionStatusProviderImpl implements DeviceConnectionStatusProvider,
-            ClusteredDataTreeChangeListener<Node> {
+    class DeviceConnectionStatusProviderImpl implements DeviceConnectionStatusProvider, DataTreeChangeListener<Node> {
         private final Map<BigInteger, LocalDateTime> deviceConnectionMap = new ConcurrentHashMap<>();
 
-        private ListenerRegistration<DeviceConnectionStatusProviderImpl> listenerRegistration;
+        private Registration listenerRegistration;
 
         @Override
         @SuppressWarnings({"checkstyle:IllegalCatch"})
         public void init() {
-            DataTreeIdentifier<Node> treeId = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
-                    getWildCardPath());
+            final var treeId = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, getWildCardPath());
             try {
-                listenerRegistration = dataBroker.registerDataTreeChangeListener(treeId, this);
+                listenerRegistration = dataBroker.registerTreeChangeListener(treeId, this);
             } catch (Exception e) {
                 LOG.error("DeviceConnectionStatusProvider listener registration failed", e);
             }
@@ -194,7 +192,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
         }
 
         @Override
-        public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<Node>> changes) {
+        public void onDataTreeChanged(final List<DataTreeModification<Node>> changes) {
             requireNonNull(changes, "Changes must not be null!");
             for (DataTreeModification<Node> change : changes) {
                 final DataObjectModification<Node> mod = change.getRootNode();
index fe4d4a482ad651904ffc761bdbebed79e486de51..5b99babd30330a0a9c87e94526d93e3c5044fe92 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowplugin.api.OFConstants;
index 4e3deb372cc8ae2a37724deb1db75282148e67e0..a0606243b9affe40b7726ad437581cab7d4bdcdb 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.impl.lifecycle;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -31,11 +30,10 @@ import java.util.concurrent.TimeoutException;
 import java.util.stream.Collectors;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange;
-import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListenerRegistration;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
 import org.opendaylight.mdsal.eos.common.api.EntityOwnershipState;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.api.openflow.OFPManager;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionStatus;
@@ -61,6 +59,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.core.general.entity.rev150930.Entity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.rf.state.rev170713.ResultState;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
@@ -77,7 +76,7 @@ public final class ContextChainHolderImpl implements ContextChainHolder, MasterC
     private static final String SEPARATOR = ":";
     private final ConcurrentMap<DeviceInfo, ContextChain> contextChainMap = new ConcurrentHashMap<>();
     private final ConcurrentMap<DeviceInfo, ? super ConnectionContext> connectingDevices = new ConcurrentHashMap<>();
-    private final EntityOwnershipListenerRegistration eosListenerRegistration;
+    private final Registration eosListenerRegistration;
     private final ClusterSingletonServiceProvider singletonServiceProvider;
     private final Executor executor;
     private final OwnershipChangeListener ownershipChangeListener;
@@ -304,24 +303,21 @@ public final class ContextChainHolderImpl implements ContextChainHolder, MasterC
 
     @Override
     @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
-    public void ownershipChanged(final EntityOwnershipChange entityOwnershipChange) {
-        LOG.info("Entity ownership change received for node : {}", entityOwnershipChange);
-        if (entityOwnershipChange.inJeopardy()) {
-            LOG.warn("Controller is in Jeopardy, ignore ownership change notification. {}", entityOwnershipChange);
+    public void ownershipChanged(final org.opendaylight.mdsal.eos.binding.api.Entity entity,
+            final EntityOwnershipStateChange change, final boolean inJeopardy) {
+        LOG.info("Entity ownership change received for node : {}", change);
+        if (inJeopardy) {
+            LOG.warn("Controller is in Jeopardy, ignore ownership change notification. {}", change);
             return;
         }
-        if (entityOwnershipChange.getState().hasOwner()) {
+        if (change.hasOwner()) {
             return;
         }
 
         // Findbugs flags a false violation for "Unchecked/unconfirmed cast" from GenericEntity to Entity hence the
         // suppression above. The suppression is temporary until EntityOwnershipChange is modified to eliminate the
         // violation.
-        final String entityName = entityOwnershipChange
-                .getEntity()
-                .getIdentifier()
-                .firstKeyOf(Entity.class)
-                .getName();
+        final String entityName = entity.getIdentifier().firstKeyOf(Entity.class).getName();
 
         if (entityName != null && entityName.startsWith("openflow:")) {
             if (nodeCleanerExecutor.isShutdown()) {
@@ -340,8 +336,7 @@ public final class ContextChainHolderImpl implements ContextChainHolder, MasterC
                                 DeviceStateUtil.createNodeInstanceIdentifier(new NodeId(entityName));
                         deviceManager.sendNodeRemovedNotification(nodeInstanceIdentifier);
                         LOG.info("Try to remove device {} from operational DS", entityName);
-                        ListenableFuture<?> future =
-                                deviceManager.removeDeviceFromOperationalDS(nodeInstanceIdentifier);
+                        final var future = deviceManager.removeDeviceFromOperationalDS(nodeInstanceIdentifier);
                         Futures.addCallback(future, new FutureCallback<Object>() {
                             @Override
                             public void onSuccess(final Object result) {
index c106d758713868abc5c8d444d0c8f3d238da961d..06b274527d5d80cba0071ae6fd838d77e6b8c0ad 100644 (file)
@@ -19,8 +19,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.OFPContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
index 2dc60069ab0a6c48ed4182060428746050b7dc67..27547172284b40992d7602f3475328a596d7ec62 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.Service;
 import java.util.function.Function;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.OFPContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher;
index 18f3c88b90c16d03782c07c839cfa6722d468541..0ac594b1ce51a489da1f3a52c833273a40dd0e9d 100644 (file)
@@ -20,7 +20,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
@@ -77,6 +77,7 @@ public class RoleContextImpl implements RoleContext {
         return deviceInfo;
     }
 
+    @Override
     public void setRoleRpc(final SetRole setRole) {
         setRoleRpc = setRole;
     }
index bb529cc536b03814b8b5ac89d88997ceae604747..65ba225a4f881d1673e965d23bf42e322d8068bf 100644 (file)
@@ -16,7 +16,7 @@ import java.util.concurrent.atomic.AtomicLong;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
index a4db6d1387b444c030cbb4ec5bec245289398d6f..66fa2f65469ca56f69a4483d1577bb63ab8f70fe 100644 (file)
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.TransactionChainClosedException;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.ConnectionException;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -82,14 +82,14 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext, De
                           final boolean isStatisticsPollingOn,
                           final boolean isUsingReconciliationFramework) {
         this.deviceContext = deviceContext;
-        this.devState = requireNonNull(deviceContext.getDeviceState());
+        devState = requireNonNull(deviceContext.getDeviceState());
         this.executorService = executorService;
         this.isStatisticsPollingOn = isStatisticsPollingOn;
         this.config = config;
         this.convertorExecutor = convertorExecutor;
-        this.deviceInfo = deviceContext.getDeviceInfo();
-        this.statisticsPollingInterval = config.getBasicTimerDelay().getValue().toJava();
-        this.maximumPollingDelay = config.getMaximumTimerDelay().getValue().toJava();
+        deviceInfo = deviceContext.getDeviceInfo();
+        statisticsPollingInterval = config.getBasicTimerDelay().getValue().toJava();
+        maximumPollingDelay = config.getMaximumTimerDelay().getValue().toJava();
         this.statisticsWriterProvider = statisticsWriterProvider;
         this.isUsingReconciliationFramework = isUsingReconciliationFramework;
 
@@ -101,7 +101,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext, De
 
     @Override
     public DeviceInfo getDeviceInfo() {
-        return this.deviceInfo;
+        return deviceInfo;
     }
 
     @NonNull
@@ -112,7 +112,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext, De
 
     @Override
     public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) {
-        this.contextChainMastershipWatcher = newWatcher;
+        contextChainMastershipWatcher = newWatcher;
     }
 
     @Override
@@ -130,12 +130,12 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext, De
 
     @Override
     public void enableGathering() {
-        this.schedulingEnabled.set(true);
+        schedulingEnabled.set(true);
     }
 
     @Override
     public void disableGathering() {
-        this.schedulingEnabled.set(false);
+        schedulingEnabled.set(false);
     }
 
     @Override
@@ -217,7 +217,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext, De
             return Futures.immediateFuture(Boolean.TRUE);
         }
 
-        return this.lastDataGatheringRef.updateAndGet(future -> {
+        return lastDataGatheringRef.updateAndGet(future -> {
             // write start timestamp to state snapshot container
             StatisticsGatheringUtils.markDeviceStateSnapshotStart(deviceInfo, deviceContext);
 
@@ -291,7 +291,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext, De
 
         schedulingEnabled.set(true);
         statisticsPollingService.startAsync();
-        this.statisticsPollingServiceRef.set(statisticsPollingService);
+        statisticsPollingServiceRef.set(statisticsPollingService);
     }
 
     private ListenableFuture<Void> stopGatheringData() {
index 62c14b9190128a6ed846f7c7eadac28351a50347..1bdc1025f5dca2921868725ef0a755650e292e4b 100644 (file)
@@ -14,7 +14,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import org.apache.commons.lang3.tuple.MutablePair;
 import org.apache.commons.lang3.tuple.Pair;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInputBuilder;
@@ -64,7 +63,7 @@ public final class BarrierUtil {
      * Creates barrier input.
      *
      * @param nodeRef rpc routing context
-     * @return input for {@link FlowCapableTransactionService#sendBarrier(SendBarrierInput)}
+     * @return input for {@link SendBarrier#invoke(SendBarrierInput)}
      */
     @VisibleForTesting
     static SendBarrierInput createSendBarrierInput(final NodeRef nodeRef) {
index 94c1a25a48669f596ac9f1f5d3f8f8e11bc8f598..24e9cde4031bec80f1220e5b76e9d71d9fcd9877 100644 (file)
@@ -63,7 +63,7 @@
   <reference id="notificationPublishService"
              interface="org.opendaylight.mdsal.binding.api.NotificationPublishService"/>
   <reference id="clusterSingletonServiceProvider"
-             interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
+             interface="org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider"/>
   <reference id="entityOwnershipService"
              interface="org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService"/>
   <reference id="diagStatusProvider"
@@ -72,6 +72,4 @@
              interface="org.opendaylight.infrautils.ready.SystemReadyMonitor"/>
   <reference id="mastershipChangeServiceManager"
              interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager"/>
-
-  <odl:action-provider interface="org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService"/>
 </blueprint>
index dda1d864f0f79b388e2cf8d70226e463f7a9135f..0bef9563a1d61268365d7630fc40fca60a317008 100644 (file)
@@ -25,14 +25,14 @@ import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListenerRegistration;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList;
 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationProperty;
 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
 import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
@@ -61,7 +61,7 @@ public class OpenFlowPluginProviderImplTest {
     EntityOwnershipService entityOwnershipService;
 
     @Mock
-    EntityOwnershipListenerRegistration entityOwnershipListenerRegistration;
+    Registration entityOwnershipListenerRegistration;
 
     @Mock
     SwitchConnectionProvider switchConnectionProvider;
index 8d36ae82bacf2a8a3b5cd53f0f3c9aee1a9c5e86..0eccae74682fde5657b439c236ff5ef7accc3182 100644 (file)
@@ -59,7 +59,6 @@ import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKe
 import org.opendaylight.openflowplugin.api.openflow.registry.group.DeviceGroupRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.meter.DeviceMeterRegistry;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
-import org.opendaylight.openflowplugin.common.txchain.TransactionChainManager;
 import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
 import org.opendaylight.openflowplugin.impl.device.initialization.AbstractDeviceInitializer;
@@ -194,8 +193,7 @@ public class DeviceContextImplTest {
         Mockito.lenient().when(readTx.read(LogicalDatastoreType.OPERATIONAL, nodeKeyIdent))
                 .thenReturn(noExistNodeFuture);
         Mockito.when(dataBroker.newReadOnlyTransaction()).thenReturn(readTx);
-        Mockito.when(dataBroker.createTransactionChain(any(TransactionChainManager.class)))
-                .thenReturn(txChainFactory);
+        Mockito.when(dataBroker.createTransactionChain()).thenReturn(txChainFactory);
         Mockito.when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeKeyIdent);
         Mockito.when(deviceInfo.getNodeId()).thenReturn(nodeId);
         Mockito.when(deviceInfo.getDatapathId()).thenReturn(Uint64.ONE);
index 914c94790985150793193b834fa1721a626ed913..a4b80f653e71f5fbcde8bc3bd32d1ff5fd62b322 100644 (file)
@@ -17,12 +17,9 @@ import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.mdsal.eos.binding.api.Entity;
-import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange;
-import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListenerRegistration;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
-import org.opendaylight.mdsal.eos.common.api.EntityOwnershipChangeState;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
+import org.opendaylight.mdsal.eos.common.api.EntityOwnershipStateChange;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionStatus;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -43,6 +40,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.rf.state.rev170713.ResultState;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
@@ -78,11 +76,11 @@ public class ContextChainHolderImplTest {
     @Mock
     private ExecutorService executorService;
     @Mock
-    private ClusterSingletonServiceRegistration clusterSingletonServiceRegistration;
+    private Registration clusterSingletonServiceRegistration;
     @Mock
     private EntityOwnershipService entityOwnershipService;
     @Mock
-    private EntityOwnershipListenerRegistration entityOwnershipListenerRegistration;
+    private Registration entityOwnershipListenerRegistration;
     @Mock
     private ReconciliationFrameworkEvent reconciliationFrameworkEvent;
     @Mock
@@ -262,11 +260,8 @@ public class ContextChainHolderImplTest {
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.RPC_REGISTRATION);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.MASTER_ON_DEVICE);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_SUBMIT);
-        EntityOwnershipChange ownershipChange = new EntityOwnershipChange(
-                new Entity(ENTITY_TEST, OPENFLOW_TEST),
-                EntityOwnershipChangeState.LOCAL_OWNERSHIP_LOST_NO_OWNER
-        );
-        contextChainHolder.ownershipChanged(ownershipChange);
+        contextChainHolder.ownershipChanged(new Entity(ENTITY_TEST, OPENFLOW_TEST),
+            EntityOwnershipStateChange.LOCAL_OWNERSHIP_LOST_NO_OWNER, false);
         Mockito.verify(deviceManager, Mockito.timeout(1000)).removeDeviceFromOperationalDS(Mockito.any());
     }
 
@@ -277,11 +272,8 @@ public class ContextChainHolderImplTest {
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.RPC_REGISTRATION);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.MASTER_ON_DEVICE);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_SUBMIT);
-        EntityOwnershipChange ownershipChange = new EntityOwnershipChange(
-                new Entity(ENTITY_TEST, OPENFLOW_TEST),
-                EntityOwnershipChangeState.LOCAL_OWNERSHIP_LOST_NEW_OWNER
-        );
-        contextChainHolder.ownershipChanged(ownershipChange);
+        contextChainHolder.ownershipChanged(new Entity(ENTITY_TEST, OPENFLOW_TEST),
+            EntityOwnershipStateChange.LOCAL_OWNERSHIP_LOST_NEW_OWNER, false);
         Mockito.verify(deviceManager,Mockito.never()).removeDeviceFromOperationalDS(Mockito.any());
     }
 }
index 4a9ec9a9f9641902973caf90e9000456fe9b253c..a279272080bb2e472e0228af9fdbb72b3cd353bf 100644 (file)
@@ -16,9 +16,8 @@ import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
-import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
+import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
@@ -27,12 +26,12 @@ import org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChain;
 import org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher;
 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext;
+import org.opendaylight.yangtools.concepts.Registration;
 
 @RunWith(MockitoJUnitRunner.class)
 public class ContextChainImplTest {
-
     private static final String TEST_NODE = "test node";
-    private static final ServiceGroupIdentifier SERVICE_GROUP_IDENTIFIER = ServiceGroupIdentifier.create(TEST_NODE);
+    private static final ServiceGroupIdentifier SERVICE_GROUP_IDENTIFIER = new ServiceGroupIdentifier(TEST_NODE);
 
     @Mock
     private StatisticsContext statisticsContext;
@@ -47,7 +46,7 @@ public class ContextChainImplTest {
     @Mock
     private ClusterSingletonServiceProvider clusterSingletonServiceProvider;
     @Mock
-    private ClusterSingletonServiceRegistration clusterSingletonServiceRegistration;
+    private Registration clusterSingletonServiceRegistration;
     @Mock
     private ContextChainMastershipWatcher contextChainMastershipWatcher;
     @Mock
index 701a9c00fa76658ed6522c4b12fb382c9f8f1a96..796ce7da595a0d12cbf5335acdc792356514efcf 100644 (file)
@@ -38,11 +38,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.Rpc;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
@@ -59,7 +58,7 @@ public class RpcContextImplTest {
     @Mock
     private ConnectionContext connectionContext;
     @Mock
-    private ObjectRegistration<RpcService> registration;
+    private Registration registration;
     @Mock
     private NotificationPublishService notificationPublishService;
     @Mock
index a11138fc2d89103fd86350fe053e164cf198a87b..7eee31f4c9a58d34d3989ca25103b086ab4ae2f0 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor;
 
-import static com.google.common.base.Preconditions.checkArgument;
-
 import com.google.common.collect.Iterables;
 import java.util.Collection;
 import java.util.Collections;
@@ -31,8 +29,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.binding.DataObjectStep;
+import org.opendaylight.yangtools.yang.binding.KeyStep;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
@@ -65,20 +63,21 @@ public class PacketOutConvertor extends Convertor<TransmitPacketInput, PacketOut
      * @return default empty meter mod input builder
      */
     public static PacketOutInput defaultResult(final Uint8 version) {
-        return new PacketOutInputBuilder()
-                .setVersion(version)
-                .build();
+        return new PacketOutInputBuilder().setVersion(version).build();
     }
 
-    private static PortNumber getPortNumber(final PathArgument pathArgument, final Uint8 ofVersion) {
-        checkArgument(pathArgument instanceof IdentifiableItem, "Unexpected path argument %s", pathArgument);
+    private static PortNumber getPortNumber(final DataObjectStep<?> step, final Uint8 ofVersion) {
+        if (!(step instanceof KeyStep<?, ?> keyStep)) {
+            throw new IllegalArgumentException("Unexpected path argument " + step);
+        }
 
         // FIXME VD P! find InstanceIdentifier helper
-        final Object key = ((IdentifiableItem<?, ?>) pathArgument).getKey();
-        checkArgument(key instanceof NodeConnectorKey, "Unexpected key %s", key);
-
-        return new PortNumber(InventoryDataServiceUtil.portNumberfromNodeConnectorId(OpenflowVersion.get(ofVersion),
-            ((NodeConnectorKey) key).getId()));
+        final var key = keyStep.key();
+        if (key instanceof NodeConnectorKey nodeConnectorKey) {
+            return new PortNumber(InventoryDataServiceUtil.portNumberfromNodeConnectorId(
+                OpenflowVersion.ofVersion(ofVersion), nodeConnectorKey.getId()));
+        }
+        throw new IllegalArgumentException("Unexpected key " + key);
     }
 
     @Override
@@ -92,7 +91,7 @@ public class PacketOutConvertor extends Convertor<TransmitPacketInput, PacketOut
         // Build Port ID from TransmitPacketInput.Ingress
         PortNumber inPortNr;
         Uint32 bufferId = OFConstants.OFP_NO_BUFFER;
-        Iterable<PathArgument> inArgs = null;
+        Iterable<DataObjectStep<?>> inArgs = null;
 
         if (source.getIngress() != null) {
             inArgs = source.getIngress().getValue().getPathArguments();
@@ -111,7 +110,7 @@ public class PacketOutConvertor extends Convertor<TransmitPacketInput, PacketOut
         }
 
         final PortNumber outPort;
-        final Iterable<PathArgument> outArgs = source.getEgress().getValue().getPathArguments();
+        final var outArgs = source.getEgress().getValue().getPathArguments();
         if (Iterables.size(outArgs) >= 3) {
             outPort = getPortNumber(Iterables.get(outArgs, 2), data.getVersion());
         } else {
index 43a2d141e01d34fe3809a7fc49552e27358ee926..c0ec87d43e924281140a47bcb1c8d7a2bc9f8539 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>12.0.4</version>
+        <version>13.0.0</version>
         <relativePath/>
     </parent>
 
@@ -41,7 +41,7 @@
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>8.0.4</version>
+                <version>9.0.0</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 939bc0cf0dfdf436b1445b02bab1d90b72f05d30..9d1687593a66a3b88e358fd8d5a659004fa7738f 100644 (file)
@@ -8,16 +8,14 @@
 package org.opendaylight.openflowplugin.learningswitch;
 
 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 
 /**
  * Holder for {@link DataTreeChangeListener} registration.
  */
 public interface DataTreeChangeListenerRegistrationHolder {
-
     /**
      * Returns the DataTreeChangeListenerRegistration.
      */
-    ListenerRegistration<DataTreeChangeListener> getDataTreeChangeListenerRegistration();
-
+    Registration getDataTreeChangeListenerRegistration();
 }
index d4d32234ef1e0aeb57142e04ed7d319ae3775d9a..34267507ff47d1fee326853c5ec1be11bad78e28 100644 (file)
@@ -8,10 +8,9 @@
 package org.opendaylight.openflowplugin.learningswitch;
 
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
@@ -19,7 +18,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacket;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
@@ -37,11 +35,11 @@ import org.slf4j.LoggerFactory;
 public final class LearningSwitchManagerSimpleImpl implements DataTreeChangeListenerRegistrationHolder, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerSimpleImpl.class);
 
-    private final ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration;
+    private final Registration dataTreeChangeListenerRegistration;
     private final Registration packetInRegistration;
 
     public LearningSwitchManagerSimpleImpl(final DataBroker dataBroker, final NotificationService notificationService,
-            final RpcConsumerRegistry rpcService) {
+            final RpcService rpcService) {
         LOG.debug("start() -->");
         final var dataStoreAccessor = new FlowCommitWrapperImpl(dataBroker);
 
@@ -49,7 +47,7 @@ public final class LearningSwitchManagerSimpleImpl implements DataTreeChangeList
             rpcService.getRpc(TransmitPacket.class), this);
         packetInRegistration = notificationService.registerListener(PacketReceived.class, learningSwitchHandler);
 
-        dataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.create(
+        dataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.of(
             LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
                 .child(Node.class)
                 .augmentation(FlowCapableNode.class)
@@ -67,7 +65,7 @@ public final class LearningSwitchManagerSimpleImpl implements DataTreeChangeList
     }
 
     @Override
-    public ListenerRegistration<DataTreeChangeListener> getDataTreeChangeListenerRegistration() {
+    public Registration getDataTreeChangeListenerRegistration() {
         return dataTreeChangeListenerRegistration;
     }
 }
index 2c0719a933031c40648480f66c08d3ce1d813768..55881618f59ca170b841c3abbc3e4fb852e14ff7 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.openflowplugin.learningswitch;
 
 import static java.util.Objects.requireNonNull;
 
-import java.util.Collection;
+import java.util.List;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
@@ -28,17 +28,17 @@ public class WakeupOnNode implements DataTreeChangeListener<Table> {
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<Table>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<Table>> modifications) {
         Uint8 requiredTableId = Uint8.ZERO;
         // TODO add flow
 
         for (var modification : modifications) {
-            if (modification.getRootNode().getModificationType() == ModificationType.SUBTREE_MODIFIED) {
-                var table = modification.getRootNode().getDataAfter();
+            if (modification.getRootNode().modificationType() == ModificationType.SUBTREE_MODIFIED) {
+                var table = modification.getRootNode().dataAfter();
                 if (table != null) {
                     LOG.trace("table: {}", table);
                     if (requiredTableId.equals(table.getId())) {
-                        learningSwitchHandler.onSwitchAppeared(modification.getRootPath().getRootIdentifier());
+                        learningSwitchHandler.onSwitchAppeared(modification.getRootPath().path());
                     }
                 }
             }
index dfac9825b5fd10f996693971f0884d8ab812d461..27334445161f295ec0319aa5c22fb5dac28df6e5 100644 (file)
@@ -11,10 +11,9 @@ import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.learningswitch.DataTreeChangeListenerRegistrationHolder;
 import org.opendaylight.openflowplugin.learningswitch.FlowCommitWrapperImpl;
@@ -25,7 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacket;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.service.component.annotations.Activate;
@@ -49,13 +47,13 @@ import org.slf4j.LoggerFactory;
 public final class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerRegistrationHolder, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerMultiImpl.class);
 
-    private final ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration;
+    private final Registration dataTreeChangeListenerRegistration;
     private final Registration packetInRegistration;
 
     @Inject
     @Activate
     public LearningSwitchManagerMultiImpl(@Reference final DataBroker dataBroker,
-            @Reference final NotificationService notificationService, @Reference final RpcConsumerRegistry rpcService) {
+            @Reference final NotificationService notificationService, @Reference final RpcService rpcService) {
         LOG.debug("start() -->");
         final var dataStoreAccessor = new FlowCommitWrapperImpl(dataBroker);
 
@@ -65,7 +63,7 @@ public final class LearningSwitchManagerMultiImpl implements DataTreeChangeListe
         packetInRegistration = notificationService.registerListener(PacketReceived.class, packetInDispatcher);
 
         dataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener(
-            DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
+            DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
                 .child(Node.class)
                 .augmentation(FlowCapableNode.class)
                 .child(Table.class)),
@@ -84,9 +82,9 @@ public final class LearningSwitchManagerMultiImpl implements DataTreeChangeListe
         LOG.debug("stop() <--");
     }
 
-
+    // FIXME: why?
     @Override
-    public ListenerRegistration<DataTreeChangeListener> getDataTreeChangeListenerRegistration() {
+    public Registration getDataTreeChangeListenerRegistration() {
         return dataTreeChangeListenerRegistration;
     }
 }
index c4dfc16926c38a51d674a36f8c4dea1debeb4be4..80da8efcbb24b0b6c4fe6d2e9f716adcea469a31 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.samples.sample.bundles;
 
-import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
@@ -22,7 +21,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder;
@@ -72,7 +71,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.on
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleControlType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint16;
@@ -101,12 +100,12 @@ public final class SampleFlowCapableNodeListener
 
     private final ControlBundle controlBundle;
     private final AddBundleMessages addBundleMessages;
-    private final ListenerRegistration<?> listenerReg;
+    private final Registration listenerReg;
 
     @Inject
     @Activate
     public SampleFlowCapableNodeListener(@Reference final DataBroker dataBroker,
-            @Reference final RpcConsumerRegistry rpcService) {
+            @Reference final RpcService rpcService) {
         controlBundle = rpcService.getRpc(ControlBundle.class);
         addBundleMessages = rpcService.getRpc(AddBundleMessages.class);
         LOG.debug("inSessionInitialized() passing");
@@ -128,7 +127,7 @@ public final class SampleFlowCapableNodeListener
     }
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<FlowCapableNode>> modifications) {
+    public void onDataTreeChanged(final List<DataTreeModification<FlowCapableNode>> modifications) {
         for (var modification : modifications) {
             if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {
                 LOG.info("Node connected:  {}",
index 95a56ab0b8c8beb7938289114bb298bbc429c122..d3a0693a0ed807fccf5d9e2781ec564ce748bf26 100644 (file)
@@ -12,7 +12,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import javax.inject.Inject;
 import javax.inject.Singleton;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
 import org.osgi.service.component.annotations.Activate;
@@ -26,7 +26,7 @@ public final class SimpleDropFirewall {
 
     @Inject
     @Activate
-    public SimpleDropFirewall(@Reference final RpcConsumerRegistry rpcService) {
+    public SimpleDropFirewall(@Reference final RpcService rpcService) {
         addFlow = rpcService.getRpc(AddFlow.class);
     }
 
index 9b945736d09346bb526b235038cd0757e9d9eb8f..8b52ba2a6d27799bb726e04eb28efe141ecf11c5 100644 (file)
@@ -16,7 +16,7 @@ import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
@@ -67,7 +67,7 @@ public final class DropTestRpcSender extends AbstractDropTest {
     @Inject
     @Activate
     public DropTestRpcSender(@Reference final NotificationService notificationService,
-            @Reference final RpcConsumerRegistry rpcService) {
+            @Reference final RpcService rpcService) {
         this.notificationService = requireNonNull(notificationService);
         addFlow = rpcService.getRpc(AddFlow.class);
     }