Bump upstreams for Silicon 44/92944/15
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 7 Oct 2020 15:39:58 +0000 (17:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 17 Oct 2020 17:57:53 +0000 (19:57 +0200)
Adopt the following upstream versions:
- odlparent-8.0.0
- yangtools-6.0.0
- mdsal-7.0.0
- controller-3.0.0
- infrautils-1.9.0

Since we are forced to migrate some of the code, perform related
migrations if they are trivial to do.

Quite a few tests are missing proper keys and properties, hence
these are added in the most obvious manner possible. If there is
a list/map warning in that vicinity, also use BindingMap.of() to get
rid of the warning.

Also a few obvious modernizer warnings are fixed, as it's easier
than add suppressions.

Change-Id: Ic4302fba6916dca8385633f1889e8e619fc281e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
128 files changed:
applications/arbitratorreconciliation/impl/src/main/java/org/opendaylight/openflowplugin/applications/arbitratorreconciliation/impl/ArbitratorReconciliationManagerImpl.java
applications/arbitratorreconciliation/pom.xml
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/SalBulkFlowServiceImpl.java
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/BundleFlowForwarder.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/BundleGroupForwarder.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/FlowForwarder.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowNodeConnectorInventoryTranslatorImpl.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowNodeReconciliationImpl.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ForwardingRulesManagerImpl.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/SyncReactorImpl.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/FlowForwarder.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/FxChainUtil.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/SemaphoreKeeperGuavaImpl.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/DSInputFactory.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorImplTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/FlowForwarderTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtilTest.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/LLDPSpeaker.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProvider.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/AbstractNotificationSupplierBase.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/AbstractNotificationSupplierForItemRoot.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/AbstractNotificationSupplierForItem.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/stat/AbstractNotificationSupplierForItemStat.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/stat/GroupStatNotificationSupplierImpl.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/stat/MeterStatNotificationSupplierImpl.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/stat/NodeConnectorStatNotificationSupplierImpl.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/stat/QueueStatNotificationSupplierImpl.java
applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/helper/TestChangeEventBuildHelper.java
applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/item/stat/QueueStatNotificationSupplierImplTest.java
applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java
applications/pom.xml
applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/cli/GetRegisteredServices.java
applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/impl/ReconciliationManagerImpl.java
applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPPacketPuntEnforcer.java
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/utils/LLDPDiscoveryUtils.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyExporter.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/NodeChangeListenerImplTest.java
applications/topology-manager/src/test/java/org/opendaylight/openflowplugin/applications/topology/manager/TerminationPointChangeListenerImplTest.java
artifacts/pom.xml
distribution/karaf/pom.xml
drop-test-karaf/src/main/java/org/opendaylight/openflowplugin/droptestkaraf/DropTestProviderImpl.java
extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml
extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml
extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml
extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml
extension/features-extension-aggregator/pom.xml
extension/openflowjava-extension-eric/pom.xml
extension/openflowjava-extension-nicira/pom.xml
extension/openflowplugin-extension-eric/src/main/java/org/opendaylight/openflowplugin/extension/vendor/eric/EricExtensionProvider.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProvider.java
extension/openflowplugin-extension-onf/pom.xml
extension/pom.xml
features-aggregator/features-openflowplugin/pom.xml
features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml
features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml
features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml
features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml
features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml
features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml
features-aggregator/odl-openflowplugin-app-notifications/pom.xml
features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml
features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml
features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml
features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml
features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml
features-aggregator/odl-openflowplugin-app-topology/pom.xml
features-aggregator/odl-openflowplugin-drop-test/pom.xml
features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml
features-aggregator/odl-openflowplugin-flow-services/pom.xml
features-aggregator/odl-openflowplugin-libraries/pom.xml
features-aggregator/odl-openflowplugin-libraries/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
features-aggregator/pom.xml
libraries/pom.xml
model/pom.xml
openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml
openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml
openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/src/main/feature/feature.xml
openflowjava/features-openflowjava-aggregator/pom.xml
openflowjava/openflow-protocol-impl/pom.xml
openflowplugin-impl/pom.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/configuration/OpenFlowProviderConfigImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/datastore/multipart/FlowStatsMultipartWriter.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/AbstractDeviceInitializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/Ipv4DestinationEntryDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/GroupMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/AbstractPortNumberWithMaskEntrySerilizer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/FlowRegistryKeyFactory.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractFlowDirectStatisticsService.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/configuration/OpenFlowProviderConfigImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/device/initialization/OF10DeviceInitializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/registry/flow/FlowRegistryKeyFactoryTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestOnTheFlyCallbackTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdaptersTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdaptersTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdaptersTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlatBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalPortServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerPortServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsGatheringUtilsTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlatBatchUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/GroupUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java
openflowplugin/pom.xml
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/ConvertorManagerTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/MeterConvertorTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PortConvertorTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionConvertorV10Test.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionConvertorV13Test.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/flow/FlowConvertorTest.java
parent/pom.xml
samples/pom.xml
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestCommandProvider.java

index e3d819f58e6d6d76104072d0a7e218d9fbb1685e..be8168f19ba32664aceeb8affb806fae353e5b72 100644 (file)
@@ -5,9 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.arbitratorreconciliation.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
@@ -41,7 +42,6 @@ import org.opendaylight.openflowplugin.applications.reconciliation.Reconciliatio
 import org.opendaylight.openflowplugin.applications.reconciliation.ReconciliationNotificationListener;
 import org.opendaylight.serviceutils.upgrade.UpgradeState;
 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.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupTypes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder;
@@ -104,8 +104,9 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
     private static final String SEPARATOR = ":";
 
     private static final BundleRemoveFlowCase DELETE_ALL_FLOW = new BundleRemoveFlowCaseBuilder()
-            .setRemoveFlowCaseData(
-                    new RemoveFlowCaseDataBuilder(new FlowBuilder().setTableId(OFConstants.OFPTT_ALL).build()).build())
+            .setRemoveFlowCaseData(new RemoveFlowCaseDataBuilder()
+                .setTableId(OFConstants.OFPTT_ALL)
+                .build())
             .build();
     private static final BundleRemoveGroupCase DELETE_ALL_GROUP = new BundleRemoveGroupCaseBuilder()
             .setRemoveGroupCaseData(new RemoveGroupCaseDataBuilder(new GroupBuilder()
@@ -126,16 +127,15 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
             ObjectRegistration<? extends RpcService>> rpcRegistrations = new ConcurrentHashMap<>();
 
     @Inject
-    public ArbitratorReconciliationManagerImpl(
-            @Reference ReconciliationManager reconciliationManager, @Reference RpcProviderService rpcProviderService,
-            @Reference final RpcConsumerRegistry rpcRegistry, @Reference UpgradeState upgradeState) {
+    public ArbitratorReconciliationManagerImpl(@Reference final ReconciliationManager reconciliationManager,
+            @Reference final RpcProviderService rpcProviderService, @Reference final RpcConsumerRegistry rpcRegistry,
+            @Reference final UpgradeState upgradeState) {
         Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry cannot be null !");
-        this.reconciliationManager = Preconditions.checkNotNull(reconciliationManager,
-                "ReconciliationManager cannot be null!");
-        this.salBundleService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalBundleService.class),
+        this.reconciliationManager = requireNonNull(reconciliationManager, "ReconciliationManager cannot be null!");
+        this.salBundleService = requireNonNull(rpcRegistry.getRpcService(SalBundleService.class),
                 "RPC SalBundleService not found.");
         this.rpcProviderService = rpcProviderService;
-        this.upgradeState = Preconditions.checkNotNull(upgradeState, "UpgradeState cannot be null!");
+        this.upgradeState = requireNonNull(upgradeState, "UpgradeState cannot be null!");
     }
 
     @PostConstruct
@@ -156,7 +156,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
 
     @Override
     public ListenableFuture<RpcResult<CommitActiveBundleOutput>> commitActiveBundle(
-            CommitActiveBundleInput input) {
+            final CommitActiveBundleInput input) {
         Uint64 nodeId = input.getNodeId();
         if (bundleIdMap.containsKey(nodeId)) {
             BundleId bundleId = bundleIdMap.get(nodeId).getBundleId();
@@ -210,7 +210,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
     }
 
     @Override
-    public ListenableFuture<Boolean> startReconciliation(DeviceInfo node) {
+    public ListenableFuture<Boolean> startReconciliation(final DeviceInfo node) {
         registerRpc(node);
         if (upgradeState.isUpgradeInProgress()) {
             LOG.trace("Starting arbitrator reconciliation for node {}", node.getDatapathId());
@@ -221,7 +221,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
     }
 
     @Override
-    public ListenableFuture<Boolean> endReconciliation(DeviceInfo node) {
+    public ListenableFuture<Boolean> endReconciliation(final DeviceInfo node) {
         Uint64 datapathId = node.getDatapathId();
         LOG.trace("Stopping arbitrator reconciliation for node {}", datapathId);
         bundleIdMap.remove(datapathId);
@@ -244,7 +244,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
         return ResultState.DONOTHING;
     }
 
-    private ListenableFuture<Boolean> reconcileConfiguration(DeviceInfo node) {
+    private ListenableFuture<Boolean> reconcileConfiguration(final DeviceInfo node) {
         LOG.info("Triggering arbitrator reconciliation for device {}", node.getDatapathId());
         ArbitratorReconciliationTask upgradeReconTask = new ArbitratorReconciliationTask(node);
         return executor.submit(upgradeReconTask);
@@ -341,13 +341,13 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
         }
 
         @Override
-        public void onSuccess(RpcResult<?> rpcResult) {
+        public void onSuccess(final RpcResult<?> rpcResult) {
             LOG.debug("Completed arbitrator reconciliation for device:{}", nodeId);
             bundleIdMap.remove(nodeId);
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Error while performing arbitrator reconciliation for device {}", nodeId, throwable);
         }
     }
@@ -372,7 +372,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
         };
     }
 
-    private void registerRpc(DeviceInfo node) {
+    private void registerRpc(final DeviceInfo node) {
         KeyedInstanceIdentifier<Node, NodeKey> path = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, new NodeKey(node.getNodeId()));
         LOG.debug("The path is registered : {}", path);
@@ -382,7 +382,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
         rpcRegistrations.put(node.getNodeId().getValue(), rpcRegistration);
     }
 
-    private void deregisterRpc(DeviceInfo node) {
+    private void deregisterRpc(final DeviceInfo node) {
         KeyedInstanceIdentifier<Node, NodeKey> path = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, new NodeKey(node.getNodeId()));
         LOG.debug("The path is unregistered : {}", path);
@@ -397,7 +397,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
         private final BundleId bundleId;
         private final ListenableFuture<RpcResult<ControlBundleOutput>> result;
 
-        BundleDetails(BundleId bundleId, ListenableFuture<RpcResult<ControlBundleOutput>> result) {
+        BundleDetails(final BundleId bundleId, final ListenableFuture<RpcResult<ControlBundleOutput>> result) {
             this.bundleId = bundleId;
             this.result = result;
         }
@@ -413,7 +413,7 @@ public class ArbitratorReconciliationManagerImpl implements ArbitratorReconcileS
 
     @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
             justification = "https://github.com/spotbugs/spotbugs/issues/811")
-    private static Uint64 getDpnIdFromNodeName(String nodeName) {
+    private static Uint64 getDpnIdFromNodeName(final String nodeName) {
         String dpnId = nodeName.substring(nodeName.lastIndexOf(SEPARATOR) + 1);
         return Uint64.valueOf(dpnId);
     }
index d33d35f301b97bf702760d041b0e37d5fa425b65..18ed94a27040fe9aa94e0d38fa21ba14e0e9f707 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index a140f51ab0593ee071741765ced73642f356a81d..db58c4db2b81635c82eec33150dfffbcfa838d8a 100644 (file)
@@ -5,11 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.bulk.o.matic;
 
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+import static java.util.Objects.requireNonNullElse;
+
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -89,17 +89,17 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     private final FlowCounter flowCounterBeanImpl = new FlowCounter();
     private final ExecutorService fjService = new ForkJoinPool();
 
-    public SalBulkFlowServiceImpl(SalFlowService flowService, DataBroker dataBroker) {
-        this.flowService = Preconditions.checkNotNull(flowService);
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
+    public SalBulkFlowServiceImpl(final SalFlowService flowService, final DataBroker dataBroker) {
+        this.flowService = requireNonNull(flowService);
+        this.dataBroker = requireNonNull(dataBroker);
 
         LoggingFutures.addErrorLogging(register(new RegisterInputBuilder().build()), LOG, "register");
     }
 
     @Override
-    public ListenableFuture<RpcResult<AddFlowsDsOutput>> addFlowsDs(AddFlowsDsInput input) {
+    public ListenableFuture<RpcResult<AddFlowsDsOutput>> addFlowsDs(final AddFlowsDsInput input) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        boolean createParentsNextTime = MoreObjects.firstNonNull(input.isAlwaysCreateParents(), Boolean.FALSE);
+        boolean createParentsNextTime = requireNonNullElse(input.isAlwaysCreateParents(), Boolean.FALSE);
         boolean createParents = true;
         for (BulkFlowDsItem bulkFlow : input.getBulkFlowDsItem()) {
             FlowBuilder flowBuilder = new FlowBuilder(bulkFlow);
@@ -125,7 +125,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
         },MoreExecutors.directExecutor());
     }
 
-    private static InstanceIdentifier<Flow> getFlowInstanceIdentifier(BulkFlowDsItem bulkFlow) {
+    private static InstanceIdentifier<Flow> getFlowInstanceIdentifier(final BulkFlowDsItem bulkFlow) {
         final NodeRef nodeRef = bulkFlow.getNode();
         return ((InstanceIdentifier<Node>) nodeRef.getValue()).augmentation(FlowCapableNode.class)
                 .child(Table.class, new TableKey(bulkFlow.getTableId()))
@@ -133,7 +133,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<RemoveFlowsDsOutput>> removeFlowsDs(RemoveFlowsDsInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowsDsOutput>> removeFlowsDs(final RemoveFlowsDsInput input) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         for (BulkFlowDsItem bulkFlow : input.getBulkFlowDsItem()) {
             writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, getFlowInstanceIdentifier(bulkFlow));
@@ -147,16 +147,17 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
         }, MoreExecutors.directExecutor());
     }
 
-    private static <T> ListenableFuture<RpcResult<Void>> handleResultFuture(ListenableFuture<List<T>> submitFuture) {
+    private static <T> ListenableFuture<RpcResult<Void>> handleResultFuture(
+            final ListenableFuture<List<T>> submitFuture) {
         final SettableFuture<RpcResult<Void>> rpcResult = SettableFuture.create();
         Futures.addCallback(submitFuture, new FutureCallback<List<T>>() {
             @Override
-            public void onSuccess(List<T> result) {
+            public void onSuccess(final List<T> result) {
                 rpcResult.set(RpcResultBuilder.success((Void) null).build());
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 RpcResultBuilder<Void> rpcResultBld = RpcResultBuilder.<Void>failed()
                         .withRpcErrors(Collections.singleton(RpcResultBuilder.newError(RpcError.ErrorType.APPLICATION,
                                 null, throwable.getMessage())));
@@ -167,7 +168,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<AddFlowsRpcOutput>> addFlowsRpc(AddFlowsRpcInput input) {
+    public ListenableFuture<RpcResult<AddFlowsRpcOutput>> addFlowsRpc(final AddFlowsRpcInput input) {
         List<ListenableFuture<RpcResult<AddFlowOutput>>> bulkResults = new ArrayList<>();
 
         for (BulkFlowBaseContentGrouping bulkFlow : input.getBulkFlowItem()) {
@@ -188,7 +189,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<ReadFlowTestOutput>> readFlowTest(ReadFlowTestInput input) {
+    public ListenableFuture<RpcResult<ReadFlowTestOutput>> readFlowTest(final ReadFlowTestInput input) {
         FlowReader flowReader = FlowReader.getNewInstance(dataBroker, input.getDpnCount().intValue(),
                 input.getFlowsPerDpn().intValue(), input.isVerbose(), input.isIsConfigDs(),
                 input.getStartTableId().shortValue(), input.getEndTableId().shortValue());
@@ -199,7 +200,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<FlowRpcAddTestOutput>> flowRpcAddTest(FlowRpcAddTestInput input) {
+    public ListenableFuture<RpcResult<FlowRpcAddTestOutput>> flowRpcAddTest(final FlowRpcAddTestInput input) {
         FlowWriterDirectOFRpc flowAddRpcTestImpl = new FlowWriterDirectOFRpc(dataBroker, flowService, fjService);
         flowAddRpcTestImpl.rpcFlowAdd(input.getDpnId(), input.getFlowCount().intValue(),
                 input.getRpcBatchSize().intValue());
@@ -209,7 +210,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<RegisterOutput>> register(RegisterInput input) {
+    public ListenableFuture<RpcResult<RegisterOutput>> register(final RegisterInput input) {
         RpcResultBuilder<RegisterOutput> rpcResultBuilder = RpcResultBuilder.success();
         try {
             MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
@@ -226,7 +227,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<RemoveFlowsRpcOutput>> removeFlowsRpc(RemoveFlowsRpcInput input) {
+    public ListenableFuture<RpcResult<RemoveFlowsRpcOutput>> removeFlowsRpc(final RemoveFlowsRpcInput input) {
         List<ListenableFuture<RpcResult<RemoveFlowOutput>>> bulkResults = new ArrayList<>();
 
         for (BulkFlowBaseContentGrouping bulkFlow : input.getBulkFlowItem()) {
@@ -247,7 +248,7 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<FlowTestOutput>> flowTest(FlowTestInput input) {
+    public ListenableFuture<RpcResult<FlowTestOutput>> flowTest(final FlowTestInput input) {
         if (input.isTxChain()) {
             FlowWriterTxChain flowTester = new FlowWriterTxChain(dataBroker, fjService);
             flowCounterBeanImpl.setWriter(flowTester);
@@ -317,7 +318,8 @@ public class SalBulkFlowServiceImpl implements SalBulkFlowService {
     }
 
     @Override
-    public ListenableFuture<RpcResult<FlowRpcAddMultipleOutput>> flowRpcAddMultiple(FlowRpcAddMultipleInput input) {
+    public ListenableFuture<RpcResult<FlowRpcAddMultipleOutput>> flowRpcAddMultiple(
+            final FlowRpcAddMultipleInput input) {
         FlowWriterDirectOFRpc flowTesterRPC = new FlowWriterDirectOFRpc(dataBroker, flowService, fjService);
         flowTesterRPC.rpcFlowAddAll(input.getFlowCount().intValue(), input.getRpcBatchSize().intValue());
         RpcResultBuilder<FlowRpcAddMultipleOutput> rpcResultBuilder = RpcResultBuilder.success();
index 77390a7cc34342da7a7b65c8b7db99556374e7e7..f7145b82ccaa23c03351a2a42e1f00b089eaafca 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -45,20 +46,18 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
 
     public AbstractListeningCommiter(final ForwardingRulesManager provider, final DataBroker dataBroker,
                                      final ListenerRegistrationHelper registrationHelper) {
-        this.provider = Preconditions.checkNotNull(provider, "ForwardingRulesManager can not be null!");
-        this.nodeConfigurator = Preconditions.checkNotNull(provider.getNodeConfigurator(),
-                "NodeConfigurator can not be null!");
-        this.dataBroker = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
-        this.registrationHelper = Preconditions.checkNotNull(registrationHelper, "registrationHelper can not be null!");
+        this.provider = requireNonNull(provider, "ForwardingRulesManager can not be null!");
+        this.nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!");
+        this.dataBroker = requireNonNull(dataBroker, "DataBroker can not be null!");
+        this.registrationHelper = requireNonNull(registrationHelper, "registrationHelper can not be null!");
         registerListener();
         provider.addRecoverableListener(this);
     }
 
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<T>> changes) {
-        Preconditions.checkNotNull(changes, "Changes may not be null!");
-        LOG.trace("Received data changes :{}", changes);
+    public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
+        LOG.trace("Received data changes :{}", requireNonNull(changes, "Changes may not be null!"));
 
         for (DataTreeModification<T> change : changes) {
             final InstanceIdentifier<T> key = change.getRootPath().getRootIdentifier();
@@ -120,13 +119,13 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
                 new FutureCallback<ListenerRegistration<AbstractListeningCommiter>>() {
                     @Override
                     public void onSuccess(
-                            @Nullable ListenerRegistration<AbstractListeningCommiter> flowListenerRegistration) {
+                            @Nullable final ListenerRegistration<AbstractListeningCommiter> flowListenerRegistration) {
                         LOG.info("{} registered successfully", flowListenerRegistration.getInstance());
                         listenerRegistration = flowListenerRegistration;
                     }
 
                     @Override
-                    public void onFailure(Throwable throwable) {
+                    public void onFailure(final Throwable throwable) {
                         LOG.error("Registration failed ", throwable);
                     }
                 }, MoreExecutors.directExecutor());
@@ -139,7 +138,7 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
     protected abstract InstanceIdentifier<T> getWildCardPath();
 
     private boolean preConfigurationCheck(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-        Preconditions.checkNotNull(nodeIdent, "FlowCapableNode identifier can not be null!");
+        requireNonNull(nodeIdent, "FlowCapableNode identifier can not be null!");
         // In single node cluster, node should be in local cache before we get any flow/group/meter
         // data change event from data store. So first check should pass.
         // In case of 3-node cluster, when shard leader changes, clustering will send blob of data
index 4dea1c378787b8412fb15a98467fe627d7c0b7d2..b693452f657062503a8a86bd501e20672a81a0e6 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
@@ -20,8 +21,8 @@ public abstract class AbstractNodeConnectorCommitter<T extends DataObject>
         implements FlowCapableNodeConnectorCommitter<T> {
 
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<T>> changes) {
-        Preconditions.checkNotNull(changes, "Changes may not be null!");
+    public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
+        requireNonNull(changes, "Changes may not be null!");
 
         for (DataTreeModification<T> change : changes) {
             final InstanceIdentifier<T> key = change.getRootPath().getRootIdentifier();
@@ -58,7 +59,7 @@ public abstract class AbstractNodeConnectorCommitter<T extends DataObject>
     protected abstract InstanceIdentifier<T> getWildCardPath();
 
     private static boolean preConfigurationCheck(final InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
-        Preconditions.checkNotNull(nodeConnIdent, "FlowCapableNodeConnector ident can not be null!");
+        requireNonNull(nodeConnIdent, "FlowCapableNodeConnector ident can not be null!");
         return true;
     }
 }
index 6bfcfbfda2ad8df6954c4ca5a640a53f208ee8da..30120f294df341531b5331836e52ba31a1079c71 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.buildGroupInstanceIdentifier;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getFlowId;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getNodeIdValueFromNodeIdentifier;
@@ -14,7 +15,6 @@ import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getT
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.isFlowDependentOnGroup;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.isGroupExistsOnDevice;
 
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -64,16 +64,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
-
     private static final Logger LOG = LoggerFactory.getLogger(BundleFlowForwarder.class);
     private static final BundleFlags BUNDLE_FLAGS = new BundleFlags(true, true);
+
     private final ForwardingRulesManager forwardingRulesManager;
     private final NodeConfigurator nodeConfigurator;
 
-    public BundleFlowForwarder(ForwardingRulesManager forwardingRulesManager) {
-        this.forwardingRulesManager = Preconditions.checkNotNull(forwardingRulesManager,
-                "ForwardingRulesManager can not be null!");
-        this.nodeConfigurator = Preconditions.checkNotNull(forwardingRulesManager.getNodeConfigurator(),
+    public BundleFlowForwarder(final ForwardingRulesManager forwardingRulesManager) {
+        this.forwardingRulesManager = requireNonNull(forwardingRulesManager, "ForwardingRulesManager can not be null!");
+        this.nodeConfigurator = requireNonNull(forwardingRulesManager.getNodeConfigurator(),
                 "NodeConfigurator can not be null!");
     }
 
@@ -228,8 +227,9 @@ public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
         private final Uint8 tableId;
         private final SettableFuture<RpcResult<AddBundleMessagesOutput>> resultFuture;
 
-        BundleFlowCallBack(InstanceIdentifier<FlowCapableNode> nodeIdent, BundleId bundleId, Message messages,
-            InstanceIdentifier<Flow> identifier , SettableFuture<RpcResult<AddBundleMessagesOutput>> resultFuture) {
+        BundleFlowCallBack(final InstanceIdentifier<FlowCapableNode> nodeIdent, final BundleId bundleId,
+                final Message messages, final InstanceIdentifier<Flow> identifier,
+                final SettableFuture<RpcResult<AddBundleMessagesOutput>> resultFuture) {
             this.nodeIdent = nodeIdent;
             this.bundleId = bundleId;
             this.messages = messages;
@@ -240,7 +240,7 @@ public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
         }
 
         @Override
-        public void onSuccess(RpcResult<AddBundleMessagesOutput> rpcResult) {
+        public void onSuccess(final RpcResult<AddBundleMessagesOutput> rpcResult) {
             if (rpcResult.isSuccessful()) {
                 AddBundleMessagesInput addBundleMessagesInput = new AddBundleMessagesInputBuilder()
                         .setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)))
@@ -258,7 +258,7 @@ public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
                         forwardingRulesManager.getSalBundleService().addBundleMessages(addBundleMessagesInput);
                 Futures.addCallback(addFuture, new FutureCallback<RpcResult<AddBundleMessagesOutput>>() {
                     @Override
-                    public void onSuccess(RpcResult<AddBundleMessagesOutput> result) {
+                    public void onSuccess(final RpcResult<AddBundleMessagesOutput> result) {
                         resultFuture.set(result);
                         if (!result.getErrors().isEmpty()) {
                             LOG.error("Flow add with flowId {} and tableId {} failed for node {} with error: {}",
@@ -268,7 +268,7 @@ public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
                     }
 
                     @Override
-                    public void onFailure(Throwable failure) {
+                    public void onFailure(final Throwable failure) {
                         resultFuture.setException(failure);
                     }
                 },  MoreExecutors.directExecutor());
@@ -280,7 +280,7 @@ public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Error while pushing flow add bundle {} for device {}", messages, nodeId);
             resultFuture.setException(throwable);
         }
index b522de7586c19810771c81ad37bd86978d3e66bb..07241c16b9be46f15fd81c7ec47dbbc420ccbbd1 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getNodeIdValueFromNodeIdentifier;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.isGroupExistsOnDevice;
 
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -55,9 +55,8 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
     private final NodeConfigurator nodeConfigurator;
 
     public BundleGroupForwarder(final ForwardingRulesManager forwardingRulesManager) {
-        this.forwardingRulesManager = Preconditions.checkNotNull(forwardingRulesManager,
-                "ForwardingRulesManager can not be null!");
-        this.nodeConfigurator = Preconditions.checkNotNull(forwardingRulesManager.getNodeConfigurator(),
+        this.forwardingRulesManager = requireNonNull(forwardingRulesManager, "ForwardingRulesManager can not be null!");
+        this.nodeConfigurator = requireNonNull(forwardingRulesManager.getNodeConfigurator(),
                 "NodeConfigurator can not be null!");
     }
 
@@ -180,7 +179,7 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
         }
 
         @Override
-        public void onSuccess(RpcResult<AddBundleMessagesOutput> result) {
+        public void onSuccess(final RpcResult<AddBundleMessagesOutput> result) {
             if (result.isSuccessful()) {
                 forwardingRulesManager.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
                 LOG.debug("Group add with id {} finished without error for node {}", groupId, nodeId);
@@ -191,7 +190,7 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Service call for adding group {} failed for node {} with error ", groupId, nodeId, throwable);
         }
     }
@@ -206,7 +205,7 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
         }
 
         @Override
-        public void onSuccess(RpcResult<AddBundleMessagesOutput> result) {
+        public void onSuccess(final RpcResult<AddBundleMessagesOutput> result) {
             if (result.isSuccessful()) {
                 forwardingRulesManager.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
                 LOG.debug("Group update with id {} finished without error for node {}", groupId, nodeId);
@@ -217,7 +216,7 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Service call for updating group {} failed for node {}", groupId, nodeId, throwable);
         }
     }
@@ -232,7 +231,7 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
         }
 
         @Override
-        public void onSuccess(RpcResult<AddBundleMessagesOutput> result) {
+        public void onSuccess(final RpcResult<AddBundleMessagesOutput> result) {
             if (result.isSuccessful()) {
                 LOG.debug("Group remove with id {} finished without error for node {}", groupId, nodeId);
                 forwardingRulesManager.getDevicesGroupRegistry().removeGroup(nodeId, groupId);
@@ -243,7 +242,7 @@ public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Service call for removing group {} failed for node {} with error", groupId, nodeId, throwable);
         }
     }
index ada3742e33b511c4b668ae03061a2249188676e8..366847bb51aa6e6da3a132850ef75d43853d4234 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
 import java.util.Collection;
@@ -95,8 +94,6 @@ public class DeviceMastershipManager implements ClusteredDataTreeChangeListener<
 
     @Override
     public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<FlowCapableNode>> changes) {
-        Preconditions.checkNotNull(changes, "Changes may not be null!");
-
         for (DataTreeModification<FlowCapableNode> change : changes) {
             final InstanceIdentifier<FlowCapableNode> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<FlowCapableNode> mod = change.getRootNode();
index 99935e4f1213bf28db965f7f18290a6a7c386ae3..a0d33067974e5f9dd0eada3f752c92d4d05d20d8 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.buildGroupInstanceIdentifier;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getActiveBundle;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getFlowId;
@@ -14,7 +15,6 @@ import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.getN
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.isFlowDependentOnGroup;
 import static org.opendaylight.openflowplugin.applications.frm.util.FrmUtil.isGroupExistsOnDevice;
 
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -260,8 +260,8 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
     }
 
     @Override
-    public void createStaleMarkEntity(InstanceIdentifier<Flow> identifier, Flow del,
-            InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    public void createStaleMarkEntity(final InstanceIdentifier<Flow> identifier, final Flow del,
+            final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.debug("Creating Stale-Mark entry for the switch {} for flow {} ", nodeIdent, del);
         StaleFlow staleFlow = makeStaleFlow(identifier, del, nodeIdent);
         persistStaleFlow(staleFlow, nodeIdent);
@@ -274,8 +274,8 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
     }
 
     private static boolean tableIdValidationPrecondition(final TableKey tableKey, final Flow flow) {
-        Preconditions.checkNotNull(tableKey, "TableKey can not be null or empty!");
-        Preconditions.checkNotNull(flow, "Flow can not be null or empty!");
+        requireNonNull(tableKey, "TableKey can not be null or empty!");
+        requireNonNull(flow, "Flow can not be null or empty!");
         if (!tableKey.getId().equals(flow.getTableId())) {
             LOG.warn("TableID in URI tableId={} and in palyload tableId={} is not same.", flow.getTableId(),
                     tableKey.getId());
@@ -284,13 +284,13 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         return true;
     }
 
-    private static StaleFlow makeStaleFlow(InstanceIdentifier<Flow> identifier, Flow del,
-            InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    private static StaleFlow makeStaleFlow(final InstanceIdentifier<Flow> identifier, final Flow del,
+            final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         StaleFlowBuilder staleFlowBuilder = new StaleFlowBuilder(del);
         return staleFlowBuilder.setId(del.getId()).build();
     }
 
-    private void persistStaleFlow(StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    private void persistStaleFlow(final StaleFlow staleFlow, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleFlowInstanceIdentifier(staleFlow, nodeIdent),
                 staleFlow);
@@ -299,15 +299,15 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         handleStaleFlowResultFuture(submitFuture);
     }
 
-    private static void handleStaleFlowResultFuture(FluentFuture<?> submitFuture) {
+    private static void handleStaleFlowResultFuture(final FluentFuture<?> submitFuture) {
         submitFuture.addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(Object result) {
+            public void onSuccess(final Object result) {
                 LOG.debug("Stale Flow creation success");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 LOG.error("Stale Flow creation failed", throwable);
             }
         }, MoreExecutors.directExecutor());
@@ -316,7 +316,7 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
 
     private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
         .flow.inventory.rev130819.tables.table.StaleFlow> getStaleFlowInstanceIdentifier(
-            StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+            final StaleFlow staleFlow, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return nodeIdent.child(Table.class, new TableKey(staleFlow.getTableId())).child(
                 org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow.class,
                 new StaleFlowKey(new FlowId(staleFlow.getId())));
@@ -361,8 +361,8 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         private final Uint32 groupId;
         private final SettableFuture<RpcResult<AddFlowOutput>> resultFuture;
 
-        private AddFlowCallBack(final AddFlowInput addFlowInput, final String nodeId, Uint32 groupId,
-                SettableFuture<RpcResult<AddFlowOutput>> resultFuture) {
+        private AddFlowCallBack(final AddFlowInput addFlowInput, final String nodeId, final Uint32 groupId,
+                final SettableFuture<RpcResult<AddFlowOutput>> resultFuture) {
             this.addFlowInput = addFlowInput;
             this.nodeId = nodeId;
             this.groupId = groupId;
@@ -370,19 +370,19 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         }
 
         @Override
-        public void onSuccess(RpcResult<AddGroupOutput> rpcResult) {
+        public void onSuccess(final RpcResult<AddGroupOutput> rpcResult) {
             if (rpcResult.isSuccessful() || rpcResult.getErrors().size() == 1
                     && rpcResult.getErrors().iterator().next().getMessage().contains(GROUP_EXISTS_IN_DEVICE_ERROR)) {
                 provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
                 Futures.addCallback(provider.getSalFlowService().addFlow(addFlowInput),
                     new FutureCallback<RpcResult<AddFlowOutput>>() {
                         @Override
-                        public void onSuccess(RpcResult<AddFlowOutput> result) {
+                        public void onSuccess(final RpcResult<AddFlowOutput> result) {
                             resultFuture.set(result);
                         }
 
                         @Override
-                        public void onFailure(Throwable failure) {
+                        public void onFailure(final Throwable failure) {
                             resultFuture.setException(failure);
                         }
                     },  MoreExecutors.directExecutor());
@@ -398,7 +398,7 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Service call for adding flow with id {} failed for node {}",
                     getFlowId(addFlowInput.getFlowRef()), nodeId, throwable);
             resultFuture.setException(throwable);
@@ -412,7 +412,7 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         private final SettableFuture<RpcResult<UpdateFlowOutput>> resultFuture;
 
         private UpdateFlowCallBack(final UpdateFlowInput updateFlowInput, final String nodeId,
-                SettableFuture<RpcResult<UpdateFlowOutput>> resultFuture, Uint32 groupId) {
+                final SettableFuture<RpcResult<UpdateFlowOutput>> resultFuture, final Uint32 groupId) {
             this.updateFlowInput = updateFlowInput;
             this.nodeId = nodeId;
             this.groupId = groupId;
@@ -420,19 +420,19 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         }
 
         @Override
-        public void onSuccess(RpcResult<AddGroupOutput> rpcResult) {
+        public void onSuccess(final RpcResult<AddGroupOutput> rpcResult) {
             if (rpcResult.isSuccessful() || rpcResult.getErrors().size() == 1
                     && rpcResult.getErrors().iterator().next().getMessage().contains(GROUP_EXISTS_IN_DEVICE_ERROR)) {
                 provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
                 Futures.addCallback(provider.getSalFlowService().updateFlow(updateFlowInput),
                     new FutureCallback<RpcResult<UpdateFlowOutput>>() {
                         @Override
-                        public void onSuccess(RpcResult<UpdateFlowOutput> result) {
+                        public void onSuccess(final RpcResult<UpdateFlowOutput> result) {
                             resultFuture.set(result);
                         }
 
                         @Override
-                        public void onFailure(Throwable failure) {
+                        public void onFailure(final Throwable failure) {
                             resultFuture.setException(failure);
                         }
                     },  MoreExecutors.directExecutor());
@@ -448,7 +448,7 @@ public class FlowForwarder extends AbstractListeningCommiter<Flow> {
         }
 
         @Override
-        public void onFailure(Throwable throwable) {
+        public void onFailure(final Throwable throwable) {
             LOG.error("Service call for updating flow with id {} failed for node {}",
                     getFlowId(updateFlowInput.getFlowRef()), nodeId, throwable);
             resultFuture.setException(throwable);
index f3cb90004323937d7a20dee6d09d06832507d105..c37efe6cac1bcf7b5148ad60b0b2028656e0ce2a 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Multimap;
@@ -48,7 +49,7 @@ public class FlowNodeConnectorInventoryTranslatorImpl extends AbstractNodeConnec
 
     @SuppressWarnings("IllegalCatch")
     public FlowNodeConnectorInventoryTranslatorImpl(final DataBroker dataBroker) {
-        Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
+        requireNonNull(dataBroker, "DataBroker can not be null!");
 
         final DataTreeIdentifier<FlowCapableNodeConnector> treeId =
                 DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, getWildCardPath());
@@ -82,8 +83,8 @@ public class FlowNodeConnectorInventoryTranslatorImpl extends AbstractNodeConnec
     }
 
     @Override
-    public void remove(InstanceIdentifier<FlowCapableNodeConnector> identifier, FlowCapableNodeConnector del,
-            InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
+    public void remove(final InstanceIdentifier<FlowCapableNodeConnector> identifier,
+            final FlowCapableNodeConnector del, final InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
         if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
             LOG.debug("Node Connector removed");
             String nodeConnectorIdentifier = nodeConnIdent.firstKeyOf(NodeConnector.class)
@@ -95,8 +96,9 @@ public class FlowNodeConnectorInventoryTranslatorImpl extends AbstractNodeConnec
     }
 
     @Override
-    public void update(InstanceIdentifier<FlowCapableNodeConnector> identifier, FlowCapableNodeConnector original,
-            FlowCapableNodeConnector update, InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
+    public void update(final InstanceIdentifier<FlowCapableNodeConnector> identifier,
+            final FlowCapableNodeConnector original, final FlowCapableNodeConnector update,
+            final InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
         if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
             LOG.debug("Node Connector updated");
             // Don't need to do anything as we are not considering updates here
@@ -104,8 +106,8 @@ public class FlowNodeConnectorInventoryTranslatorImpl extends AbstractNodeConnec
     }
 
     @Override
-    public void add(InstanceIdentifier<FlowCapableNodeConnector> identifier, FlowCapableNodeConnector add,
-            InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
+    public void add(final InstanceIdentifier<FlowCapableNodeConnector> identifier, final FlowCapableNodeConnector add,
+            final InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
         if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
             LOG.debug("Node Connector added");
             String nodeConnectorIdentifier = nodeConnIdent
@@ -120,19 +122,19 @@ public class FlowNodeConnectorInventoryTranslatorImpl extends AbstractNodeConnec
         }
     }
 
-    private static boolean compareInstanceIdentifierTail(InstanceIdentifier<?> identifier1,
-                                  InstanceIdentifier<?> identifier2) {
+    private static boolean compareInstanceIdentifierTail(final InstanceIdentifier<?> identifier1,
+                                  final InstanceIdentifier<?> identifier2) {
         return Iterables.getLast(identifier1.getPathArguments())
                 .equals(Iterables.getLast(identifier2.getPathArguments()));
     }
 
     @Override
-    public boolean isNodeConnectorUpdated(BigInteger dpId, String portName) {
+    public boolean isNodeConnectorUpdated(final BigInteger dpId, final String portName) {
         return dpnToPortMultiMap.containsEntry(dpId,portName) ;
     }
 
 
-    private static BigInteger getDpIdFromPortName(String portName) {
+    private static BigInteger getDpIdFromPortName(final String portName) {
         String dpId = portName.substring(portName.indexOf(SEPARATOR) + 1, portName.lastIndexOf(SEPARATOR));
         return new BigInteger(dpId);
     }
index 0c5bff0615bd10a3c5a5ea8b0a86d28da85ed437..2d9ab20f8c9b097f5f25cee79b7c87e25c17784e 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.openflowplugin.api.openflow.ReconciliationState.ReconciliationStatus.COMPLETED;
 import static org.opendaylight.openflowplugin.api.openflow.ReconciliationState.ReconciliationStatus.FAILED;
 import static org.opendaylight.openflowplugin.api.openflow.ReconciliationState.ReconciliationStatus.STARTED;
 
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -148,13 +147,12 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
     public FlowNodeReconciliationImpl(final ForwardingRulesManager manager, final DataBroker db,
                                       final String serviceName, final int priority, final ResultState resultState,
                                       final FlowGroupCacheManager flowGroupCacheManager) {
-        this.provider = Preconditions.checkNotNull(manager, "ForwardingRulesManager can not be null!");
-        dataBroker = Preconditions.checkNotNull(db, "DataBroker can not be null!");
+        this.provider = requireNonNull(manager, "ForwardingRulesManager can not be null!");
+        dataBroker = requireNonNull(db, "DataBroker can not be null!");
         this.serviceName = serviceName;
         this.priority = priority;
         this.resultState = resultState;
-        salBundleService = Preconditions.checkNotNull(manager.getSalBundleService(),
-                "salBundleService can not be null!");
+        salBundleService = requireNonNull(manager.getSalBundleService(), "salBundleService can not be null!");
         reconciliationStates = flowGroupCacheManager.getReconciliationStates();
     }
 
@@ -166,7 +164,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
     }
 
     @Override
-    public ListenableFuture<Boolean> reconcileConfiguration(InstanceIdentifier<FlowCapableNode> connectedNode) {
+    public ListenableFuture<Boolean> reconcileConfiguration(final InstanceIdentifier<FlowCapableNode> connectedNode) {
         LOG.info("Triggering reconciliation for device {}", connectedNode.firstKeyOf(Node.class));
         // Clearing the group registry cache for the connected node if exists
         String nodeId = FrmUtil.getNodeIdValueFromNodeIdentifier(connectedNode);
@@ -186,7 +184,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
     }
 
     @Override
-    public void flowNodeDisconnected(InstanceIdentifier<FlowCapableNode> disconnectedNode) {
+    public void flowNodeDisconnected(final InstanceIdentifier<FlowCapableNode> disconnectedNode) {
         String node = disconnectedNode.firstKeyOf(Node.class).getId().getValue();
         BigInteger dpnId = getDpnIdFromNodeName(node);
         reconciliationStates.remove(dpnId.toString());
@@ -321,7 +319,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
     }
 
     @Override
-    public ListenableFuture<Boolean> startReconciliation(DeviceInfo node) {
+    public ListenableFuture<Boolean> startReconciliation(final DeviceInfo node) {
         InstanceIdentifier<FlowCapableNode> connectedNode = node.getNodeInstanceIdentifier()
                 .augmentation(FlowCapableNode.class);
         // Clearing the group registry cache for the connected node if exists
@@ -330,7 +328,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
     }
 
     @Override
-    public ListenableFuture<Boolean> endReconciliation(DeviceInfo node) {
+    public ListenableFuture<Boolean> endReconciliation(final DeviceInfo node) {
         ListenableFuture<Boolean> listenableFuture = futureMap.computeIfPresent(node, (key, future) -> future);
         if (listenableFuture != null) {
             listenableFuture.cancel(true);
@@ -538,7 +536,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
          * @param group
          *            The group to add.
          */
-        private void addGroup(Map<Uint32, ListenableFuture<?>> map, Group group) {
+        private void addGroup(final Map<Uint32, ListenableFuture<?>> map, final Group group) {
             KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdentity.child(Group.class, group.key());
             final Uint32 groupId = group.getGroupId().getValue();
             ListenableFuture<?> future = JdkFutureAdapters
@@ -546,7 +544,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
 
             Futures.addCallback(future, new FutureCallback<Object>() {
                 @Override
-                public void onSuccess(Object result) {
+                public void onSuccess(final Object result) {
                     if (LOG.isTraceEnabled()) {
                         LOG.trace("add-group RPC completed: node={}, id={}",
                                 nodeIdentity.firstKeyOf(Node.class).getId().getValue(), groupId);
@@ -554,7 +552,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
                 }
 
                 @Override
-                public void onFailure(Throwable cause) {
+                public void onFailure(final Throwable cause) {
                     LOG.debug("add-group RPC failed: node={}, id={}",
                             nodeIdentity.firstKeyOf(Node.class).getId().getValue(), groupId, cause);
                 }
@@ -572,7 +570,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
          *            Future associated with add-group RPC that installs the target
          *            group.
          */
-        private void awaitGroup(String nodeId, ListenableFuture<?> future) {
+        private void awaitGroup(final String nodeId, final ListenableFuture<?> future) {
             awaitGroups(nodeId, Collections.singleton(future));
         }
 
@@ -584,7 +582,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
          * @param futures
          *            A collection of futures associated with add-group RPCs.
          */
-        private void awaitGroups(String nodeId, Collection<ListenableFuture<?>> futures) {
+        private void awaitGroups(final String nodeId, final Collection<ListenableFuture<?>> futures) {
             if (!futures.isEmpty()) {
                 long timeout = Math.min(ADD_GROUP_TIMEOUT * futures.size(), MAX_ADD_GROUP_TIMEOUT);
                 try {
@@ -599,15 +597,15 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
 
     @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
             justification = "https://github.com/spotbugs/spotbugs/issues/811")
-    private static BigInteger getDpnIdFromNodeName(String nodeName) {
+    private static BigInteger getDpnIdFromNodeName(final String nodeName) {
         String dpId = nodeName.substring(nodeName.lastIndexOf(SEPARATOR) + 1);
         return new BigInteger(dpId);
     }
 
     private void reconciliationPreProcess(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-        List<InstanceIdentifier<StaleFlow>> staleFlowsToBeBulkDeleted = Lists.newArrayList();
-        List<InstanceIdentifier<StaleGroup>> staleGroupsToBeBulkDeleted = Lists.newArrayList();
-        List<InstanceIdentifier<StaleMeter>> staleMetersToBeBulkDeleted = Lists.newArrayList();
+        List<InstanceIdentifier<StaleFlow>> staleFlowsToBeBulkDeleted = new ArrayList<>();
+        List<InstanceIdentifier<StaleGroup>> staleGroupsToBeBulkDeleted = new ArrayList<>();
+        List<InstanceIdentifier<StaleMeter>> staleMetersToBeBulkDeleted = new ArrayList<>();
 
         Optional<FlowCapableNode> flowNode = Optional.empty();
 
@@ -691,7 +689,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
         deleteDSStaleMeters(staleMetersToBeBulkDeleted);
     }
 
-    private void deleteDSStaleFlows(List<InstanceIdentifier<StaleFlow>> flowsForBulkDelete) {
+    private void deleteDSStaleFlows(final List<InstanceIdentifier<StaleFlow>> flowsForBulkDelete) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
 
         for (InstanceIdentifier<StaleFlow> staleFlowIId : flowsForBulkDelete) {
@@ -702,7 +700,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
         handleStaleEntityDeletionResultFuture(submitFuture);
     }
 
-    private void deleteDSStaleGroups(List<InstanceIdentifier<StaleGroup>> groupsForBulkDelete) {
+    private void deleteDSStaleGroups(final List<InstanceIdentifier<StaleGroup>> groupsForBulkDelete) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
 
         for (InstanceIdentifier<StaleGroup> staleGroupIId : groupsForBulkDelete) {
@@ -713,7 +711,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
         handleStaleEntityDeletionResultFuture(submitFuture);
     }
 
-    private void deleteDSStaleMeters(List<InstanceIdentifier<StaleMeter>> metersForBulkDelete) {
+    private void deleteDSStaleMeters(final List<InstanceIdentifier<StaleMeter>> metersForBulkDelete) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
 
         for (InstanceIdentifier<StaleMeter> staleMeterIId : metersForBulkDelete) {
@@ -726,7 +724,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
 
     private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
         .flow.inventory.rev130819.tables.table.StaleFlow> getStaleFlowInstanceIdentifier(
-            StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+            final StaleFlow staleFlow, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return nodeIdent.child(Table.class, new TableKey(staleFlow.getTableId())).child(
                 org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow.class,
                 new StaleFlowKey(new FlowId(staleFlow.getId())));
@@ -734,13 +732,13 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
 
     private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
         .group.types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(
-            StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+            final StaleGroup staleGroup, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return nodeIdent.child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId())));
     }
 
     private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
         .flow.inventory.rev130819.meters.StaleMeter> getStaleMeterInstanceIdentifier(
-            StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+            final StaleMeter staleMeter, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId())));
     }
 
@@ -766,15 +764,15 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
         return futureList;
     }
 
-    private static void handleStaleEntityDeletionResultFuture(FluentFuture<?> submitFuture) {
+    private static void handleStaleEntityDeletionResultFuture(final FluentFuture<?> submitFuture) {
         submitFuture.addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(Object result) {
+            public void onSuccess(final Object result) {
                 LOG.debug("Stale entity removal success");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 LOG.debug("Stale entity removal failed", throwable);
             }
         }, MoreExecutors.directExecutor());
index da39d12b0f3237e75e11a61d98e97f3217f2aadb..4b39a21bbb9560228c131f899ed0dd018aff92c4 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -127,9 +129,9 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
         reconciliationRetryCount = config.getReconciliationRetryCount().toJava();
         isBundleBasedReconciliationEnabled = config.isBundleBasedReconciliationEnabled();
         this.configurationServiceRegistration = configurationService.registerListener(this);
-        this.registrationHelper = Preconditions.checkNotNull(registrationHelper, "RegistrationHelper cannot be null");
-        this.dataService = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
-        this.clusterSingletonServiceProvider = Preconditions.checkNotNull(clusterSingletonService,
+        this.registrationHelper = requireNonNull(registrationHelper, "RegistrationHelper cannot be null");
+        this.dataService = requireNonNull(dataBroker, "DataBroker can not be null!");
+        this.clusterSingletonServiceProvider = requireNonNull(clusterSingletonService,
                 "ClusterSingletonService provider can not be null");
         this.reconciliationManager = reconciliationManager;
         this.rpcProviderService = rpcProviderService;
@@ -138,22 +140,22 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
 
         Preconditions.checkArgument(rpcRegistry != null, "RpcProviderRegistry can not be null !");
 
-        this.salFlowService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalFlowService.class),
+        this.salFlowService = requireNonNull(rpcRegistry.getRpcService(SalFlowService.class),
                 "RPC SalFlowService not found.");
-        this.salGroupService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalGroupService.class),
+        this.salGroupService = requireNonNull(rpcRegistry.getRpcService(SalGroupService.class),
                 "RPC SalGroupService not found.");
-        this.salMeterService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalMeterService.class),
+        this.salMeterService = requireNonNull(rpcRegistry.getRpcService(SalMeterService.class),
                 "RPC SalMeterService not found.");
-        this.salTableService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalTableService.class),
+        this.salTableService = requireNonNull(rpcRegistry.getRpcService(SalTableService.class),
                 "RPC SalTableService not found.");
-        this.salBundleService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalBundleService.class),
+        this.salBundleService = requireNonNull(rpcRegistry.getRpcService(SalBundleService.class),
                 "RPC SalBundlService not found.");
-        this.openflowServiceRecoveryHandler = Preconditions.checkNotNull(openflowServiceRecoveryHandler,
+        this.openflowServiceRecoveryHandler = requireNonNull(openflowServiceRecoveryHandler,
                 "Openflow service recovery handler cannot be null");
-        this.serviceRecoveryRegistry = Preconditions.checkNotNull(serviceRecoveryRegistry,
+        this.serviceRecoveryRegistry = requireNonNull(serviceRecoveryRegistry,
                 "Service recovery registry cannot be null");
-        this.arbitratorReconciliationManager = Preconditions
-                .checkNotNull(rpcRegistry.getRpcService(ArbitratorReconcileService.class),
+        this.arbitratorReconciliationManager =
+                requireNonNull(rpcRegistry.getRpcService(ArbitratorReconcileService.class),
                         "ArbitratorReconciliationManager can not be null!");
     }
 
index 937f61da3851819d20aaca3649daf1e6f2bbc9ad..6705d2610b3a034b61fa98ea61eb81929744c53c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
@@ -70,13 +71,13 @@ public class ForwardingRulesSyncProvider implements AutoCloseable {
     public ForwardingRulesSyncProvider(final DataBroker dataBroker,
                                        final RpcConsumerRegistry rpcRegistry,
                                        final ClusterSingletonServiceProvider clusterSingletonService) {
-        Preconditions.checkNotNull(rpcRegistry, "RpcConsumerRegistry can not be null!");
-        this.dataService = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
-        this.clusterSingletonService = Preconditions.checkNotNull(clusterSingletonService,
+        requireNonNull(rpcRegistry, "RpcConsumerRegistry can not be null!");
+        this.dataService = requireNonNull(dataBroker, "DataBroker can not be null!");
+        this.clusterSingletonService = requireNonNull(clusterSingletonService,
                 "ClusterSingletonServiceProvider can not be null!");
-        this.salTableService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalTableService.class),
+        this.salTableService = requireNonNull(rpcRegistry.getRpcService(SalTableService.class),
                 "RPC SalTableService not found.");
-        this.flatBatchService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalFlatBatchService.class),
+        this.flatBatchService = requireNonNull(rpcRegistry.getRpcService(SalFlatBatchService.class),
                 "RPC SalFlatBatchService not found.");
 
         nodeConfigDataTreePath = DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
index ca965e9669f4fcac53879bfe97be7a675a302843..03039eac2ece19c7f81b5a6dcafc37bd8eac2506 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -53,7 +54,7 @@ public class SyncReactorImpl implements SyncReactor {
     private final SyncPlanPushStrategy syncPlanPushStrategy;
 
     public SyncReactorImpl(final SyncPlanPushStrategy syncPlanPushStrategy) {
-        this.syncPlanPushStrategy = Preconditions.checkNotNull(syncPlanPushStrategy, "execution strategy is mandatory");
+        this.syncPlanPushStrategy = requireNonNull(syncPlanPushStrategy, "execution strategy is mandatory");
     }
 
     @Override
index 3b231db64e0f6a16bfb45e5674abacd60f188589..bb9e4baaeb8469ae2c4aae130f0cfe063b373fcb 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.openflowplugin.applications.frsync.impl.strategy;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.applications.frsync.ForwardingRulesCommitter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
@@ -126,8 +127,8 @@ public class FlowForwarder implements ForwardingRulesCommitter<Flow, AddFlowOutp
     }
 
     private static boolean tableIdValidationPrecondition(final TableKey tableKey, final Flow flow) {
-        Preconditions.checkNotNull(tableKey, "TableKey can not be null or empty!");
-        Preconditions.checkNotNull(flow, "Flow can not be null or empty!");
+        requireNonNull(tableKey, "TableKey can not be null or empty!");
+        requireNonNull(flow, "Flow can not be null or empty!");
         if (!tableKey.getId().equals(flow.getTableId())) {
             LOG.warn("TableID in URI tableId={} and in payload tableId={} is not same.",
                     flow.getTableId(), tableKey.getId());
index 82afa6709a630d314d821834eaff479c2af69f2f..407dd0a31061ed2a07c3a48442e8c11c1e97def8 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.frsync.util;
 
-import com.google.common.base.MoreObjects;
+import static java.util.Objects.requireNonNullElse;
+
 import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.FutureCallback;
 import java.util.Collection;
@@ -38,8 +38,7 @@ public final class FxChainUtil {
                     if (result.isSuccessful()) {
                         LOG.debug("{} finished successfully: {}", prefix, nodeId.getValue());
                     } else {
-                        final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(),
-                                ImmutableList.of());
+                        final Collection<RpcError> errors = requireNonNullElse(result.getErrors(), ImmutableList.of());
                         LOG.debug("{} failed: {} -> {}", prefix, nodeId.getValue(), errors);
                     }
                 } else {
index c9b714e78718b254781be46699516bd6e6c9af55..ff2296263ac4eaa7e11db21102f6dac4e79705ec 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.frsync.util;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
@@ -42,7 +43,7 @@ public class SemaphoreKeeperGuavaImpl<K> implements SemaphoreKeeper<K> {
 
     @Override
     public Semaphore summonGuardAndAcquire(@NonNull final K key) {
-        final Semaphore guard = Preconditions.checkNotNull(summonGuard(key), "Guard not available for " + key);
+        final Semaphore guard = requireNonNull(summonGuard(key), "Guard not available for " + key);
         try {
             guard.acquire();
         } catch (InterruptedException e) {
index 6e8de81d9685022de52f3132ee173b8fe101c04b..e10cbf31accc5689be04b8d6435beb2e27dfd2a3 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder;
@@ -30,10 +27,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.M
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder;
@@ -42,6 +39,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.DropBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.MeterBandHeadersBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeaderBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
@@ -63,8 +61,10 @@ public final class DSInputFactory {
 
     public static Group createGroupWithAction(final Uint32 groupIdValue) {
         final Buckets buckets = new BucketsBuilder()
-                .setBucket(Collections.singletonList(new BucketBuilder()
-                        .setAction(Collections.singletonList(new ActionBuilder()
+                .setBucket(BindingMap.of(new BucketBuilder()
+                        .setBucketId(new BucketId(Uint32.ZERO))
+                        .setAction(BindingMap.of(new ActionBuilder()
+                                .setOrder(0)
                                 .setAction(new OutputActionCaseBuilder()
                                         .setOutputAction(new OutputActionBuilder()
                                                 .setOutputNodeConnector(new Uri("ut-port-1"))
@@ -95,10 +95,12 @@ public final class DSInputFactory {
                 .setTableId(Uint8.valueOf(42))
                 .setMatch(new MatchBuilder().build())
                 .setInstructions(new InstructionsBuilder()
-                        .setInstruction(Collections.singletonList(new InstructionBuilder()
+                        .setInstruction(BindingMap.of(new InstructionBuilder()
+                                .setOrder(0)
                                 .setInstruction(new ApplyActionsCaseBuilder()
                                         .setApplyActions(new ApplyActionsBuilder()
-                                                .setAction(Collections.singletonList(new ActionBuilder()
+                                                .setAction(BindingMap.of(new ActionBuilder()
+                                                        .setOrder(0)
                                                         .setAction(new OutputActionCaseBuilder()
                                                                 .setOutputAction(new OutputActionBuilder()
                                                                         .setOutputNodeConnector(new Uri("ut-port-1"))
@@ -122,7 +124,7 @@ public final class DSInputFactory {
         return new MeterBuilder()
                 .setMeterId(new MeterId(meterIdValue))
                 .setMeterBandHeaders(new MeterBandHeadersBuilder()
-                        .setMeterBandHeader(Collections.singletonList(new MeterBandHeaderBuilder()
+                        .setMeterBandHeader(BindingMap.of(new MeterBandHeaderBuilder()
                                 .setBandId(new BandId(Uint32.valueOf(42)))
                                 .setBandType(new DropBuilder()
                                         .setDropRate(Uint32.valueOf(43))
@@ -133,7 +135,7 @@ public final class DSInputFactory {
     }
 
     public static Group createGroupWithPreconditions(final long groupIdValue, final long... requiredId) {
-        final List<Action> actionBag = new ArrayList<>();
+        final BindingMap.Builder<ActionKey, Action> actionBag = BindingMap.orderedBuilder(requiredId.length);
         int key = 0;
         for (long groupIdPrecondition : requiredId) {
             final GroupAction groupAction = new GroupActionBuilder()
@@ -149,16 +151,14 @@ public final class DSInputFactory {
             actionBag.add(action);
         }
 
-        final Bucket bucket = new BucketBuilder()
-                .setAction(actionBag)
-                .build();
-        final Buckets buckets = new BucketsBuilder()
-                .setBucket(Collections.singletonList(bucket))
-                .build();
-
         return new GroupBuilder()
                 .setGroupId(new GroupId(Uint32.valueOf(groupIdValue)))
-                .setBuckets(buckets)
+                .setBuckets(new BucketsBuilder()
+                    .setBucket(BindingMap.of(new BucketBuilder()
+                        .setBucketId(new BucketId(Uint32.ZERO))
+                        .setAction(actionBag.build())
+                        .build()))
+                    .build())
                 .build();
     }
 }
index 348eb4a8cfff0eb705aff867ee28404ad5056d66..12a5fe8f2f67d171b89cac38cc1065da73be6472 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Collections;
 import java.util.concurrent.TimeUnit;
 import org.junit.Assert;
 import org.junit.Before;
@@ -38,8 +37,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -85,19 +86,21 @@ public class SyncReactorImplTest {
     @Test
     public void testSyncup() throws Exception {
         final FlowCapableNode configFcn = new FlowCapableNodeBuilder()
-                .setGroup(Collections.singletonList(DSInputFactory.createGroup(Uint32.ONE)))
-                .setTable(Collections.singletonList(new TableBuilder()
-                        .setFlow(Collections.singletonList(DSInputFactory.createFlow("f1", 1)))
+                .setGroup(BindingMap.of(DSInputFactory.createGroup(Uint32.ONE)))
+                .setTable(BindingMap.of(new TableBuilder()
+                        .setId(Uint8.valueOf(42))
+                        .setFlow(BindingMap.of(DSInputFactory.createFlow("f1", 1)))
                         .build()))
-                .setMeter(Collections.singletonList(DSInputFactory.createMeter(Uint32.ONE)))
+                .setMeter(BindingMap.of(DSInputFactory.createMeter(Uint32.ONE)))
                 .build();
 
         final FlowCapableNode operationalFcn = new FlowCapableNodeBuilder()
-                .setGroup(Collections.singletonList(DSInputFactory.createGroup(Uint32.TWO)))
-                .setTable(Collections.singletonList(new TableBuilder()
-                        .setFlow(Collections.singletonList(DSInputFactory.createFlow("f2", 2)))
+                .setGroup(BindingMap.of(DSInputFactory.createGroup(Uint32.TWO)))
+                .setTable(BindingMap.of(new TableBuilder()
+                        .setId(Uint8.valueOf(42))
+                        .setFlow(BindingMap.of(DSInputFactory.createFlow("f2", 2)))
                         .build()))
-                .setMeter(Collections.singletonList(DSInputFactory.createMeter(Uint32.TWO)))
+                .setMeter(BindingMap.of(DSInputFactory.createMeter(Uint32.TWO)))
                 .build();
 
         final SyncupEntry syncupEntry = new SyncupEntry(configFcn, LogicalDatastoreType.CONFIGURATION,
index 3113bf9eac18cbf9b6eb72de681d63794753826a..21350b4484cd30fa0c41b91882aa0c97d7a936e6 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.applications.frsync.impl.strategy;
 
-import java.util.Collections;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import org.junit.Assert;
@@ -55,6 +54,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint64;
@@ -135,17 +135,19 @@ public class FlowForwarderTest {
                                 .build()).buildFuture());
 
         final Instructions originalInstructions = new InstructionsBuilder()
-                .setInstruction(Collections.singletonList(new InstructionBuilder()
+                .setInstruction(BindingMap.of(new InstructionBuilder()
                         .setInstruction(new ApplyActionsCaseBuilder()
                                 .setApplyActions(new ApplyActionsBuilder()
-                                        .setAction(Collections.singletonList(new ActionBuilder()
+                                        .setAction(BindingMap.of(new ActionBuilder()
                                                 .setAction(new DropActionCaseBuilder()
                                                         .build())
-                                                .build())
-                                        ).build()
-                                ).build())
-                        .build())
-                ).build();
+                                                .setOrder(0)
+                                                .build()))
+                                        .build())
+                                .build())
+                        .setOrder(0)
+                        .build()))
+                .build();
 
         final Flow flowUpdated = new FlowBuilder(flow)
                 .setInstructions(originalInstructions)
index 051ad29bb86b1df4c1c35d51d65a9c7b725c5c0f..8e18397aa5768ba6cda25f0c0710cb2720e8a919 100644 (file)
@@ -15,7 +15,6 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -38,10 +37,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder;
@@ -50,6 +48,7 @@ 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.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -246,10 +245,11 @@ public class ReconcileUtilTest {
     }
 
     private static Group createGroupWithPreconditions(final long groupIdValue, final long... requiredId) {
-        final List<Action> actionBag = new ArrayList<>();
+        final BindingMap.Builder<ActionKey, Action> actionBag = BindingMap.builder(requiredId.length);
         int key = 0;
         for (long groupIdPrecondition : requiredId) {
             actionBag.add(new ActionBuilder()
+                .setOrder(key)
                 .setAction(new GroupActionCaseBuilder()
                     .setGroupAction(new GroupActionBuilder()
                         .setGroupId(Uint32.valueOf(groupIdPrecondition))
@@ -259,18 +259,18 @@ public class ReconcileUtilTest {
                 .build());
         }
 
-        final Bucket bucket = new BucketBuilder().setAction(actionBag).build();
-        final Buckets buckets = new BucketsBuilder()
-                .setBucket(Collections.singletonMap(bucket.key(), bucket))
-                .build();
-
         return new GroupBuilder()
                 .setGroupId(new GroupId(Uint32.valueOf(groupIdValue)))
-                .setBuckets(buckets)
+                .setBuckets(new BucketsBuilder()
+                    .setBucket(BindingMap.of(new BucketBuilder()
+                        .setBucketId(new BucketId(Uint32.ZERO))
+                        .setAction(actionBag.build())
+                        .build()))
+                    .build())
                 .build();
     }
 
-    private static Map<Uint32, Group> createGroups(long... groupIds) {
+    private static Map<Uint32, Group> createGroups(final long... groupIds) {
         final Map<Uint32, Group> ret = Maps.newHashMapWithExpectedSize(groupIds.length);
         for (long groupId : groupIds) {
             ret.put(Uint32.valueOf(groupId), createGroup(groupId));
index cb8d107898fd20fd38e06f6e74da6564aa9a4cea..fa6d9b2e56f031e387a6f74c55db2be95e97c594 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.openflowplugin.applications.lldpspeaker;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.infrautils.utils.concurrent.LoggingFutures.addErrorLogging;
 
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -91,7 +91,7 @@ public class LLDPSpeaker implements NodeConnectorEventsObserver, Runnable, AutoC
         return operationalStatus;
     }
 
-    public void setLldpFloodInterval(long time) {
+    public void setLldpFloodInterval(final long time) {
         this.currentFloodPeriod = time;
         scheduledSpeakerTask.cancel(false);
         scheduledSpeakerTask = this.scheduledExecutorService
@@ -193,9 +193,7 @@ public class LLDPSpeaker implements NodeConnectorEventsObserver, Runnable, AutoC
 
     @Override
     public void nodeConnectorRemoved(final InstanceIdentifier<NodeConnector> nodeConnectorInstanceId) {
-        Preconditions.checkNotNull(nodeConnectorInstanceId);
-
-        nodeConnectorMap.remove(nodeConnectorInstanceId);
+        nodeConnectorMap.remove(requireNonNull(nodeConnectorInstanceId));
         NodeConnectorId nodeConnectorId = InstanceIdentifier.keyOf(nodeConnectorInstanceId).getId();
         LOG.trace("Port removed from node-connector map : {}", nodeConnectorId.getValue());
     }
index be483d81995eae418084e502087af9a06e0d5525..6545eec549a3b1b01c532d5f95a166b473593e13 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.openflowplugin.applications.notification.supplier;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -98,12 +99,12 @@ public class NotificationProvider implements AutoCloseable {
      * @param groupStatSupp     - Group Stat Support Flag
      * @param queueStatSupp     - Queue Stat Support Flag
      */
-    public NotificationProvider(final NotificationPublishService nps, final DataBroker db, boolean flowSupp,
-                                boolean meterSupp, boolean groupSupp, boolean connectorStatSupp, boolean flowStatSupp,
-                                boolean flowTableStatSupp, boolean meterStatSupp, boolean groupStatSupp,
-                                boolean queueStatSupp) {
-        this.nps = Preconditions.checkNotNull(nps);
-        this.db = Preconditions.checkNotNull(db);
+    public NotificationProvider(final NotificationPublishService nps, final DataBroker db, final boolean flowSupp,
+                                final boolean meterSupp, final boolean groupSupp, final boolean connectorStatSupp,
+                                final boolean flowStatSupp, final boolean flowTableStatSupp,
+                                final boolean meterStatSupp, final boolean groupStatSupp, final boolean queueStatSupp) {
+        this.nps = requireNonNull(nps);
+        this.db = requireNonNull(db);
         this.config = initializeNotificationProviderConfig(flowSupp, meterSupp, groupSupp, connectorStatSupp,
                                                            flowStatSupp, flowTableStatSupp, meterStatSupp,
                                                            groupStatSupp, queueStatSupp);
@@ -112,15 +113,15 @@ public class NotificationProvider implements AutoCloseable {
     /**
      * Method to initialize NotificationProviderConfig.
      */
-    private NotificationProviderConfig initializeNotificationProviderConfig(boolean hasFlowSupp,
-                                                                            boolean hasMeterSupp,
-                                                                            boolean hasGroupSupp,
-                                                                            boolean hasConnectorStatSupp,
-                                                                            boolean hasFlowStatSupp,
-                                                                            boolean hasFlowTableStatSupp,
-                                                                            boolean hasMeterStatSupp,
-                                                                            boolean hasGroupStatSupp,
-                                                                            boolean hasQueueStatSupp) {
+    private NotificationProviderConfig initializeNotificationProviderConfig(final boolean hasFlowSupp,
+                                                                            final boolean hasMeterSupp,
+                                                                            final boolean hasGroupSupp,
+                                                                            final boolean hasConnectorStatSupp,
+                                                                            final boolean hasFlowStatSupp,
+                                                                            final boolean hasFlowTableStatSupp,
+                                                                            final boolean hasMeterStatSupp,
+                                                                            final boolean hasGroupStatSupp,
+                                                                            final boolean hasQueueStatSupp) {
         NotificationProviderConfig.NotificationProviderConfigBuilder notif
                 = new NotificationProviderConfig.NotificationProviderConfigBuilder();
         notif.setFlowSupport(hasFlowSupp);
index 2c2f4cc4dad5daaa7ce2b21cbe831ca7dc991ff9..50a8920dd81f26f0e36992f84499fea2963b7fe3 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Preconditions;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
@@ -106,8 +108,8 @@ public abstract class AbstractNotificationSupplierBase<O extends DataObject> imp
      * @param path pointer to element
      * @return extracted {@link NodeKey} and wrapped in {@link NodeRef}
      */
-    public static NodeRef createNodeRef(InstanceIdentifier<?> path) {
-        final InstanceIdentifier<Node> nodePath = Preconditions.checkNotNull(path.firstIdentifierOf(Node.class));
+    public static NodeRef createNodeRef(final InstanceIdentifier<?> path) {
+        final InstanceIdentifier<Node> nodePath = requireNonNull(path.firstIdentifierOf(Node.class));
         return new NodeRef(nodePath);
     }
 
@@ -117,8 +119,8 @@ public abstract class AbstractNotificationSupplierBase<O extends DataObject> imp
      * @param path pointer to element
      * @return extracted {@link NodeId}
      */
-    public static NodeId getNodeId(InstanceIdentifier<?> path) {
-        final NodeKey nodeKey = Preconditions.checkNotNull(path.firstKeyOf(Node.class));
+    public static NodeId getNodeId(final InstanceIdentifier<?> path) {
+        final NodeKey nodeKey = requireNonNull(path.firstKeyOf(Node.class));
         return nodeKey.getId();
     }
 }
index bd58e15e0dc585af64bfd8cdfa9644c1490ed430..6e9bdc479a00529d8f611719d51714d7a893aa3b 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -41,14 +42,11 @@ public abstract class AbstractNotificationSupplierForItemRoot<O extends DataObje
     public AbstractNotificationSupplierForItemRoot(final NotificationPublishService notificationProviderService,
                                                    final DataBroker db, final Class<O> clazz) {
         super(db, clazz);
-        this.notificationProviderService = Preconditions.checkNotNull(notificationProviderService);
+        this.notificationProviderService = requireNonNull(notificationProviderService);
     }
 
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<O>> changes) {
-
-        Preconditions.checkNotNull(changes, "Changes may not be null!");
-
+    public void onDataTreeChanged(final Collection<DataTreeModification<O>> changes) {
         for (DataTreeModification<O> change : changes) {
             final InstanceIdentifier<O> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<O> mod = change.getRootNode();
@@ -73,19 +71,19 @@ public abstract class AbstractNotificationSupplierForItemRoot<O extends DataObje
     }
 
 
-    public void add(InstanceIdentifier<O> identifier, O add) {
+    public void add(final InstanceIdentifier<O> identifier, final O add) {
         putNotification(createNotification(add, identifier));
     }
 
-    public void remove(InstanceIdentifier<O> identifier, O del) {
+    public void remove(final InstanceIdentifier<O> identifier, final O del) {
         putNotification(deleteNotification(identifier.firstIdentifierOf(clazz)));
     }
 
-    public void update(InstanceIdentifier<O> identifier, O before, O after) {
+    public void update(final InstanceIdentifier<O> identifier, final O before, final O after) {
         //EMPTY NO-OP
     }
 
-    private void putNotification(Notification notif) {
+    private void putNotification(final Notification notif) {
         if (notif != null) {
             try {
                 notificationProviderService.putNotification(notif);
index 70992eeee0c6665b43b849ada6acea1e2c8a4af1..0192859962c9471641832ad609091e67ae728f3e 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -44,14 +45,11 @@ public abstract class AbstractNotificationSupplierForItem<O extends DataObject,
     public AbstractNotificationSupplierForItem(final NotificationPublishService notifProviderService,
                                                final DataBroker db, final Class<O> clazz) {
         super(db, clazz);
-        this.notificationProviderService = Preconditions.checkNotNull(notifProviderService);
+        this.notificationProviderService = requireNonNull(notifProviderService);
     }
 
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<O>> changes) {
-
-        Preconditions.checkNotNull(changes, "Changes may not be null!");
-
+    public void onDataTreeChanged(final Collection<DataTreeModification<O>> changes) {
         for (DataTreeModification<O> change : changes) {
             final InstanceIdentifier<O> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<O> mod = change.getRootNode();
@@ -75,19 +73,19 @@ public abstract class AbstractNotificationSupplierForItem<O extends DataObject,
         }
     }
 
-    public void add(InstanceIdentifier<O> identifier, O add) {
+    public void add(final InstanceIdentifier<O> identifier, final O add) {
         putNotification(createNotification(add, identifier));
     }
 
-    public void remove(InstanceIdentifier<O> identifier, O del) {
+    public void remove(final InstanceIdentifier<O> identifier, final O del) {
         putNotification(deleteNotification(identifier.firstIdentifierOf(clazz)));
     }
 
-    public void update(InstanceIdentifier<O> identifier, O before, O after) {
+    public void update(final InstanceIdentifier<O> identifier, final O before, final O after) {
         putNotification(updateNotification(after, identifier));
     }
 
-    private void putNotification(Notification notif) {
+    private void putNotification(final Notification notif) {
         if (notif != null) {
             try {
                 notificationProviderService.putNotification(notif);
index c2fa646e29de08b20d9d7c3e29b03d755f699cf5..e86ad1a5ca409a46255d8442495e1427b7982406 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -41,14 +42,11 @@ public abstract class AbstractNotificationSupplierForItemStat<O extends DataObje
     public AbstractNotificationSupplierForItemStat(final NotificationPublishService notifProviderService,
                                                    final DataBroker db, final Class<O> clazz) {
         super(db, clazz);
-        this.notifProviderService = Preconditions.checkNotNull(notifProviderService);
+        this.notifProviderService = requireNonNull(notifProviderService);
     }
 
     @Override
-    public void onDataTreeChanged(Collection<DataTreeModification<O>> changes) {
-
-        Preconditions.checkNotNull(changes, "Changes may not be null!");
-
+    public void onDataTreeChanged(final Collection<DataTreeModification<O>> changes) {
         for (DataTreeModification<O> change : changes) {
             final InstanceIdentifier<O> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<O> mod = change.getRootNode();
@@ -73,7 +71,7 @@ public abstract class AbstractNotificationSupplierForItemStat<O extends DataObje
     }
 
 
-    public void add(InstanceIdentifier<O> identifier, O add) {
+    public void add(final InstanceIdentifier<O> identifier, final O add) {
         final N notif = createNotification(add, identifier);
         if (notif != null) {
             try {
@@ -84,11 +82,11 @@ public abstract class AbstractNotificationSupplierForItemStat<O extends DataObje
         }
     }
 
-    public void remove(InstanceIdentifier<O> identifier, O del) {
+    public void remove(final InstanceIdentifier<O> identifier, final O del) {
         //EMPTY NO-OP
     }
 
-    public void update(InstanceIdentifier<O> identifier, O before, O after) {
+    public void update(final InstanceIdentifier<O> identifier, final O before, final O after) {
         //EMPTY NO-OP
     }
 }
index 6a8328d07310e4da27373c2b09f5bdd4de370dda..feb443be9966d998e39dfed20d5dc172ade87119 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStatsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 
 /**
  * Implementation define a contract between {@link GroupStatistics} data object
@@ -57,8 +58,10 @@ public class GroupStatNotificationSupplierImpl extends AbstractNotificationSuppl
         builder.setId(getNodeId(path));
         builder.setMoreReplies(Boolean.FALSE);
         // TODO : fix if it needs, but we have to ask DataStore for the NodeConnector list
-        builder.setNodeConnector(Collections.emptyList());
-        builder.setGroupStats(Collections.singletonList(new GroupStatsBuilder(groupStatistics).build()));
+        builder.setNodeConnector(Collections.emptyMap());
+        builder.setGroupStats(BindingMap.of(new GroupStatsBuilder(groupStatistics)
+            .setGroupId(path.firstKeyOf(Group.class).getGroupId())
+            .build()));
         return builder.build();
     }
 }
index 945cd042f2c5684b096a5fb96f71cd94d7e29fc6..6613d6b843248c64f23ca94ed5b5edbba0abc981 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 
 /**
  * Implementation define a contract between {@link MeterStatistics} data object
@@ -57,8 +58,10 @@ public class MeterStatNotificationSupplierImpl extends AbstractNotificationSuppl
         builder.setId(getNodeId(path));
         builder.setMoreReplies(Boolean.FALSE);
         // TODO : fix if it needs, but we have to ask DataStore for the NodeConnector list
-        builder.setNodeConnector(Collections.emptyList());
-        builder.setMeterStats(Collections.singletonList(new MeterStatsBuilder(meterStatistics).build()));
+        builder.setNodeConnector(Collections.emptyMap());
+        builder.setMeterStats(BindingMap.of(new MeterStatsBuilder(meterStatistics)
+            .setMeterId(path.firstKeyOf(Meter.class).getMeterId())
+            .build()));
         return builder.build();
     }
 }
index 953079cc40ce4916822cce3633610d9f96864cd1..de2d245cee0910d31112e6761eebd77f7b66e070 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat;
 
 import com.google.common.base.Preconditions;
-import java.util.Collections;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
@@ -20,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.flow.capable.node.connector.statistics.FlowCapableNodeConnectorStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 
 /**
  * Implementation define a contract between {@link FlowCapableNodeConnectorStatistics} data object
@@ -60,13 +60,14 @@ public class NodeConnectorStatNotificationSupplierImpl extends
         ncBuilder.setId(ncKey.getId());
         ncBuilder.withKey(ncKey);
 
-        final NodeConnectorStatisticsUpdateBuilder builder = new NodeConnectorStatisticsUpdateBuilder();
-        builder.setId(getNodeId(path));
-        builder.setMoreReplies(Boolean.FALSE);
-        builder.setNodeConnector(Collections.singletonList(ncBuilder.build()));
-        builder.setNodeConnectorStatisticsAndPortNumberMap(Collections.singletonList(
-                new NodeConnectorStatisticsAndPortNumberMapBuilder(flowCapableNodeConnectorStatistics).build()));
-        return builder.build();
+        return new NodeConnectorStatisticsUpdateBuilder()
+            .setId(getNodeId(path))
+            .setMoreReplies(Boolean.FALSE)
+            .setNodeConnector(BindingMap.of(ncBuilder.build()))
+            .setNodeConnectorStatisticsAndPortNumberMap(BindingMap.of(
+                new NodeConnectorStatisticsAndPortNumberMapBuilder(flowCapableNodeConnectorStatistics)
+                .setNodeConnectorId(ncKey.getId()).build()))
+            .build();
     }
 }
 
index 28281a1e4494904efe60fe780c335b90d4463234..f2ebe3de2f6a930d09053a6e14a17b65711c140b 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat;
 
 import com.google.common.base.Preconditions;
-import java.util.Collections;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
@@ -21,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdateBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 
 /**
  * Implementation define a contract between {@link FlowCapableNodeConnectorQueueStatisticsData} data object
@@ -62,15 +62,16 @@ public class QueueStatNotificationSupplierImpl extends
         connBuilder.setId(key.getId());
         connBuilder.withKey(key);
 
-        final QueueIdAndStatisticsMapBuilder queueStatMapBuilder = new QueueIdAndStatisticsMapBuilder(
-                statisticsDataTreeItem.getFlowCapableNodeConnectorQueueStatistics());
+        final QueueIdAndStatisticsMapBuilder queueStatMapBuilder =
+            new QueueIdAndStatisticsMapBuilder(statisticsDataTreeItem.getFlowCapableNodeConnectorQueueStatistics())
+                .setNodeConnectorId(key.getId()).setQueueId(path.firstKeyOf(Queue.class).getQueueId());
 
-        final QueueStatisticsUpdateBuilder builder = new QueueStatisticsUpdateBuilder();
-        builder.setId(getNodeId(path));
-        builder.setMoreReplies(Boolean.FALSE);
-        builder.setQueueIdAndStatisticsMap(Collections.singletonList(queueStatMapBuilder.build()));
-        builder.setNodeConnector(Collections.singletonList(connBuilder.build()));
-        return builder.build();
+        return new QueueStatisticsUpdateBuilder()
+            .setId(getNodeId(path))
+            .setMoreReplies(Boolean.FALSE)
+            .setQueueIdAndStatisticsMap(BindingMap.of(queueStatMapBuilder.build()))
+            .setNodeConnector(BindingMap.of(connBuilder.build()))
+            .build();
     }
 }
 
index 19976b34e18c439e6dcae8307af5b367689e25d6..a9846d8a0f87fefa93148b150ac7ef9b15bd203b 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper;
 
 import java.util.Collection;
@@ -18,7 +17,7 @@ public final class TestChangeEventBuildHelper {
     }
 
     public static Collection createEmptyTestDataTreeEvent() {
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
 
     public static Collection createNullTestDataTreeEvent() {
index 0337834e90ad3c01ea84f22aec79050932397f00..723f40cb29482be6aa5c7e78f9ec05675600fef6 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat;
 
 import static org.junit.Assert.assertEquals;
@@ -28,6 +27,8 @@ import org.opendaylight.openflowplugin.applications.notification.supplier.impl.h
 import org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestSupplierVerifyHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
@@ -40,6 +41,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.flow.capable.node.connector.queue.statistics.FlowCapableNodeConnectorQueueStatisticsBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class QueueStatNotificationSupplierImplTest {
 
@@ -115,16 +117,13 @@ public class QueueStatNotificationSupplierImplTest {
     private static InstanceIdentifier<FlowCapableNodeConnectorQueueStatisticsData> createTestQueueStatPath() {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId(FLOW_NODE_ID)))
                 .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId(FLOW_CODE_CONNECTOR_ID)))
-                .augmentation(FlowCapableNodeConnector.class).child(Queue.class)
+                .augmentation(FlowCapableNodeConnector.class).child(Queue.class, new QueueKey(new QueueId(Uint32.ZERO)))
                 .augmentation(FlowCapableNodeConnectorQueueStatisticsData.class);
     }
 
     private static FlowCapableNodeConnectorQueueStatisticsData createTestQueueStat() {
-        final FlowCapableNodeConnectorQueueStatisticsDataBuilder builder
-                = new FlowCapableNodeConnectorQueueStatisticsDataBuilder();
-        final FlowCapableNodeConnectorQueueStatisticsBuilder value
-                = new FlowCapableNodeConnectorQueueStatisticsBuilder();
-        builder.setFlowCapableNodeConnectorQueueStatistics(value.build());
-        return builder.build();
+        return new FlowCapableNodeConnectorQueueStatisticsDataBuilder()
+            .setFlowCapableNodeConnectorQueueStatistics(new FlowCapableNodeConnectorQueueStatisticsBuilder().build())
+            .build();
     }
 }
\ No newline at end of file
index 05cd840d1114ee11fc75c64c1747ad7446bc723e..fec549741ea1cd320c8c82deed2fa856fd062e52 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.openflow.ofswitch.config;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
@@ -47,12 +48,11 @@ public class DefaultConfigPusher implements AutoCloseable, ClusteredDataTreeChan
     private ListenerRegistration<?> listenerRegistration;
 
     @Inject
-    public DefaultConfigPusher(NodeConfigService nodeConfigService, @Reference DataBroker dataBroker,
-            @Reference DeviceOwnershipService deviceOwnershipService) {
+    public DefaultConfigPusher(final NodeConfigService nodeConfigService, @Reference final DataBroker dataBroker,
+            @Reference final DeviceOwnershipService deviceOwnershipService) {
         this.nodeConfigService = nodeConfigService;
         this.dataBroker = dataBroker;
-        this.deviceOwnershipService = Preconditions.checkNotNull(deviceOwnershipService,
-                "DeviceOwnershipService can not be null");
+        this.deviceOwnershipService = requireNonNull(deviceOwnershipService, "DeviceOwnershipService can not be null");
     }
 
     @SuppressWarnings("checkstyle:IllegalCatch")
index 7164e63e53a21888cb4b80dbce8a5bf1c2904dea..728e53803462c667cce3ec7dcf29582078387663 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 1b7c67cfcffd515506acc81c0258e70e5df699aa..ae0161edc553ad0df90f01376bb3aa340381bc64 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.reconciliation.cli;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.List;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
@@ -29,9 +29,8 @@ public class GetRegisteredServices extends OsgiCommandSupport {
 
     private ReconciliationManager reconciliationManager;
 
-    public void setReconciliationManager(ReconciliationManager reconciliationManager) {
-        this.reconciliationManager = Preconditions.checkNotNull(reconciliationManager,
-                "ReconciliationManager can not be null!");
+    public void setReconciliationManager(final ReconciliationManager reconciliationManager) {
+        this.reconciliationManager = requireNonNull(reconciliationManager, "ReconciliationManager can not be null!");
     }
 
     @Override
index 3760223f6355bf693ee1305f06b7b0a91d1c1744..1961ce6655b5e31c5cb2b785b7529d010a17d484 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.openflowplugin.applications.reconciliation.impl;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -51,9 +52,9 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
     private final AtomicReference<ResultState> decidedResultState = new AtomicReference<>(ResultState.DONOTHING);
 
     @Inject
-    public ReconciliationManagerImpl(@Reference MastershipChangeServiceManager mastershipChangeServiceManager) {
-        this.mastershipChangeServiceManager = Preconditions
-                .checkNotNull(mastershipChangeServiceManager, "MastershipChangeServiceManager can not be null!");
+    public ReconciliationManagerImpl(@Reference final MastershipChangeServiceManager mastershipChangeServiceManager) {
+        this.mastershipChangeServiceManager = requireNonNull(mastershipChangeServiceManager,
+            "MastershipChangeServiceManager can not be null!");
     }
 
     @PostConstruct
@@ -63,7 +64,7 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
     }
 
     @Override
-    public NotificationRegistration registerService(ReconciliationNotificationListener reconciliationTask) {
+    public NotificationRegistration registerService(final ReconciliationNotificationListener reconciliationTask) {
         LOG.debug("Registered service {} with priority {} and intent {}", reconciliationTask.getName(),
                   reconciliationTask.getPriority(), reconciliationTask.getResultState());
         registeredServices.computeIfAbsent(reconciliationTask.getPriority(), services -> new ArrayList<>())
@@ -78,9 +79,9 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
         return registration;
     }
 
-    private void decideResultState(ResultState resultState) {
+    private void decideResultState(final ResultState resultState) {
         Integer count = resultStateMap.get(resultState);
-        resultStateMap.put(resultState, count = (count == null ? 1 : count + 1));
+        resultStateMap.put(resultState, count = count == null ? 1 : count + 1);
         Map.Entry<ResultState, Integer> maxEntry = null;
         for (Map.Entry<ResultState, Integer> entry : resultStateMap.entrySet()) {
             if (maxEntry == null || entry.getValue() > maxEntry.getValue()) {
@@ -103,13 +104,13 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
     }
 
     @Override
-    public ListenableFuture<ResultState> onDevicePrepared(@NonNull DeviceInfo node) {
+    public ListenableFuture<ResultState> onDevicePrepared(@NonNull final DeviceInfo node) {
         LOG.debug("Triggering reconciliation for node : {}", node.getNodeId());
         return futureMap.computeIfAbsent(node, value -> reconcileNode(node));
     }
 
     @Override
-    public ListenableFuture<Void> onDeviceDisconnected(@NonNull DeviceInfo node) {
+    public ListenableFuture<Void> onDeviceDisconnected(@NonNull final DeviceInfo node) {
         LOG.info("Stopping reconciliation for node {}", node.getNodeId());
         if (futureMap.containsKey(node)) {
             return cancelNodeReconciliation(node);
@@ -117,7 +118,7 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
         return Futures.immediateFuture(null);
     }
 
-    private ListenableFuture<ResultState> reconcileNode(DeviceInfo node) {
+    private ListenableFuture<ResultState> reconcileNode(final DeviceInfo node) {
         ListenableFuture<ResultState> lastFuture = Futures.immediateFuture(null);
         for (List<ReconciliationNotificationListener> services : registeredServices.values()) {
             lastFuture = reconcileServices(lastFuture, services, node);
@@ -125,10 +126,10 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
         return lastFuture;
     }
 
-    private ListenableFuture<ResultState> reconcileServices(ListenableFuture<ResultState> prevFuture,
-                                                            List<ReconciliationNotificationListener>
+    private ListenableFuture<ResultState> reconcileServices(final ListenableFuture<ResultState> prevFuture,
+                                                            final List<ReconciliationNotificationListener>
                                                                     servicesForPriority,
-                                                            DeviceInfo node) {
+                                                            final DeviceInfo node) {
         return Futures.transformAsync(prevFuture, prevResult -> Futures.transform(Futures.allAsList(
                 servicesForPriority.stream().map(service -> service.startReconciliation(node))
                         .collect(Collectors.toList())), results -> decidedResultState.get(),
@@ -136,7 +137,7 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
                                       MoreExecutors.directExecutor());
     }
 
-    private ListenableFuture<Void> cancelNodeReconciliation(DeviceInfo node) {
+    private ListenableFuture<Void> cancelNodeReconciliation(final DeviceInfo node) {
         ListenableFuture<Void> lastFuture = Futures.immediateFuture(null);
         futureMap.get(node).cancel(true);
         futureMap.remove(node);
@@ -146,10 +147,10 @@ public class ReconciliationManagerImpl implements ReconciliationManager, Reconci
         return lastFuture;
     }
 
-    private ListenableFuture<Void> cancelServiceReconciliation(ListenableFuture<Void> prevFuture,
-                                                               List<ReconciliationNotificationListener>
+    private ListenableFuture<Void> cancelServiceReconciliation(final ListenableFuture<Void> prevFuture,
+                                                               final List<ReconciliationNotificationListener>
                                                                        servicesForPriority,
-                                                               DeviceInfo node) {
+                                                               final DeviceInfo node) {
         return Futures.transformAsync(prevFuture, prevResult -> Futures.transform(Futures.allAsList(
                 servicesForPriority.stream().map(service -> service.endReconciliation(node))
                         .collect(Collectors.toList())), results -> null, MoreExecutors.directExecutor()),
index 0c5b574e955a66bc4532959ed8637c8e61f5ae25..088ded9cca975da86e98866ce109205c433eada2 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.tablemissenforcer;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -67,12 +68,11 @@ public class LLDPPacketPuntEnforcer implements AutoCloseable, ClusteredDataTreeC
     private final DeviceOwnershipService deviceOwnershipService;
     private ListenerRegistration<?> listenerRegistration;
 
-    public LLDPPacketPuntEnforcer(SalFlowService flowService, DataBroker dataBroker,
-            DeviceOwnershipService deviceOwnershipService) {
+    public LLDPPacketPuntEnforcer(final SalFlowService flowService, final DataBroker dataBroker,
+            final DeviceOwnershipService deviceOwnershipService) {
         this.flowService = flowService;
         this.dataBroker = dataBroker;
-        this.deviceOwnershipService = Preconditions.checkNotNull(deviceOwnershipService,
-                "DeviceOwnershipService can not be null");
+        this.deviceOwnershipService = requireNonNull(deviceOwnershipService, "DeviceOwnershipService can not be null");
     }
 
     @SuppressWarnings("IllegalCatch")
index 09bab6b3418a300d4fff6ae1f13d7e37c874bb2d..76161fc21541b32e2ca496e98519044714afd8bb 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.applications.topology.lldp.utils;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.hash.HashCode;
 import com.google.common.hash.HashFunction;
 import com.google.common.hash.Hasher;
@@ -62,7 +63,7 @@ public final class LLDPDiscoveryUtils {
      * @return nodeConnectorId - encoded in custom TLV of given lldp
      * @see LLDPDiscoveryUtils#lldpToNodeConnectorRef(byte[], boolean)
      */
-    public static NodeConnectorRef lldpToNodeConnectorRef(byte[] payload)  {
+    public static NodeConnectorRef lldpToNodeConnectorRef(final byte[] payload)  {
         return lldpToNodeConnectorRef(payload, false);
     }
 
@@ -74,7 +75,8 @@ public final class LLDPDiscoveryUtils {
      * @return nodeConnectorId - encoded in custom TLV of given lldp
      */
     @SuppressWarnings("checkstyle:IllegalCatch")
-    public static NodeConnectorRef lldpToNodeConnectorRef(byte[] payload, boolean useExtraAuthenticatorCheck)  {
+    public static NodeConnectorRef lldpToNodeConnectorRef(final byte[] payload,
+            final boolean useExtraAuthenticatorCheck)  {
         NodeConnectorRef nodeConnectorRef = null;
 
         if (isLLDP(payload)) {
@@ -152,7 +154,7 @@ public final class LLDPDiscoveryUtils {
     }
 
     public static boolean isEntityOwned(final EntityOwnershipService eos, final String nodeId) {
-        Preconditions.checkNotNull(eos, "Entity ownership service must not be null");
+        requireNonNull(eos, "Entity ownership service must not be null");
 
         EntityOwnershipState state = null;
         Optional<EntityOwnershipState> status = getCurrentOwnershipStatus(eos, nodeId);
@@ -165,7 +167,7 @@ public final class LLDPDiscoveryUtils {
     }
 
     public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819
-            .LinkDiscovered toLLDPLinkDiscovered(Link link) {
+            .LinkDiscovered toLLDPLinkDiscovered(final Link link) {
         return new LinkDiscoveredBuilder()
                 .setSource(getNodeConnectorRefFromLink(link.getSource().getSourceTp(),
                         link.getSource().getSourceNode()))
@@ -190,7 +192,7 @@ public final class LLDPDiscoveryUtils {
         return ethernetType == ETHERNET_TYPE_LLDP;
     }
 
-    private static boolean checkExtraAuthenticator(LLDP lldp, NodeConnectorId srcNodeConnectorId) {
+    private static boolean checkExtraAuthenticator(final LLDP lldp, final NodeConnectorId srcNodeConnectorId) {
         final LLDPTLV hashLldptlv = lldp.getCustomTLV(LLDPTLV.createSecSubTypeCustomTLVKey());
         boolean secAuthenticatorOk = false;
         if (hashLldptlv != null) {
index 423e404c69bc95e97fec948bc3e83421ac0799e1..15b0c1a059ec254aa4ad1e27f98b73ca7bd2eb44 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.openflowplugin.applications.topology.manager;
 
+import static java.util.Objects.requireNonNull;
 import static org.opendaylight.openflowplugin.applications.topology.manager.FlowCapableNodeMapping.toTopologyLink;
 
-import com.google.common.base.Preconditions;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -31,10 +31,9 @@ class FlowCapableTopologyExporter implements FlowTopologyDiscoveryListener {
     private final InstanceIdentifier<Topology> iiToTopology;
     private final OperationProcessor processor;
 
-    FlowCapableTopologyExporter(final OperationProcessor processor,
-            final InstanceIdentifier<Topology> topology) {
-        this.processor = Preconditions.checkNotNull(processor);
-        this.iiToTopology = Preconditions.checkNotNull(topology);
+    FlowCapableTopologyExporter(final OperationProcessor processor, final InstanceIdentifier<Topology> topology) {
+        this.processor = requireNonNull(processor);
+        this.iiToTopology = requireNonNull(topology);
     }
 
     @Override
index a53ddc789ae5531cd5aed111dab212551b2c5c56..4d1d62a189c0c67ba2419ab032a119379de4a46e 100644 (file)
@@ -36,11 +36,12 @@ 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.TopologyKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 
 public abstract class DataTreeChangeListenerBase {
 
     private OperationProcessor processor;
-    protected InstanceIdentifier<Topology> topologyIID;
+    protected KeyedInstanceIdentifier<Topology, TopologyKey> topologyIID;
     protected TerminationPointChangeListenerImpl terminationPointListener;
     protected NodeChangeListenerImpl nodeChangeListener;
     private final ExecutorService executor = Executors.newFixedThreadPool(1);
index bc7f67b8a0952f2e7c48a8ce6f7514f345d83440..27c6a821c7fbd37c5122ac3a1af9d06599f05a4b 100644 (file)
@@ -70,7 +70,7 @@ public class NodeChangeListenerImplTest extends DataTreeChangeListenerBase {
                 newLink("link1", newSourceNode("node1"), newDestNode("dest")),
                 newLink("link2", newSourceNode("source"), newDestNode("node1")),
                 newLink("link3", newSourceNode("source2"), newDestNode("dest2")));
-        final Topology topology = new TopologyBuilder().setLink(linkList).build();
+        final Topology topology = new TopologyBuilder().withKey(topologyIID.getKey()).setLink(linkList).build();
 
         final InstanceIdentifier[] expDeletedIIDs = {
                 topologyIID.child(Link.class, linkList.get(0).key()),
index 92ab192d3b28864492fb5b40935fe6430b087c24..95037655a2426068e95b4b89b523f37d68fd0566 100644 (file)
@@ -81,7 +81,7 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
                 newLink("link1", newSourceTp("tp1"), newDestTp("dest")),
                 newLink("link2", newSourceTp("source"), newDestTp("tp1")),
                 newLink("link3", newSourceTp("source2"), newDestTp("dest2")));
-        final Topology topology = new TopologyBuilder().setLink(linkList).build();
+        final Topology topology = new TopologyBuilder().withKey(topologyIID.getKey()).setLink(linkList).build();
 
         final InstanceIdentifier[] expDeletedIIDs = {
                 topologyIID.child(Link.class, linkList.get(0).key()),
@@ -220,7 +220,7 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         final InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
 
         List<Link> linkList = Arrays.asList(newLink("link1", newSourceTp("tp1"), newDestTp("dest")));
-        Topology topology = new TopologyBuilder().setLink(linkList).build();
+        Topology topology = new TopologyBuilder().withKey(topologyIID.getKey()).setLink(linkList).build();
 
         ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
         doReturn(FluentFutures.immediateFluentFuture(Optional.of(topology))).when(mockTx)
@@ -265,7 +265,7 @@ public class TerminationPointChangeListenerImplTest extends DataTreeChangeListen
         final InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
 
         List<Link> linkList = Arrays.asList(newLink("link1", newSourceTp("tp1"), newDestTp("dest")));
-        Topology topology = new TopologyBuilder().setLink(linkList).build();
+        Topology topology = new TopologyBuilder().withKey(topologyIID.getKey()).setLink(linkList).build();
 
         ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
         doReturn(FluentFutures.immediateFluentFuture(Optional.of(topology))).when(mockTx)
index 9ca950e19af3594e2082399aa56c16bb87961055..95e4061f8136aa984972f76e98a1489bdc643118 100644 (file)
@@ -13,7 +13,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>7.0.6</version>
+    <version>8.0.0</version>
     <relativePath/>
   </parent>
 
index 7441d5ae59400969eceeed89ad40d9b583fb92d8..0fb0a86e750b22fd0695b57d7c05c4378af44bbe 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>7.0.6</version>
+    <version>8.0.0</version>
   </parent>
   <groupId>org.opendaylight.openflowplugin</groupId>
   <artifactId>openflowplugin-karaf</artifactId>
index 52444b4e223064da99c289ea82bffa25988b8c13..a22eb95f2a98de6011035390143d643ad3b4a8ae 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.droptestkaraf;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationService;
 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
@@ -31,9 +31,9 @@ public class DropTestProviderImpl implements AutoCloseable {
     public DropTestProviderImpl(final DataBroker dataBroker,
                                 final NotificationService notificationService,
                                 final SalFlowService salFlowService) {
-        Preconditions.checkNotNull(dataBroker, "Data broker can't be empty");
-        Preconditions.checkNotNull(notificationService, "NotificationProviderService can't be empty");
-        Preconditions.checkNotNull(salFlowService, "SalFlowService can't be empty");
+        requireNonNull(dataBroker, "Data broker can't be empty");
+        requireNonNull(notificationService, "NotificationProviderService can't be empty");
+        requireNonNull(salFlowService, "SalFlowService can't be empty");
 
         LOG.debug("Activator DropAllPack INIT");
 
index 153d7d46ae9b9a4140a59515d05841254095aa2f..c7e081cfb393ea8859ad23579130885343590ec1 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 05ebd9b9b975deec2cd8181599fc1b42cdecce86..3c9348fa8c70d176fc6cb2008c533033240282f5 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 3d91c236c80137dfa4a598994193237bade549dd..85c93911a984191d299f0b72d91aae25caf02961 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 3c7eb71580cc4c29ce19a1a7d7297facd4a61f07..10c5f2e38a29986ba10039e5f2cff767a27b623c 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 67c5498be84abc21fa08da9ee86cc0c51c02dea5..6f70435dca5ca584dd55675c665032e614edfdb4 100644 (file)
@@ -3,7 +3,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
     <modelVersion>4.0.0</modelVersion>
index 941e451c263b981e9a38ed7733c0e11f2ff51406..d40b22ee0bf83579488ef81a5c94b4ef7ce886a4 100644 (file)
     <artifactId>openflowjava-extension-eric</artifactId>
     <packaging>bundle</packaging>
 
+    <properties>
+        <!-- FIXME: Remove this -->
+        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>${project.groupId}.openflowjava</groupId>
index da691fdcaa9835e0ab79d1010688984a97e40ec8..f1c47e6c262728f05e5fbfc748cc3e0e5b156661 100644 (file)
     <artifactId>openflowjava-extension-nicira</artifactId>
     <packaging>bundle</packaging>
 
+    <properties>
+        <!-- FIXME: Remove this -->
+        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>${project.groupId}.openflowjava</groupId>
index dd1d80cb58dc14f2184fba4f520221f7218d635a..b33295e8b05e57975b8c9f59e6eb88d20998559f 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.openflowplugin.extension.vendor.eric;
 
-import com.google.common.base.Preconditions;
-import java.util.HashSet;
-import java.util.Set;
+import static java.util.Objects.requireNonNull;
+
+import java.util.List;
 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDOptionsTypeCodec;
 import org.opendaylight.openflowjava.eric.codec.match.Icmpv6NDReservedCodec;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -33,26 +33,22 @@ public class EricExtensionProvider implements AutoCloseable {
             = new Icmpv6NDOptionsTypeConvertor();
 
     private final ExtensionConverterRegistrator extensionConverterRegistrator;
-    private final Set<ObjectRegistration<?>> registrations;
+    private final List<ObjectRegistration<?>> registrations;
 
     /**
      * Register appropriate converters.
      */
     public EricExtensionProvider(final OpenFlowPluginExtensionRegistratorProvider provider) {
-        this.extensionConverterRegistrator = Preconditions.checkNotNull(provider.getExtensionConverterRegistrator());
-        registrations = new HashSet<>();
-
-        registrations.add(extensionConverterRegistrator.registerMatchConvertor(
-                new ConverterExtensionKey<>(Icmpv6NdReservedKey.class, EncodeConstants.OF13_VERSION_ID),
-                ICMPV6_ND_RESERVED_CONVERTOR));
-        registrations.add(extensionConverterRegistrator.registerMatchConvertor(Icmpv6NDReservedCodec.SERIALIZER_KEY,
-                ICMPV6_ND_RESERVED_CONVERTOR));
-
-        registrations.add(extensionConverterRegistrator.registerMatchConvertor(
-                new ConverterExtensionKey<>(Icmpv6NdOptionsTypeKey.class, EncodeConstants.OF13_VERSION_ID),
-                ICMPV6_ND_OPTIONS_TYPE_CONVERTOR));
-        registrations.add(extensionConverterRegistrator.registerMatchConvertor(Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY,
-                ICMPV6_ND_OPTIONS_TYPE_CONVERTOR));
+        this.extensionConverterRegistrator = requireNonNull(provider.getExtensionConverterRegistrator());
+        registrations = List.of(
+            extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(
+                Icmpv6NdReservedKey.class, EncodeConstants.OF13_VERSION_ID), ICMPV6_ND_RESERVED_CONVERTOR),
+            extensionConverterRegistrator.registerMatchConvertor(
+                Icmpv6NDReservedCodec.SERIALIZER_KEY, ICMPV6_ND_RESERVED_CONVERTOR),
+            extensionConverterRegistrator.registerMatchConvertor(new ConverterExtensionKey<>(
+                Icmpv6NdOptionsTypeKey.class, EncodeConstants.OF13_VERSION_ID), ICMPV6_ND_OPTIONS_TYPE_CONVERTOR),
+            extensionConverterRegistrator.registerMatchConvertor(
+                Icmpv6NDOptionsTypeCodec.SERIALIZER_KEY, ICMPV6_ND_OPTIONS_TYPE_CONVERTOR));
     }
 
     @Override
index c630d53f07b37a40cc537f6b5797bb77698f7326..014dfffc71b7736b7a51e4b77c680420d6197552 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.extension.vendor.nicira;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.HashSet;
 import java.util.Set;
 import org.opendaylight.openflowjava.nx.api.NiciraUtil;
@@ -362,7 +363,7 @@ public class NiciraExtensionProvider implements AutoCloseable {
      * Register appropriate converters.
      */
     public NiciraExtensionProvider(final OpenFlowPluginExtensionRegistratorProvider provider) {
-        this.extensionConverterRegistrator = Preconditions.checkNotNull(provider.getExtensionConverterRegistrator());
+        this.extensionConverterRegistrator = requireNonNull(provider.getExtensionConverterRegistrator());
         registrations = new HashSet<>();
         // src=dataStore/config
         registerAction13(NxActionRegLoadNodesNodeTableFlowApplyActionsCase.class, REG_LOAD_CONVERTOR_PROXY);
@@ -730,8 +731,8 @@ public class NiciraExtensionProvider implements AutoCloseable {
         registrations.add(extensionConverterRegistrator.registerActionConvertor(key, actionConvertor));
     }
 
-    private void registerAction13(Class<? extends ActionChoice> actionCaseType,
-        ConvertorActionFromOFJava<
+    private void registerAction13(final Class<? extends ActionChoice> actionCaseType,
+        final ConvertorActionFromOFJava<
                 org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action,
                 ActionPath> actionConvertor) {
         ActionSerializerKey<?> key = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, actionCaseType,
index fc038ea1b1f45dc87d5331a5ef2d89b99ebe410f..ccdb47c3b8c9ae9143969fdf8a0fd84c1291cadc 100644 (file)
     <artifactId>openflowplugin-extension-onf</artifactId>
     <packaging>bundle</packaging>
 
+    <properties>
+        <!-- FIXME: Remove this -->
+        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
index 79767162b8401724a59e78080fef5b0bd738d94e..97a1b8e003545062048e3eaf19733a24fa30aae9 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index b2c2693a147c7b9549495b425fc5a0ed73d8085d..26516917a7897ed0f127eaf1f2d1bc9ca97f9ff9 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index e6b6aa8e2626a8bb4a395c598a0b8224a188ae76..7fb53fefaf1f4fdcb9c2d5591784b5241f66036f 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 2d4b63e52987bf2a0f172855c81ee3833fab6189..e8ba0562a6867ec808c911905a6d90953d09a74e 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index d43752545e223b81126a7221c69968627b744993..1cd4225f9d1fae3c6eb1b8fdd013c3f778a3458b 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index cb093cf9ff50cb96ae8f329cb33786bd739833b0..83f4a6fb23893d203a675198b8d90d23ced80d7b 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 5ade8e26cdc402761f0c8cdff3dfa865ab6a6415..5ccb7fdc19f664da2c6de4f1f82fcbb98629cee9 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 398c2921f9d98faccc6c45fb9373dac3eb993a17..595b356ee6fbcc603e9767753930a75e290b5bc4 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 2dba3024057261bf4756e154621bc89f67d6e747..cd19f04a281d77081f35f840dce7b3dd102d945e 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index f8bb1ea26b22daf4f9192d5c44a30f3bf580e620..6f6fac05b2c7bc0109558918919a1d00b26b1dbb 100644 (file)
@@ -4,7 +4,7 @@
 <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>7.0.6</version>
+    <version>8.0.0</version>
     <relativePath/>
 </parent>
 
index 78d7ce8494c379cf25a5c3b11375e260c7851f45..d629c5cd601c5a54c8cd4d93c57ddeddfff3c5f1 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 68b21d7f0c0989bebd1a9298cae5556d02acc01e..4e3b863ec964ea33ec508d8ce9298b5b2e6536e1 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 293cb04da03b45cc03343db092cd402d460b89cb..ef2960e2ff23dfca97b6105918773344d08aa58a 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 4855d991989a4935a79892272104530f941480fc..a7e9946f090695914e44d7fcd5729084008a0ed9 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 58abe1281d7ff9ac1921f9caab1f98f7683cee1e..1754c472ed6fcc7bd1a10cc9bbad4fb774eaab38 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 47576ee346c04cc9a15cd637ea3a971e68ad020e..16306bccbb3d0847170239c089938fa9815ef444 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index fc45e76eb3651a0148ecb1c6484cde07d4481df0..91944a461fafba7c2164adcd3b2ec36752aa1979 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index c0b187a36dd21972666a341487af0b51b547571b..3d956a5c950364b87aa703603117dcc4d2640c71 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 7cb17de7f89f46b94f73462a1fb903e8210c77c5..89e62946421aff1d55f070ff593ce5734a83a95c 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 912b3205d61818449b21942046145497d39b8e47..dd60d8a87b290720843086d38e9ca73fabb99407 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-libraries">
     <feature name="odl-openflowplugin-libraries">
-        <feature version="[7,8)">odl-guava</feature>
+        <feature version="[8,9)">odl-guava</feature>
     </feature>
 </features>
index 1ec314ea4c93386c888790de53834de4a24f5ad0..ef55a236b15f26df9ae1e52cfdde30e726197484 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
@@ -21,7 +21,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>6.0.5</version>
+                <version>7.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>2.0.4</version>
+                <version>3.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index ca8b11ab2c65b179f1ae835d95a8b22eb204a1ff..f110309bd1a8d925785869f20f5dba6567671b99 100644 (file)
@@ -1,8 +1,8 @@
 <?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="[6,7)">odl-mdsal-model-odl-l2-types</feature>
-        <feature version="[2,3)">odl-mdsal-model-inventory</feature>
-        <feature version="[2,3)">odl-controller-model-topology</feature>
+        <feature version="[7,8)">odl-mdsal-model-odl-l2-types</feature>
+        <feature version="[3,4)">odl-mdsal-model-inventory</feature>
+        <feature version="[3,4)">odl-controller-model-topology</feature>
     </feature>
 </features>
index 50183ca1d8eae5a7771ca7abfaea0d1cc2b90588..19f62a7bc2553161d0f579a1c65b36cf6356c9d0 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>2.0.4</version>
+                <version>3.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.infrautils</groupId>
                 <artifactId>infrautils-artifacts</artifactId>
-                <version>1.8.1</version>
+                <version>1.9.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 526f6b06f3676bb0efb81e89094fe6f3a88ca0c8..e4421668a0595f671c3f7c90dd96ed6439d6a3de 100644 (file)
@@ -2,6 +2,6 @@
 <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="[2,3)">odl-mdsal-broker</feature>
+        <feature version="[3,4)">odl-mdsal-broker</feature>
     </feature>
 </features>
index a289e7e2b586ec114825571584684ca96fa7aa25..8114542fc3ae9f7de22719b37027a6a073a37ab7 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index be580a695284c196fdddc8aff82a22e70ebda57e..f6d4989b483ee528657c373592c5e98360ec92a5 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 85b0176c627e7a33e0132f69090d68d498b9cc1d..a808424b2948ac3a0356bbd4d9b365d8779716d3 100644 (file)
@@ -6,7 +6,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>7.0.6</version>
+    <version>8.0.0</version>
     <relativePath/>
   </parent>
 
index c37ec45d0162597488c21f2c7af8548c7702adab..46630cb07b0bb5a301ecfbae7d89e3cac49b91a6 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>7.0.6</version>
+    <version>8.0.0</version>
     <relativePath/>
   </parent>
 
index 6d345be71e8c7d072fb9e2262a6c1b140147218e..bbd876980c6a97c49a58e2c2d268791056bfef76 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
@@ -33,7 +33,7 @@
             <dependency>
                 <groupId>org.opendaylight.infrautils</groupId>
                 <artifactId>infrautils-artifacts</artifactId>
-                <version>1.8.1</version>
+                <version>1.9.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
@@ -42,7 +42,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>6.0.5</version>
+                <version>7.0.0</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index f3b7a4b424de096c37db0ab400ce1b2f38094d62..90bb603dc48a7a672b64d4a148053e5045ebe5cb 100644 (file)
@@ -4,7 +4,7 @@
     <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="[7,8)">odl-netty-4</feature>
-        <feature version="[6,7)">odl-mdsal-model-rfc6991</feature>
+        <feature version="[8,9)">odl-netty-4</feature>
+        <feature version="[7,8)">odl-mdsal-model-rfc6991</feature>
     </feature>
 </features>
index 29f099f25a8fd734e8c4e750d67f829710942c2c..94a1a78e1afb4aeafd02eb17e2d95329945010d9 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>7.0.6</version>
+    <version>8.0.0</version>
     <relativePath/>
   </parent>
 
index 0c997388f2e4a43611c62767b828cae0e10f4988..86dbeb87aaea10e7c503f3f5716f2c6d12809008 100644 (file)
       <tag>HEAD</tag>
     </scm>
 
+    <properties>
+        <!-- FIXME: Remove this -->
+        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+    </properties>
+
     <build>
         <plugins>
             <plugin>
index e1844943faea5015b609eb1eab419874a9b5c030..0443c877e397c078de2622aeb51ddb84a7846718 100644 (file)
     <artifactId>openflowplugin-impl</artifactId>
     <packaging>bundle</packaging>
 
+    <properties>
+        <!-- FIXME: Remove this -->
+        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
index 17e77afea9b5e4a23d54840ea4990bdaa1cb1df9..4f32dcdc641c1b1341a2dcb7fe80a651cff3e53f 100644 (file)
@@ -12,11 +12,14 @@ import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationS
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type;
 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.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.binding.AbstractAugmentable;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
-public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
+// FIXME: Rename this to "ConfigurationOpenflowProviderConfig" or some such. OpenFlowProviderConfigImpl is taken as
+//        Builder-based (guaranteed to work).
+public class OpenFlowProviderConfigImpl extends AbstractAugmentable<OpenflowProviderConfig>
+        implements OpenflowProviderConfig {
     private final ConfigurationService service;
 
     public OpenFlowProviderConfigImpl(final ConfigurationService service) {
@@ -25,11 +28,8 @@ public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
 
     @Override
     public NonZeroUint16Type getRpcRequestsQuota() {
-        final Integer property = service.getProperty(
-                ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(),
-                Integer::valueOf);
-
-        return new NonZeroUint16Type(property);
+        return new NonZeroUint16Type(service.<Uint16>getProperty(
+            ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(), Uint16::valueOf));
     }
 
     @Override
@@ -85,43 +85,31 @@ public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
 
     @Override
     public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(), Uint32::valueOf));
     }
 
     @Override
     public NonZeroUint16Type getBarrierCountLimit() {
-        final Integer property = service.getProperty(
-                ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
-                Integer::valueOf);
-
-        return new NonZeroUint16Type(property);
+        return new NonZeroUint16Type(service.<Uint16>getProperty(
+            ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(), Uint16::valueOf));
     }
 
     @Override
     public NonZeroUint32Type getEchoReplyTimeout() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(), Uint32::valueOf));
     }
 
     @Override
     public Uint16 getThreadPoolMinThreads() {
-        return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Uint16::valueOf);
+        return service.<Uint16>getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Uint16::valueOf);
     }
 
     @Override
     public NonZeroUint16Type getThreadPoolMaxThreads() {
-        final Integer property = service.getProperty(
-                ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
-                Integer::valueOf);
-
-        return new NonZeroUint16Type(property);
+        return new NonZeroUint16Type(service.<Uint16>getProperty(
+            ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(), Uint16::valueOf));
     }
 
     @Override
@@ -146,20 +134,14 @@ public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
 
     @Override
     public NonZeroUint32Type getBasicTimerDelay() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.BASIC_TIMER_DELAY.toString(), Uint32::valueOf));
     }
 
     @Override
     public NonZeroUint32Type getMaximumTimerDelay() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(), Uint32::valueOf));
     }
 
     @Override
@@ -167,32 +149,22 @@ public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
         return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
     }
 
-    @Override
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .openflow.provider.config.rev160510.OpenflowProviderConfig>> E augmentation(
-                    final java.lang.Class<E> augmentationType) {
-        return null;
-    }
-
     @Override
     public Uint16 getDeviceConnectionRateLimitPerMin() {
-        return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(),
-                Uint16::valueOf);
+        return service.getProperty(
+            ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(), Uint16::valueOf);
     }
 
     @Override
     public Uint16 getDeviceConnectionHoldTimeInSeconds() {
-        return service.getProperty(ConfigurationProperty.DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS.toString(),
-                Uint16::valueOf);
+        return service.getProperty(
+            ConfigurationProperty.DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS.toString(), Uint16::valueOf);
     }
 
     @Override
     public NonZeroUint32Type getDeviceDatastoreRemovalDelay() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.DEVICE_DATASTORE_REMOVAL_DELAY.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.DEVICE_DATASTORE_REMOVAL_DELAY.toString(), Uint32::valueOf));
     }
 
     @Override
index 02a52d0ad7bfcdac0a8b318cb6fb61fe717bcda2..fe3b14eadd233b5794c9df63ffa452f28350d97e 100644 (file)
@@ -25,7 +25,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class FlowStatsMultipartWriter extends AbstractMultipartWriter<FlowAndStatisticsMapList> {
-
     private final DeviceRegistry registry;
     private final short version;
 
@@ -48,6 +47,7 @@ public class FlowStatsMultipartWriter extends AbstractMultipartWriter<FlowAndSta
         statistics.nonnullFlowAndStatisticsMapList()
             .forEach(stat -> {
                 final FlowBuilder flow = new FlowBuilder(stat)
+                        .withKey(FlowRegistryKeyFactory.DUMMY_FLOW_KEY)
                         .addAugmentation(new FlowStatisticsDataBuilder()
                             .setFlowStatistics(new FlowStatisticsBuilder(stat).build())
                             .build());
index 06ff776070885cd5a97a0ce8acaadc82fac9a361..25aa3b4e0ed060dd766147a00dedff16350d5a20 100644 (file)
@@ -51,7 +51,7 @@ public abstract class AbstractDeviceInitializer {
                     .getNodeInstanceIdentifier(),
                 new NodeBuilder()
                     .setId(deviceContext.getDeviceInfo().getNodeId())
-                    .setNodeConnector(Collections.emptyList())
+                    .setNodeConnector(Collections.emptyMap())
                     .build());
         } catch (final Exception e) {
             LOG.warn("Failed to write node {} to DS ", deviceContext.getDeviceInfo().getNodeId(), e);
index cf0e004d1a0a362dff022a678f319798567e4910..9cdc7596ad13cc32c78b82e9e528b494ab40d2f5 100644 (file)
@@ -215,8 +215,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker
     }
 
     @Override
-    public void onNotAbleToStartMastership(@NonNull final DeviceInfo deviceInfo, @NonNull final String reason,
-                                           final boolean mandatory) {
+    public void onNotAbleToStartMastership(final DeviceInfo deviceInfo, final String reason, final boolean mandatory) {
         LOG.error("Not able to set MASTER role on device {}, reason: {}", deviceInfo, reason);
 
         if (!mandatory) {
index e13e9a3985502c6b8f71c4c3843d964486042260..49c1ee982e856742d7908ec3ebee3148dc9ed652 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -23,7 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 public class Ipv4DestinationEntryDeserializer extends AbstractMatchEntryDeserializer {
 
     @Override
-    public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
+    public void deserializeEntry(final ByteBuf message, final MatchBuilder builder) {
         final boolean hasMask = processHeader(message);
         final Ipv4Address address = ByteBufUtils.readIetfIpv4Address(message);
 
@@ -40,8 +39,7 @@ public class Ipv4DestinationEntryDeserializer extends AbstractMatchEntryDeserial
         }
     }
 
-    private static void setPrefixMatch(final MatchBuilder builder, final Ipv4Address address, @Nullable final byte[]
-            mask) {
+    private static void setPrefixMatch(final MatchBuilder builder, final Ipv4Address address, final byte[] mask) {
         if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv4MatchBuilder()
                     .setIpv4Destination(IpConversionUtil.createPrefix(address, mask))
index 73d1986cb280aae8320cb159c80a2747801f4ee6..2672e895a7c6113453d43e70fe5ba541a081dc66 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
 import org.opendaylight.openflowplugin.impl.protocol.deserialization.util.ActionUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.BucketId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupMessageBuilder;
@@ -28,6 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.BucketBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupModCommand;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class GroupMessageDeserializer implements OFDeserializer<GroupMessage>, DeserializerRegistryInjector {
 
@@ -45,7 +47,7 @@ public class GroupMessageDeserializer implements OFDeserializer<GroupMessage>, D
     private DeserializerRegistry registry;
 
     @Override
-    public GroupMessage deserialize(ByteBuf message) {
+    public GroupMessage deserialize(final ByteBuf message) {
         final GroupMessageBuilder builder = new GroupMessageBuilder()
             .setVersion((short) EncodeConstants.OF13_VERSION_ID)
             .setXid(message.readUnsignedInt())
@@ -88,7 +90,7 @@ public class GroupMessageDeserializer implements OFDeserializer<GroupMessage>, D
                 bucket.setAction(actions);
             }
 
-            buckets.add(bucket.build());
+            buckets.add(bucket.setBucketId(new BucketId(Uint32.valueOf(buckets.size()))).build());
         }
 
         buckets.sort(COMPARATOR);
@@ -100,7 +102,7 @@ public class GroupMessageDeserializer implements OFDeserializer<GroupMessage>, D
     }
 
     @Override
-    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
+    public void injectDeserializerRegistry(final DeserializerRegistry deserializerRegistry) {
         registry = deserializerRegistry;
     }
 
index 796b0cba0344a80e9a204519339083be3aaea9b0..83b9764d7608198d022d04d7cec57b2a0483e305 100644 (file)
@@ -5,11 +5,9 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.serialization.match;
 
 import io.netty.buffer.ByteBuf;
-import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
 import org.opendaylight.yangtools.yang.common.Uint16;
 
@@ -20,7 +18,7 @@ public abstract class AbstractPortNumberWithMaskEntrySerilizer
     }
 
     @Override
-    protected void serializeEntry(@NonNull Layer4Match entry, @NonNull Uint16 mask, @NonNull ByteBuf outBuffer) {
+    protected void serializeEntry(final Layer4Match entry, final Uint16 mask, final ByteBuf outBuffer) {
         Uint16 portMask = extractMask(entry);
         Uint16 port = extractPort(entry);
         if (port != null) {
@@ -31,7 +29,8 @@ public abstract class AbstractPortNumberWithMaskEntrySerilizer
         }
     }
 
-    protected  Uint16 extractEntryMask(@NonNull Layer4Match entry) {
+    @Override
+    protected Uint16 extractEntryMask(final Layer4Match entry) {
         return extractMask(entry);
     }
 
index f796080517503f24283d979faf8b1f6c1bf55c0e..f695ac656b5e2cd2e1fcad4e1086787e9af03adf 100644 (file)
@@ -15,6 +15,8 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
 import org.opendaylight.openflowplugin.impl.util.MatchNormalizationUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow;
@@ -24,6 +26,10 @@ import org.opendaylight.yangtools.yang.common.Uint64;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public final class FlowRegistryKeyFactory {
+    // Temporary use, we will overwrite this. We do not have a flow ID and are about to make one up
+    // from the contents -- but for that we need a Flow object. But for that we need a FlowId, but
+    // ... so we set a dummy value and overwrite it afterwards.
+    public static final FlowKey DUMMY_FLOW_KEY = new FlowKey(new FlowId("__DUMMY_ID_FOR_ALIEN__"));
 
     private FlowRegistryKeyFactory() {
         // Hide implicit constructor
index 09a68004246e7b7d057f6083d70fc1c94b1af2d4..aa1bb6f3a1cb1fb31179419b96832262ec6e04e6 100644 (file)
@@ -42,11 +42,13 @@ public abstract class AbstractFlowDirectStatisticsService<T extends OfHeader>
      * @param flowStatistics flow statistics
      * @return generated flow ID
      */
-    protected FlowId generateFlowId(FlowAndStatisticsMapList flowStatistics) {
+    protected FlowId generateFlowId(final FlowAndStatisticsMapList flowStatistics) {
         final FlowStatisticsDataBuilder flowStatisticsDataBld = new FlowStatisticsDataBuilder()
                 .setFlowStatistics(new FlowStatisticsBuilder(flowStatistics).build());
 
-        final FlowBuilder flowBuilder = new FlowBuilder(flowStatistics).addAugmentation(flowStatisticsDataBld.build());
+        final FlowBuilder flowBuilder = new FlowBuilder(flowStatistics)
+            .withKey(FlowRegistryKeyFactory.DUMMY_FLOW_KEY)
+            .addAugmentation(flowStatisticsDataBld.build());
 
         final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(getVersion(), flowBuilder.build());
 
index 3e672beef5179709ffcf032fa4a295c2529b4910..5518ed26fdeb6a36ef223d4c7608819542971cdf 100644 (file)
@@ -89,7 +89,7 @@ public class OpenFlowPluginProviderImplTest {
     private static final int RPC_REQUESTS_QUOTA = 500;
     private static final long GLOBAL_NOTIFICATION_QUOTA = 131072;
     private static final Uint16 THREAD_POOL_MIN_THREADS = Uint16.ONE;
-    private static final int THREAD_POOL_MAX_THREADS = 32000;
+    private static final Uint16 THREAD_POOL_MAX_THREADS = Uint16.valueOf(32000);
     private static final Uint32 THREAD_POOL_TIMEOUT = Uint32.valueOf(60);
     private static final long BASIC_TIMER_DELAY = 1L;
     private static final boolean USE_SINGLE_LAYER_SERIALIZATION = false;
index e16908634b3a0d9cc4aed21b0ee6ef0ffac5e435..a65da43644b67f51ede3d10ecf25a135d13b8557 100644 (file)
@@ -27,24 +27,24 @@ import org.opendaylight.yangtools.yang.common.Uint32;
 @RunWith(MockitoJUnitRunner.class)
 public class OpenFlowProviderConfigImplTest {
     private static final Boolean IS_STATISTICS_POLLING_ON = true;
-    private static final int BARRIER_COUNT_LIMIT = 2000;
-    private static final long BARRIER_INTERVAL_TIMEOUT_LIMIT = 3000L;
-    private static final long ECHO_REPLY_TIMEOUT = 4000L;
+    private static final Uint16 BARRIER_COUNT_LIMIT = Uint16.valueOf(2000);
+    private static final Uint32 BARRIER_INTERVAL_TIMEOUT_LIMIT = Uint32.valueOf(3000);
+    private static final Uint32 ECHO_REPLY_TIMEOUT = Uint32.valueOf(4000);
     private static final Boolean ENABLE_FLOW_REMOVED_NOTIFICATION = true;
     private static final Boolean SKIP_TABLE_FEATURES = true;
-    private static final long BASIC_TIMER_DELAY = 2690L;
-    private static final long MAXIMUM_TIMER_DELAY = 3679L;
+    private static final Uint32 BASIC_TIMER_DELAY = Uint32.valueOf(2690);
+    private static final Uint32 MAXIMUM_TIMER_DELAY = Uint32.valueOf(3679);
     private static final Boolean SWITCH_FEATURES_MANDATORY = false;
     private static final Boolean IS_STATISTICS_RPC_ENABLED = false;
     private static final Boolean USE_SINGLE_LAYER_SERIALIZATION = true;
-    private static final int RPC_REQUESTS_QUOTA = 2500;
+    private static final Uint16 RPC_REQUESTS_QUOTA = Uint16.valueOf(2500);
     private static final Uint32 GLOBAL_NOTIFICATION_QUOTA = Uint32.valueOf(9000);
     private static final Uint16 THREAD_POOL_MIN_THREADS = Uint16.valueOf(3);
-    private static final int THREAD_POOL_MAX_THREADS = 1000;
+    private static final Uint16 THREAD_POOL_MAX_THREADS = Uint16.valueOf(1000);
     private static final Uint32 THREAD_POOL_TIMEOUT = Uint32.valueOf(60);
     private static final Uint16 DEVICE_CONNECTION_RATE_LIMIT_PER_MIN = Uint16.ZERO;
     private static final Uint16 DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS = Uint16.valueOf(60);
-    private static final long DEVICE_DATASTORE_REMOVAL_DELAY = 500L;
+    private static final Uint32 DEVICE_DATASTORE_REMOVAL_DELAY = Uint32.valueOf(500);
 
     @Mock
     private ConfigurationService configurationService;
@@ -101,7 +101,7 @@ public class OpenFlowProviderConfigImplTest {
 
     @Test
     public void getRpcRequestsQuota() {
-        assertEquals(RPC_REQUESTS_QUOTA, openflowProviderConfig.getRpcRequestsQuota().getValue().toJava());
+        assertEquals(RPC_REQUESTS_QUOTA, openflowProviderConfig.getRpcRequestsQuota().getValue());
     }
 
     @Test
@@ -126,18 +126,18 @@ public class OpenFlowProviderConfigImplTest {
 
     @Test
     public void getBarrierIntervalTimeoutLimit() {
-        assertEquals(BARRIER_INTERVAL_TIMEOUT_LIMIT, openflowProviderConfig.getBarrierIntervalTimeoutLimit()
-                .getValue().toJava());
+        assertEquals(BARRIER_INTERVAL_TIMEOUT_LIMIT,
+            openflowProviderConfig.getBarrierIntervalTimeoutLimit().getValue());
     }
 
     @Test
     public void getBarrierCountLimit() {
-        assertEquals(BARRIER_COUNT_LIMIT, openflowProviderConfig.getBarrierCountLimit().getValue().toJava());
+        assertEquals(BARRIER_COUNT_LIMIT, openflowProviderConfig.getBarrierCountLimit().getValue());
     }
 
     @Test
     public void getEchoReplyTimeout() {
-        assertEquals(ECHO_REPLY_TIMEOUT, openflowProviderConfig.getEchoReplyTimeout().getValue().toJava());
+        assertEquals(ECHO_REPLY_TIMEOUT, openflowProviderConfig.getEchoReplyTimeout().getValue());
     }
 
     @Test
@@ -147,7 +147,7 @@ public class OpenFlowProviderConfigImplTest {
 
     @Test
     public void getThreadPoolMaxThreads() {
-        assertEquals(THREAD_POOL_MAX_THREADS, openflowProviderConfig.getThreadPoolMaxThreads().getValue().toJava());
+        assertEquals(THREAD_POOL_MAX_THREADS, openflowProviderConfig.getThreadPoolMaxThreads().getValue());
     }
 
     @Test
@@ -167,12 +167,12 @@ public class OpenFlowProviderConfigImplTest {
 
     @Test
     public void getBasicTimerDelay() {
-        assertEquals(BASIC_TIMER_DELAY, openflowProviderConfig.getBasicTimerDelay().getValue().toJava());
+        assertEquals(BASIC_TIMER_DELAY, openflowProviderConfig.getBasicTimerDelay().getValue());
     }
 
     @Test
     public void getMaximumTimerDelay() {
-        assertEquals(MAXIMUM_TIMER_DELAY, openflowProviderConfig.getMaximumTimerDelay().getValue().toJava());
+        assertEquals(MAXIMUM_TIMER_DELAY, openflowProviderConfig.getMaximumTimerDelay().getValue());
     }
 
     @Test
@@ -194,7 +194,7 @@ public class OpenFlowProviderConfigImplTest {
     @Test
     public void getDeviceDatastoreRemovalDelay() {
         assertEquals(DEVICE_DATASTORE_REMOVAL_DELAY,
-                openflowProviderConfig.getDeviceDatastoreRemovalDelay().getValue().toJava());
+                openflowProviderConfig.getDeviceDatastoreRemovalDelay().getValue());
     }
 
 }
\ No newline at end of file
index d5929bdec42d6c35053b5dc3a700989dcf356092..d6e984a361048853e4d176b8902bade126c01d10 100644 (file)
@@ -90,6 +90,7 @@ public class OF10DeviceInitializerTest {
         when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
         when(deviceContext.getDeviceState()).thenReturn(deviceState);
         when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
+        when(deviceInfo.getNodeId()).thenReturn(nodeInstanceIdentifier.getKey().getId());
         when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
         when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
         when(translatorLibrary.lookupTranslator(any())).thenReturn(messageTranslator);
index 4be484414018603da229972ecca8b3c9957be2e1..5c76d584a5cc447828274c603235121c6bfd98c5 100644 (file)
@@ -95,6 +95,7 @@ public class OF13DeviceInitializerTest {
         when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
         when(deviceContext.getDeviceState()).thenReturn(deviceState);
         when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
+        when(deviceInfo.getNodeId()).thenReturn(nodeInstanceIdentifier.getKey().getId());
         when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
         when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
         when(deviceContext.oook()).thenReturn(translatorLibrary);
index f3e463e9f46cbfa57b41e9f1289b7756adbc5385..efbe177f84d4e6a9650c52c0c7420f02baa14ddf 100644 (file)
@@ -51,6 +51,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint64;
 import org.opendaylight.yangtools.yang.common.Uint8;
@@ -101,11 +102,12 @@ public class DeviceFlowRegistryImplTest {
                 .build();
 
         final Table table = new TableBuilder()
-                .setFlow(Collections.singletonList(flow))
+                .setId(Uint8.ONE)
+                .setFlow(BindingMap.of(flow))
                 .build();
 
         final FlowCapableNode flowCapableNode = new FlowCapableNodeBuilder()
-                .setTable(Collections.singletonList(table))
+                .setTable(BindingMap.of(table))
                 .build();
 
         final Map<FlowRegistryKey, FlowDescriptor> allFlowDescriptors = fillRegistry(path, flowCapableNode);
@@ -130,23 +132,25 @@ public class DeviceFlowRegistryImplTest {
         fillRegistry(path, new FlowCapableNodeBuilder().build());
 
         fillRegistry(path, new FlowCapableNodeBuilder()
-                .setTable(Collections.EMPTY_LIST)
+                .setTable(Collections.emptyMap())
                 .build());
 
         fillRegistry(path, new FlowCapableNodeBuilder()
-                .setTable(Collections.singletonList(new TableBuilder().build()))
+                .setTable(BindingMap.of(new TableBuilder().setId(Uint8.ZERO).build()))
                 .build());
 
         fillRegistry(path, new FlowCapableNodeBuilder()
-                .setTable(Collections.singletonList(new TableBuilder()
-                        .setFlow(Collections.EMPTY_LIST)
+                .setTable(BindingMap.of(new TableBuilder()
+                        .setId(Uint8.ZERO)
+                        .setFlow(Collections.emptyMap())
                         .build()))
                 .build());
 
         fillRegistry(path, new FlowCapableNodeBuilder()
-                .setTable(Collections.singletonList(new TableBuilder()
-                        .setFlow(Collections.singletonList(new FlowBuilder()
-                                .setId(null)
+                .setTable(BindingMap.of(new TableBuilder()
+                        .setId(Uint8.ZERO)
+                        .setFlow(BindingMap.of(new FlowBuilder()
+                                .setId(new FlowId("foo"))
                                 .build()))
                         .build()))
                 .build());
index badc8717b07984ba3781882329324af25c851914..b2af3588691ccf3e83caafea13bc32edec22cb62 100644 (file)
@@ -27,6 +27,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
 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.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdateBuilder;
@@ -117,6 +118,7 @@ public class FlowRegistryKeyFactoryTest {
         MatchBuilder match1Builder = new MatchBuilder().setLayer3Match(new Ipv4MatchBuilder()
                 .setIpv4Destination(new Ipv4Prefix("10.0.1.157/32")).build());
         FlowBuilder flow1Builder = new FlowBuilder()
+                .setId(new FlowId("foo"))
                 .setCookie(new FlowCookie(Uint64.valueOf(483)))
                 .setMatch(match1Builder.build())
                 .setPriority(Uint16.TWO)
@@ -143,6 +145,7 @@ public class FlowRegistryKeyFactoryTest {
         MatchBuilder match1Builder = new MatchBuilder().setLayer3Match(new Ipv4MatchBuilder()
                 .setIpv4Destination(new Ipv4Prefix("10.0.1.157/32")).build());
         FlowBuilder flow1Builder = new FlowBuilder()
+                .setId(new FlowId("foo"))
                 .setCookie(new FlowCookie(Uint64.valueOf(483)))
                 .setMatch(match1Builder.build())
                 .setPriority(Uint16.TWO)
index a2c069a7bf0de15ed847768b9db87c11176c0017..ffa967c964b20496b78b1700d2d663ec5045acc6 100644 (file)
@@ -46,6 +46,7 @@ import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorM
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
@@ -116,6 +117,8 @@ public class MultipartRequestOnTheFlyCallbackTest {
         when(mockedNodeId.toString()).thenReturn(DUMMY_NODE_ID);
         when(mockedPrimaryConnection.getFeatures()).thenReturn(mockedFeaturesReply);
 
+        when(mockedFlowDescriptor.getFlowId()).thenReturn(new FlowId("mookus"));
+
         when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimaryConnection);
         when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(NODE_PATH);
         when(mockedDeviceInfo.getNodeId()).thenReturn(mockedNodeId);
index 20fae3697cb8dfcbe82e76360d7b567d8909bbda..f078245ce6f8f4c612f97c38c06ba1f47dd0c030 100644 (file)
@@ -59,8 +59,8 @@ public class FlatBatchFlowAdaptersTest {
         final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
         planStep.setBarrierAfter(true);
         planStep.getTaskBag().addAll(Lists.newArrayList(
-                createAddFlowBatch("1"),
-                createAddFlowBatch("2")));
+                createAddFlowBatch(Uint16.ONE),
+                createAddFlowBatch(Uint16.TWO)));
 
         final AddFlowsBatchInput addFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchAddFlow(planStep, NODE_REF);
         Iterator<BatchAddFlows> iterator = addFlowsBatchInput.nonnullBatchAddFlows().values().iterator();
@@ -71,21 +71,24 @@ public class FlatBatchFlowAdaptersTest {
         Assert.assertEquals("2", iterator.next().getFlowId().getValue());
     }
 
-    private static FlatBatchAddFlow createAddFlowBatch(final String flowIdValue) {
+    private static FlatBatchAddFlow createAddFlowBatch(final Uint16 flowIdValue) {
         return new FlatBatchAddFlowBuilder()
-                .setFlowId(new FlowId(flowIdValue))
+                .setFlowId(new FlowId(flowIdValue.toString()))
+                .setBatchOrder(flowIdValue)
                 .build();
     }
 
-    private static FlatBatchRemoveFlow createRemoveFlowBatch(final String flowIdValue) {
+    private static FlatBatchRemoveFlow createRemoveFlowBatch(final Uint16 flowIdValue) {
         return new FlatBatchRemoveFlowBuilder()
-                .setFlowId(new FlowId(flowIdValue))
+                .setFlowId(new FlowId(flowIdValue.toString()))
+                .setBatchOrder(flowIdValue)
                 .build();
     }
 
-    private static FlatBatchUpdateFlow createUpdateFlowBatch(final String flowIdValue) {
+    private static FlatBatchUpdateFlow createUpdateFlowBatch(final Uint16 flowIdValue) {
         return new FlatBatchUpdateFlowBuilder()
-                .setFlowId(new FlowId(flowIdValue))
+                .setFlowId(new FlowId(flowIdValue.toString()))
+                .setBatchOrder(flowIdValue)
                 .build();
     }
 
@@ -94,8 +97,8 @@ public class FlatBatchFlowAdaptersTest {
         final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_REMOVE);
         planStep.setBarrierAfter(true);
         planStep.getTaskBag().addAll(Lists.newArrayList(
-                createRemoveFlowBatch("1"),
-                createRemoveFlowBatch("2")));
+                createRemoveFlowBatch(Uint16.ONE),
+                createRemoveFlowBatch(Uint16.TWO)));
 
         final RemoveFlowsBatchInput removeFlowsBatchInput =
                 FlatBatchFlowAdapters.adaptFlatBatchRemoveFlow(planStep, NODE_REF);
@@ -112,8 +115,8 @@ public class FlatBatchFlowAdaptersTest {
         final BatchPlanStep planStep = new BatchPlanStep(BatchStepType.FLOW_UPDATE);
         planStep.setBarrierAfter(true);
         planStep.getTaskBag().addAll(Lists.newArrayList(
-                createUpdateFlowBatch("1"),
-                createUpdateFlowBatch("2")));
+                createUpdateFlowBatch(Uint16.ONE),
+                createUpdateFlowBatch(Uint16.TWO)));
 
         final UpdateFlowsBatchInput updateFlowsBatchInput =
                 FlatBatchFlowAdapters.adaptFlatBatchUpdateFlow(planStep, NODE_REF);
index effc4c0b8901501bbdb2dd2760f9494895a3709c..76869647002162deec3cbf6061676b7afb3fc7ce 100644 (file)
@@ -77,12 +77,14 @@ public class FlatBatchGroupAdaptersTest {
     private static FlatBatchAddGroup createAddGroupBatch(final Uint32 groupIdValue) {
         return new FlatBatchAddGroupBuilder()
                 .setGroupId(new GroupId(groupIdValue))
+                .setBatchOrder(groupIdValue.toUint16())
                 .build();
     }
 
     private static FlatBatchRemoveGroup createRemoveGroupBatch(final Uint32 groupIdValue) {
         return new FlatBatchRemoveGroupBuilder()
                 .setGroupId(new GroupId(groupIdValue))
+                .setBatchOrder(groupIdValue.toUint16())
                 .build();
     }
 
@@ -94,6 +96,7 @@ public class FlatBatchGroupAdaptersTest {
                 .setUpdatedBatchedGroup(new UpdatedBatchedGroupBuilder()
                         .setGroupId(new GroupId(groupIdValue))
                         .build())
+                .setBatchOrder(groupIdValue.toUint16())
                 .build();
     }
 
index 93a7e9d417381a379387d90d5c32c24100bf91f8..38fc7489758afe1dbcd3b428bba0aef0e016d3b9 100644 (file)
@@ -78,12 +78,14 @@ public class FlatBatchMeterAdaptersTest {
     private static FlatBatchAddMeter createAddMeterBatch(final Uint32 groupIdValue) {
         return new FlatBatchAddMeterBuilder()
                 .setMeterId(new MeterId(groupIdValue))
+                .setBatchOrder(groupIdValue.toUint16())
                 .build();
     }
 
     private static FlatBatchRemoveMeter createRemoveMeterBatch(final Uint32 groupIdValue) {
         return new FlatBatchRemoveMeterBuilder()
                 .setMeterId(new MeterId(groupIdValue))
+                .setBatchOrder(groupIdValue.toUint16())
                 .build();
     }
 
@@ -95,6 +97,7 @@ public class FlatBatchMeterAdaptersTest {
                 .setUpdatedBatchedMeter(new UpdatedBatchedMeterBuilder()
                         .setMeterId(new MeterId(groupIdValue))
                         .build())
+                .setBatchOrder(groupIdValue.toUint16())
                 .build();
     }
 
index 0d2c64a6cef89b364f6fc17d41e270321fdfea48..6f8d986307786d466702c18e109ab0695397de19 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.AsyncFunction;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -93,6 +92,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.Up
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.input.update.grouping.OriginalBatchedMeterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.input.update.grouping.UpdatedBatchedMeterBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@@ -244,7 +244,7 @@ public class SalFlatBatchServiceImplTest {
         int idx = 0;
         ProcessFlatBatchInput batchInput = new ProcessFlatBatchInputBuilder()
                 .setNode(NODE_REF)
-                .setBatch(Lists.newArrayList(
+                .setBatch(BindingMap.ordered(
                         createFlowAddBatch(idx++, "f1", 2),
                         createFlowRemoveBatch(idx++, "f2"),
                         createFlowUpdateBatch(idx++, "f3"),
@@ -351,8 +351,9 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchRemoveFlowCaseBuilder()
-                        .setFlatBatchRemoveFlow(Collections.singletonList(new FlatBatchRemoveFlowBuilder()
+                        .setFlatBatchRemoveFlow(BindingMap.of(new FlatBatchRemoveFlowBuilder()
                                 .setFlowId(new FlowId(flowIdValue))
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -364,8 +365,9 @@ public class SalFlatBatchServiceImplTest {
                 .setBatchOrder(uint)
                 .withKey(new BatchKey(uint))
                 .setBatchChoice(new FlatBatchUpdateFlowCaseBuilder()
-                        .setFlatBatchUpdateFlow(Collections.singletonList(new FlatBatchUpdateFlowBuilder()
+                        .setFlatBatchUpdateFlow(BindingMap.of(new FlatBatchUpdateFlowBuilder()
                                 .setFlowId(new FlowId(flowIdValue))
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -375,8 +377,9 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchAddGroupCaseBuilder()
-                        .setFlatBatchAddGroup(Collections.singletonList(new FlatBatchAddGroupBuilder()
+                        .setFlatBatchAddGroup(BindingMap.of(new FlatBatchAddGroupBuilder()
                                 .setGroupId(new GroupId(Uint32.valueOf(groupIdValue)))
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -386,8 +389,9 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchRemoveGroupCaseBuilder()
-                        .setFlatBatchRemoveGroup(Collections.singletonList(new FlatBatchRemoveGroupBuilder()
+                        .setFlatBatchRemoveGroup(BindingMap.of(new FlatBatchRemoveGroupBuilder()
                                 .setGroupId(new GroupId(Uint32.valueOf(groupIdValue)))
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -397,13 +401,14 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchUpdateGroupCaseBuilder()
-                        .setFlatBatchUpdateGroup(Collections.singletonList(new FlatBatchUpdateGroupBuilder()
+                        .setFlatBatchUpdateGroup(BindingMap.of(new FlatBatchUpdateGroupBuilder()
                                 .setOriginalBatchedGroup(new OriginalBatchedGroupBuilder()
                                         .setGroupId(new GroupId(Uint32.valueOf(groupIdValue)))
                                         .build())
                                 .setUpdatedBatchedGroup(new UpdatedBatchedGroupBuilder()
                                         .setGroupId(new GroupId(Uint32.valueOf(groupIdValue)))
                                         .build())
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -413,8 +418,9 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchAddMeterCaseBuilder()
-                        .setFlatBatchAddMeter(Collections.singletonList(new FlatBatchAddMeterBuilder()
+                        .setFlatBatchAddMeter(BindingMap.of(new FlatBatchAddMeterBuilder()
                                 .setMeterId(new MeterId(Uint32.valueOf(groupIdValue)))
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -424,8 +430,9 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchRemoveMeterCaseBuilder()
-                        .setFlatBatchRemoveMeter(Collections.singletonList(new FlatBatchRemoveMeterBuilder()
+                        .setFlatBatchRemoveMeter(BindingMap.of(new FlatBatchRemoveMeterBuilder()
                                 .setMeterId(new MeterId(Uint32.valueOf(groupIdValue)))
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -435,13 +442,14 @@ public class SalFlatBatchServiceImplTest {
         return new BatchBuilder()
                 .setBatchOrder(Uint16.valueOf(batchOrder))
                 .setBatchChoice(new FlatBatchUpdateMeterCaseBuilder()
-                        .setFlatBatchUpdateMeter(Collections.singletonList(new FlatBatchUpdateMeterBuilder()
+                        .setFlatBatchUpdateMeter(BindingMap.of(new FlatBatchUpdateMeterBuilder()
                                 .setOriginalBatchedMeter(new OriginalBatchedMeterBuilder()
                                         .setMeterId(new MeterId(Uint32.valueOf(groupIdValue)))
                                         .build())
                                 .setUpdatedBatchedMeter(new UpdatedBatchedMeterBuilder()
                                         .setMeterId(new MeterId(Uint32.valueOf(groupIdValue)))
                                         .build())
+                                .setBatchOrder(Uint16.valueOf(batchOrder))
                                 .build()))
                         .build())
                 .build();
@@ -514,9 +522,11 @@ public class SalFlatBatchServiceImplTest {
     public void testPrepareBatchPlan_success() throws Exception {
         final FlatBatchAddFlow flatBatchAddFlow_1 = new FlatBatchAddFlowBuilder()
                 .setFlowId(new FlowId("f1"))
+                .setBatchOrder(Uint16.ONE)
                 .build();
         final FlatBatchAddFlow flatBatchAddFlow_2 = new FlatBatchAddFlowBuilder()
                 .setFlowId(new FlowId("f2"))
+                .setBatchOrder(Uint16.TWO)
                 .build();
         final BatchPlanStep batchPlanStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
         batchPlanStep.getTaskBag().addAll(Lists.newArrayList(flatBatchAddFlow_1, flatBatchAddFlow_2));
@@ -546,9 +556,11 @@ public class SalFlatBatchServiceImplTest {
     public void testPrepareBatchPlan_failure() throws Exception {
         final FlatBatchAddFlow flatBatchAddFlow_1 = new FlatBatchAddFlowBuilder()
                 .setFlowId(new FlowId("f1"))
+                .setBatchOrder(Uint16.ONE)
                 .build();
         final FlatBatchAddFlow flatBatchAddFlow_2 = new FlatBatchAddFlowBuilder()
                 .setFlowId(new FlowId("f2"))
+                .setBatchOrder(Uint16.TWO)
                 .build();
         final BatchPlanStep batchPlanStep = new BatchPlanStep(BatchStepType.FLOW_ADD);
         batchPlanStep.getTaskBag().addAll(Lists.newArrayList(flatBatchAddFlow_1, flatBatchAddFlow_2));
index 98de92c83adabdcf2420b46ffda782b663be1ef8..e137e0a1f07fb60d68a712e278bd9447adf5a00b 100644 (file)
@@ -9,8 +9,6 @@ package org.opendaylight.openflowplugin.impl.services.sal;
 
 import static org.mockito.Mockito.verify;
 
-import com.google.common.collect.Lists;
-import java.util.List;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.junit.MockitoJUnitRunner;
@@ -29,6 +27,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.Upda
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.UpdatePortInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.port.update.UpdatedPort;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.port.update.UpdatedPortBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 @RunWith(MockitoJUnitRunner.class)
@@ -66,10 +65,9 @@ public class SalPortServiceImplTest extends ServiceMocking {
                 true, true, true, true, true, true, true, true));
         concretePortBuilder.setPortNumber(new PortNumberUni(DUMMY_PORT_NUMBER));
         concretePortBuilder.setHardwareAddress(new MacAddress(DUMMY_MAC_ADDRESS));
+        concretePortBuilder.setPortModOrder(Uint32.ZERO);
 
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.Port> ports
-                = Lists.newArrayList(concretePortBuilder.build());
-        Port port = new PortBuilder().setPort(ports).build();
+        Port port = new PortBuilder().setPort(BindingMap.of(concretePortBuilder.build())).build();
         UpdatedPort updatePort = new UpdatedPortBuilder().setPort(port).build();
         return new UpdatePortInputBuilder().setUpdatedPort(updatePort).build();
     }
index 277b0f05d694368e957b53aeea6ac98ba2877153..001b44f5c3f6797b5a03807585e02e4968ab2084 100644 (file)
@@ -32,6 +32,7 @@ public class SingleLayerPortServiceTest extends ServiceMocking {
     public void buildRequest() {
         final Port input = new PortBuilder()
                 .setPortNumber(new PortNumberUni(PORT_ID))
+                .setPortModOrder(Uint32.ZERO)
                 .build();
 
         final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
index b692a9dac7516e9c5ed27251901fa180f28aed1c..f3d5c15f998342f7c17b1443bb919f39a13f7eee 100644 (file)
@@ -25,9 +25,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.tab
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.request.multipart.request.body.MultipartRequestTableFeatures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class SingleLayerTableMultipartServiceTest extends ServiceMocking {
     private static final Uint32 MAX_ENTRIES = Uint32.valueOf(42);
@@ -44,7 +46,8 @@ public class SingleLayerTableMultipartServiceTest extends ServiceMocking {
     public void buildRequest() {
         final UpdateTableInput input = new UpdateTableInputBuilder()
                 .setUpdatedTable(new UpdatedTableBuilder()
-                        .setTableFeatures(Collections.singletonList(new TableFeaturesBuilder()
+                        .setTableFeatures(BindingMap.of(new TableFeaturesBuilder()
+                                .setTableId(Uint8.ZERO)
                                 .setMaxEntries(MAX_ENTRIES)
                                 .build()))
                         .build())
@@ -64,7 +67,8 @@ public class SingleLayerTableMultipartServiceTest extends ServiceMocking {
         mockSuccessfulFuture(Collections.singletonList(new MultipartReplyBuilder()
                 .setXid(XID)
                 .setMultipartReplyBody(new MultipartReplyTableFeaturesBuilder()
-                        .setTableFeatures(Collections.singletonList(new TableFeaturesBuilder()
+                        .setTableFeatures(BindingMap.of(new TableFeaturesBuilder()
+                                .setTableId(Uint8.ZERO)
                                 .setMaxEntries(MAX_ENTRIES)
                                 .build()))
                         .build())
@@ -72,7 +76,8 @@ public class SingleLayerTableMultipartServiceTest extends ServiceMocking {
 
         final UpdateTableInput input = new UpdateTableInputBuilder()
                 .setUpdatedTable(new UpdatedTableBuilder()
-                        .setTableFeatures(Collections.singletonList(new TableFeaturesBuilder()
+                        .setTableFeatures(BindingMap.of(new TableFeaturesBuilder()
+                                .setTableId(Uint8.ZERO)
                                 .setMaxEntries(MAX_ENTRIES)
                                 .build()))
                         .build())
index 2f0a577d4422d023c89afa6037d7962a7830bbfd..9adb1c8ce83bb509cba57b285db43aa7fa1e1aa2 100755 (executable)
@@ -177,6 +177,7 @@ public class StatisticsGatheringUtilsTest {
         when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
         when(deviceContext.getDeviceMeterRegistry()).thenReturn(deviceMeterRegistry);
         when(deviceFlowRegistry.retrieveDescriptor(any(FlowRegistryKey.class))).thenReturn(flowDescriptor);
+        when(flowDescriptor.getFlowId()).thenReturn(new FlowId("MOCK_FLOW"));
         when(deviceContext.getReadTransaction()).thenReturn(readTx);
         when(deviceContext.getReadTransaction()).thenReturn(readTx);
         when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionAdapter);
index 85ca2fe34422c8906891747953890266ae2df254..7662b0b51d088963cab23411500e0f8a97f55fc6 100644 (file)
@@ -216,11 +216,11 @@ public class FlatBatchUtilTest {
         }
     }
 
-    private static Batch createBatch(BatchStepType type) {
+    private static Batch createBatch(final BatchStepType type) {
         return createBatch(type, 1);
     }
 
-    private static Batch createBatch(BatchStepType type, final int size) {
+    private static Batch createBatch(final BatchStepType type, final int size) {
         final BatchChoice batchCase;
         switch (type) {
             case FLOW_ADD:
@@ -274,6 +274,7 @@ public class FlatBatchUtilTest {
         }
 
         return new BatchBuilder()
+                .setBatchOrder(Uint16.ZERO)
                 .setBatchChoice(batchCase)
                 .build();
     }
index 8b6f51033f0984ac57d98bb5cc8a268b2a983041..95f066018b0f9ce8b6a06e4a5dd2cc8534ae10a6 100644 (file)
@@ -36,6 +36,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class FlowUtilTest {
@@ -138,6 +139,7 @@ public class FlowUtilTest {
                 .withError(RpcError.ErrorType.APPLICATION, "ut-flowAddFail")
                 .withResult(Collections.singletonList(new BatchFailedFlowsOutputBuilder()
                         .setFlowId(DUMMY_FLOW_ID)
+                        .setBatchOrder(Uint16.ZERO)
                         .build()))
                 .build();
     }
index d836ca94982c5f0932daf44f96b8f6e596ee234a..4429570d89bf31d3cef10cbbcc3dea7de331ed14 100644 (file)
@@ -35,6 +35,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
@@ -136,6 +137,7 @@ public class GroupUtilTest {
         return RpcResultBuilder.<List<BatchFailedGroupsOutput>>failed()
                 .withError(RpcError.ErrorType.APPLICATION, "ut-flowAddFail")
                 .withResult(Collections.singletonList(new BatchFailedGroupsOutputBuilder()
+                        .setBatchOrder(Uint16.ZERO)
                         .setGroupId(DUMMY_GROUP_ID)
                         .build()))
                 .build();
index 126f5faa0d4fd3f6722b46b67d9055b557c5ee06..1bf84f1dc7fa06b9c3dce32e677846bd22d25f1f 100644 (file)
@@ -34,6 +34,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
@@ -136,6 +137,7 @@ public class MeterUtilTest {
         return RpcResultBuilder.<List<BatchFailedMetersOutput>>failed()
                 .withError(RpcError.ErrorType.APPLICATION, "ut-flowAddFail")
                 .withResult(Collections.singletonList(new BatchFailedMetersOutputBuilder()
+                        .setBatchOrder(Uint16.ZERO)
                         .setMeterId(DUMMY_METER_ID)
                         .build()))
                 .build();
index 11c6e5b8b987be74027bfb5ffb00c741fe5f3994..32f2b94b06dcb9f3ce801975993dfd568b8aa045 100644 (file)
     <artifactId>openflowplugin</artifactId>
     <packaging>bundle</packaging>
 
+    <properties>
+        <!-- FIXME: Remove this -->
+        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+    </properties>
+
     <build>
         <plugins>
             <plugin>
index e6167f2966b4cade27b933916a5319ef93ea54a5..ca6a81cc6bef60d43ece92d8941bd3a59e110500 100644 (file)
@@ -64,7 +64,7 @@ public class ConvertorManagerTest {
                     }
                 });
 
-        final Action source = new ActionBuilder().build();
+        final Action source = new ActionBuilder().setOrder(0).build();
         final VersionConvertorData data = new VersionConvertorData(OFConstants.OFP_VERSION_1_3);
         final String expectedResult = String.valueOf(source) + String.valueOf(data);
         final Optional<String> result = convertorManager.convert(source, data);
@@ -92,7 +92,7 @@ public class ConvertorManagerTest {
                     }
                 });
 
-        final List<Action> source = Collections.singletonList(new ActionBuilder().build());
+        final List<Action> source = Collections.singletonList(new ActionBuilder().setOrder(0).build());
         final VersionConvertorData data = new VersionConvertorData(OFConstants.OFP_VERSION_1_3);
         final String expectedResult = String.valueOf(source) + String.valueOf(data);
         final Optional<String> result = convertorManager.convert(source, data);
index e29d59cb4113aefe8b2fdd20fbe770157e0bfb40..b34f3ba9f2aa8adb28f932d4ab740ae3766c2798 100644 (file)
@@ -115,7 +115,7 @@ public class MeterConvertorTest {
         MeterBandHeaderBuilder meterBandHeaderBuilder2 = new MeterBandHeaderBuilder();
         meterBandHeaderBuilder2.setBandType(experimenter);
         meterBandHeaderBuilder2.setMeterBandTypes(meterBandTypesB2.build());
-        meterBandHeaderBuilder.withKey(new MeterBandHeaderKey(new BandId(Uint32.TWO)));
+        meterBandHeaderBuilder2.withKey(new MeterBandHeaderKey(new BandId(Uint32.TWO)));
         MeterBandHeader meterBH2 = meterBandHeaderBuilder2.build();
 
         List<MeterBandHeader> meterBandList = new ArrayList<>();
index 1c627cee7fb029351e4d2c6c112b23d5f291ea83..3acb659a4e93a74bde1fda7325eb963431affc63 100644 (file)
@@ -59,11 +59,12 @@ public class PortConvertorTest {
      */
     @Test
     public void testtoPortModInputwithAllParameters() {
-        PortBuilder portBld = new PortBuilder();
-        portBld.setAdvertisedFeatures(features);
-        portBld.setConfiguration(config);
-        portBld.setPortNumber(new PortNumberUni(Uint32.valueOf(42L)));
-        portBld.setHardwareAddress(new MacAddress(DEFAULT_MAC_ADDRESS));
+        PortBuilder portBld = new PortBuilder()
+            .setPortModOrder(Uint32.ZERO)
+            .setAdvertisedFeatures(features)
+            .setConfiguration(config)
+            .setPortNumber(new PortNumberUni(Uint32.valueOf(42)))
+            .setHardwareAddress(new MacAddress(DEFAULT_MAC_ADDRESS));
 
         VersionConvertorData data = new VersionConvertorData(OFConstants.OFP_VERSION_1_3);
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
index 2b32c65f9fda62704511f110039acfde8cfd15a9..aae4978bba3a7c2a2a7117df35f4047d48019d75 100644 (file)
@@ -52,6 +52,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -211,7 +212,7 @@ public class ActionConvertorV10Test {
         IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProto(IpVersion.Ipv4);
         MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());
         FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());
-        Flow flow = flowBld.build();
+        Flow flow = flowBld.setId(new FlowId("foo")).build();
 
         ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_0);
         data.setDatapathId(Uint64.valueOf(42));
index 2d1b23f76ae32c8668d820aa5a9f50f875230520..d2dde2223f800f5ea03a564fb21438e506ffdde4 100644 (file)
@@ -57,6 +57,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
@@ -509,7 +510,7 @@ public class ActionConvertorV13Test {
         IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProtocol(Uint8.valueOf(6));
         MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());
         FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());
-        Flow flow = flowBld.build();
+        Flow flow = flowBld.setId(new FlowId("foo")).build();
 
         ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_3);
         data.setDatapathId(Uint64.valueOf(42));
index 95c45109920f0326deab94019b9eac582e68e38c..f9a719cddbf1606eb11d04532a45c8164817d361 100644 (file)
@@ -67,7 +67,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModCommand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.binding.AbstractAugmentable;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
@@ -313,7 +313,7 @@ public class FlowConvertorTest {
                 .build())).build();
     }
 
-    private static class MockFlow implements AddFlowInput {
+    private static class MockFlow extends AbstractAugmentable<AddFlowInput> implements AddFlowInput {
         private Instructions instructions;
         private Match match;
 
@@ -325,17 +325,11 @@ public class FlowConvertorTest {
             this.match = match;
         }
 
-
         @Override
         public FlowRef getFlowRef() {
             return null;
         }
 
-        @Override
-        public <E extends Augmentation<AddFlowInput>> E augmentation(final Class<E> augmentationType) {
-            return null;
-        }
-
         @Override
         public FlowTableRef getFlowTable() {
             return null;
@@ -435,10 +429,5 @@ public class FlowConvertorTest {
         public Uri getTransactionUri() {
             return null;
         }
-
-        @Override
-        public Class<AddFlowInput> implementedInterface() {
-            return AddFlowInput.class;
-        }
     }
 }
index 6e7b0014639cd59baef61640576b8865d59992c1..c9992511510bb82c640314768b50879cad1e039f 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>6.0.5</version>
+        <version>7.0.0</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>2.0.4</version>
+                <version>3.0.0</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.infrautils</groupId>
                 <artifactId>infrautils-artifacts</artifactId>
-                <version>1.8.1</version>
+                <version>1.9.0</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index baa6eeb9e05e9dd8ffa0cc255d51c25c413b4247..94c83325dc8b07ccdac84bfbd52253fdf924b015 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>7.0.6</version>
+        <version>8.0.0</version>
         <relativePath/>
     </parent>
 
index 4a2262337d2dbe21c59e6d301bcfc293419f205d..11af39d643447d86d0533fbe5ed7185635b9bf11 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.test;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
@@ -85,7 +86,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
     private Group testGroup;
     private Node testNode;
 
-    public OpenflowpluginGroupTestCommandProvider(DataBroker dataBroker, BundleContext ctx) {
+    public OpenflowpluginGroupTestCommandProvider(final DataBroker dataBroker, final BundleContext ctx) {
         this.dataBroker = dataBroker;
         this.ctx = ctx;
     }
@@ -95,7 +96,7 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         createTestNode();
     }
 
-    private void createUserNode(String nodeRef) {
+    private void createUserNode(final String nodeRef) {
         NodeBuilder builder = new NodeBuilder();
         builder.setId(new NodeId(nodeRef));
         builder.withKey(new NodeKey(builder.getId()));
@@ -109,11 +110,11 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         testNode = builder.build();
     }
 
-    private static InstanceIdentifier<Node> nodeToInstanceId(Node node) {
+    private static InstanceIdentifier<Node> nodeToInstanceId(final Node node) {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
     }
 
-    private GroupBuilder createTestGroup(String actionType, String groupType, String groupMod) {
+    private GroupBuilder createTestGroup(String actionType, String groupType, final String groupMod) {
         // Sample data , committing to DataStore
 
         GroupBuilder group = new GroupBuilder();
@@ -573,24 +574,24 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
             createUserNode(nref);
         }
         GroupBuilder gbuilder = createTestGroup(ci.nextArgument(), ci.nextArgument(), "add");
-        ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
+        ReadWriteTransaction modification = requireNonNull(dataBroker).newReadWriteTransaction();
         InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
                 .augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(gbuilder.getGroupId()));
         modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
         }, MoreExecutors.directExecutor());
     }
 
-    public void _addGroup(CommandInterpreter ci) {
+    public void _addGroup(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
         if (nref == null) {
@@ -604,8 +605,8 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         writeGroup(ci, testGroup);
     }
 
-    private void writeGroup(final CommandInterpreter ci, Group group) {
-        ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
+    private void writeGroup(final CommandInterpreter ci, final Group group) {
+        ReadWriteTransaction modification = requireNonNull(dataBroker).newReadWriteTransaction();
         InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
                 .child(Group.class, new GroupKey(group.getGroupId()));
@@ -614,18 +615,18 @@ public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
         modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, path1, group);
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
         }, MoreExecutors.directExecutor());
     }
 
-    public void _modifyGroup(CommandInterpreter ci) {
+    public void _modifyGroup(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
 
         if (nref == null) {
index eeeac50a2d4d3bdbcaaa65e679f41534357ee2e2..6534961cc3929c6e37940fc360e903645f399ab8 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.openflowplugin.test;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
@@ -78,7 +79,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
     private final BundleContext ctx;
     private Node testNode;
 
-    public OpenflowpluginTableFeaturesTestCommandProvider(DataBroker dataBroker, BundleContext ctx) {
+    public OpenflowpluginTableFeaturesTestCommandProvider(final DataBroker dataBroker, final BundleContext ctx) {
         this.dataBroker = dataBroker;
         this.ctx = ctx;
     }
@@ -89,7 +90,7 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         // createTestTableFeatures();
     }
 
-    private void createUserNode(String nodeRef) {
+    private void createUserNode(final String nodeRef) {
         NodeBuilder builder = new NodeBuilder();
         builder.setId(new NodeId(nodeRef));
         builder.withKey(new NodeKey(builder.getId()));
@@ -103,11 +104,11 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         testNode = builder.build();
     }
 
-    private static InstanceIdentifier<Node> nodeToInstanceId(Node node) {
+    private static InstanceIdentifier<Node> nodeToInstanceId(final Node node) {
         return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
     }
 
-    private static TableFeaturesBuilder createTestTableFeatures(String tableFeatureTypeArg) {
+    private static TableFeaturesBuilder createTestTableFeatures(final String tableFeatureTypeArg) {
 
         String tableFeatureType = tableFeatureTypeArg;
         if (tableFeatureType == null) {
@@ -567,8 +568,8 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         return tableFeatureProperty;
     }
 
-    private void writeTableFeatures(final CommandInterpreter ci, TableFeatures tableFeatures) {
-        ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
+    private void writeTableFeatures(final CommandInterpreter ci, final TableFeatures tableFeatures) {
+        ReadWriteTransaction modification = requireNonNull(dataBroker).newReadWriteTransaction();
 
         KeyedInstanceIdentifier<TableFeatures, TableFeaturesKey> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
@@ -581,18 +582,18 @@ public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandPr
         modification.mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, path1, tableFeatures);
         modification.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
-            public void onSuccess(CommitInfo notUsed) {
+            public void onSuccess(final CommitInfo notUsed) {
                 ci.println("Status of Group Data Loaded Transaction: success.");
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
             }
         }, MoreExecutors.directExecutor());
     }
 
-    public void _modifyTable(CommandInterpreter ci) {
+    public void _modifyTable(final CommandInterpreter ci) {
         String nref = ci.nextArgument();
         ci.println(" Table Command Provider modify");