Migrate Optional.get() callers
[transportpce.git] / inventory / src / main / java / org / opendaylight / transportpce / inventory / listener / DeviceListener.java
index f64836c72deb5921f4eb02aaf22b98afb529199d..3ba26dfe48a82ecec611a87df8749a37241967d8 100644 (file)
@@ -17,9 +17,8 @@ import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.inventory.DeviceInventory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus.ConnectionStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.ConnectionOper.ConnectionStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,8 +49,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
         for (DataTreeModification<Node> device : changesWithoutDefaultNetconfNode) {
             String nodeId = device.getRootNode().getDataAfter().key().getNodeId().getValue();
             NetconfNode netconfNode = device.getRootNode().getDataAfter().augmentation(NetconfNode.class);
-            NetconfNodeConnectionStatus.ConnectionStatus connectionStatus =
-                    netconfNode.getConnectionStatus();
+            ConnectionStatus connectionStatus = netconfNode.getConnectionStatus();
             long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
                     .filter(cp -> cp.getCapability().contains(StringConstants.OPENROADM_DEVICE_MODEL_NAME))
                     .count();
@@ -86,7 +84,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
      */
     private void processModifiedSubtree(String nodeId, NetconfNode netconfNode, String openROADMversion)
             throws InterruptedException, ExecutionException {
-        NetconfNodeConnectionStatus.ConnectionStatus connectionStatus = netconfNode.getConnectionStatus();
+        ConnectionStatus connectionStatus = netconfNode.getConnectionStatus();
 
         long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
                 .filter(cp -> cp.getCapability().contains(StringConstants.OPENROADM_DEVICE_MODEL_NAME))
@@ -142,4 +140,4 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
         return change.getRootNode().getDataBefore() != null && change.getRootNode().getDataAfter() == null
                 && ModificationType.DELETE.equals(change.getRootNode().getModificationType());
     }
-}
+}
\ No newline at end of file