Bump odlparent to 5.0.0
[openflowplugin.git] / samples / sample-bundles / src / main / java / org / opendaylight / openflowplugin / samples / sample / bundles / SampleFlowCapableNodeListener.java
index 83e5601ce238ee5717e65f4b1f5c2e54c2898347..b10b7eb51e24842c79b01e69c1d643a5086a49dd 100644 (file)
@@ -16,13 +16,12 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
-import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
+import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
@@ -120,13 +119,13 @@ public class SampleFlowCapableNodeListener implements ClusteredDataTreeChangeLis
         final InstanceIdentifier<FlowCapableNode> path = InstanceIdentifier.create(Nodes.class).child(Node.class)
                 .augmentation(FlowCapableNode.class);
         final DataTreeIdentifier<FlowCapableNode> identifier =
-                new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, path);
+                DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, path);
 
         listenerReg = dataBroker.registerDataTreeChangeListener(identifier, SampleFlowCapableNodeListener.this);
     }
 
     @Override
-    public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<FlowCapableNode>> modifications) {
+    public void onDataTreeChanged(Collection<DataTreeModification<FlowCapableNode>> modifications) {
         for (DataTreeModification<FlowCapableNode> modification : modifications) {
             if (modification.getRootNode().getModificationType() == ModificationType.WRITE) {
                 LOG.info("Node connected:  {}",
@@ -175,10 +174,8 @@ public class SampleFlowCapableNodeListener implements ClusteredDataTreeChangeLis
                                 makeCompletableFuture(bundleService.controlBundle(commitBundleInput));
 
                         return controlCommitFuture;
-                    }).thenAccept(voidRpcResult -> {
-                        LOG.debug("Commit successful: {}, msg: {}", voidRpcResult.isSuccessful(),
-                                voidRpcResult.getErrors());
-                    });
+                    }).thenAccept(voidRpcResult -> LOG.debug("Commit successful: {}, msg: {}",
+                        voidRpcResult.isSuccessful(), voidRpcResult.getErrors()));
             }
         }
     }