Migrate InstanceIdentifier of common module 90/114790/1
authorGilles Thouenon <gilles.thouenon@orange.com>
Fri, 3 Jan 2025 16:56:44 +0000 (17:56 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 3 Jan 2025 16:56:44 +0000 (17:56 +0100)
- use DataObjectIdentifier instead of InstanceIdentifier in
  transportpce-common module
- propagate the same migration in the impacted code of all downstream
  modules

JIRA: TRNSPRTPCE-842
Change-Id: I66a372df3ff43e702d872e4c248c6776a913cc16
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
54 files changed:
common/src/main/java/org/opendaylight/transportpce/common/InstanceIdentifiers.java
common/src/main/java/org/opendaylight/transportpce/common/converter/JsonStringConverter.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl121.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl221.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl710.java
common/src/main/java/org/opendaylight/transportpce/common/device/DeviceTransaction.java
common/src/main/java/org/opendaylight/transportpce/common/device/DeviceTransactionManager.java
common/src/main/java/org/opendaylight/transportpce/common/device/DeviceTransactionManagerImpl.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtilsImpl.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/OCPortMappingVersion190.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMapping.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingImpl.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion221.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion710.java
common/src/main/java/org/opendaylight/transportpce/common/metadata/OCMetaDataTransactionImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl221.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl710.java
common/src/test/java/org/opendaylight/transportpce/common/catalog/CatalogUtilsTest.java
common/src/test/java/org/opendaylight/transportpce/common/converter/JsonStringConverterTest.java
common/src/test/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl121Test.java
common/src/test/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl221Test.java
common/src/test/java/org/opendaylight/transportpce/common/device/DeviceTransactionManagerTest.java
common/src/test/java/org/opendaylight/transportpce/common/mapping/MappingUtilsImplTest.java
common/src/test/java/org/opendaylight/transportpce/common/mapping/PortMappingImplTest.java
common/src/test/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121Test.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/INode121.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/INode221.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/ListenerProvider.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationAlarmServiceSerializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/NotificationServiceSerializer.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/serialization/TapiNotificationSerializer.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetworkModelProvider.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/R2RLinkDiscovery.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/listeners/DeviceListener710.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion710.java
olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java
olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils121.java
olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils221.java
olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils710.java
olm/src/test/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImplSpanLossBaseTest.java
olm/src/test/java/org/opendaylight/transportpce/olm/util/OlmTransactionUtils.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/consumer/GnpyConsumerImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface121.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface221.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface710.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplDeleteTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/TransactionUtils.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/R2RTapiLinkDiscovery.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/impl/TapiProvider.java

index 7f326533101e2ceb48ac60253b98d115d98fef5d..ad0aac382f837e39e2b3ec5463e953954c2e53ed 100644 (file)
@@ -25,17 +25,18 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yangtools.binding.DataObjectIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public final class InstanceIdentifiers {
 
-    public static final InstanceIdentifier<Topology> NETCONF_TOPOLOGY_II =
-            InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(
-                    new TopologyId(TopologyNetconf.QNAME.getLocalName())));
+    public static final DataObjectIdentifier<Topology> NETCONF_TOPOLOGY_II =
+            DataObjectIdentifier.builder(NetworkTopology.class)
+                .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
+                .build();
 
-    public static final InstanceIdentifier<Network> UNDERLAY_NETWORK_II = InstanceIdentifier
+    public static final DataObjectIdentifier<Network> UNDERLAY_NETWORK_II = DataObjectIdentifier
             .builder(Networks.class)
-            .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID))).build();
+            .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID)))
+            .build();
 
     public static final DataObjectIdentifier<Network> OVERLAY_NETWORK_II = DataObjectIdentifier
         .builder(Networks.class)
@@ -47,9 +48,10 @@ public final class InstanceIdentifiers {
         .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OTN_NETWORK_ID)))
         .build();
 
-    public static final InstanceIdentifier<Network> CLLI_NETWORK_II = InstanceIdentifier
+    public static final DataObjectIdentifier<Network> CLLI_NETWORK_II = DataObjectIdentifier
             .builder(Networks.class)
-            .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.CLLI_NETWORK_ID))).build();
+            .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.CLLI_NETWORK_ID)))
+            .build();
 
     private InstanceIdentifiers() {
         // Instance should be not created
@@ -77,9 +79,9 @@ public final class InstanceIdentifiers {
                 .build();
     }
 
-    public static InstanceIdentifier<TerminationPoint> createNetworkTerminationPointIIDBuilder(
+    public static DataObjectIdentifier<TerminationPoint> createNetworkTerminationPointIIDBuilder(
             String nodeId, String tpId) {
-        return InstanceIdentifier.builder(Networks.class)
+        return DataObjectIdentifier.builder(Networks.class)
                 .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
                 .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226
                         .networks.network.Node.class,
@@ -98,8 +100,8 @@ public final class InstanceIdentifiers {
      * @param nodeId String
      * @return InstanceIdentifier
      */
-    public static InstanceIdentifier<Node1> createNodeIIDBuilder(String nodeId) {
-        return InstanceIdentifier.builder(Networks.class)
+    public static DataObjectIdentifier<Node1> createNodeIIDBuilder(String nodeId) {
+        return DataObjectIdentifier.builder(Networks.class)
                 .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
                 .child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226
                         .networks.network.Node.class,
index 44cd909943424341f2c6ffc93204675a0ce0135f..813569519e3dc907d9b8854f85bb5d6aa76ebaab 100755 (executable)
@@ -21,8 +21,8 @@ import java.io.StringWriter;
 import java.io.Writer;
 import java.nio.charset.StandardCharsets;
 import org.opendaylight.yangtools.binding.DataObject;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.binding.data.codec.spi.BindingDOMCodecServices;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter;
@@ -56,7 +56,7 @@ public class JsonStringConverter<T extends DataObject> {
      * @return Json string representation of the object
      * @throws IOException if something went wrong.
      */
-    public String createJsonStringFromDataObject(final InstanceIdentifier<T> id, T dataObject,
+    public String createJsonStringFromDataObject(final DataObjectIdentifier<T> id, T dataObject,
             JSONCodecFactorySupplier supplier) throws IOException {
         /*
          * This function needs : - context - scPath.getParent() -
index 7b2ee2a1c231a8107ab9601f4ddd679297455027..df9736974fcd13f66a649382dde9ac25e4354da0 100644 (file)
@@ -38,7 +38,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
@@ -87,7 +87,7 @@ public class CrossConnectImpl121 {
         // post the cross connect on the device
         deviceTx.merge(
             LogicalDatastoreType.CONFIGURATION,
-            InstanceIdentifier
+            DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
                 .build(),
@@ -184,8 +184,8 @@ public class CrossConnectImpl121 {
         return ports != null ? ports : Collections.emptyList();
     }
 
-    private InstanceIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
-        return InstanceIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+    private DataObjectIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
+        return DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
             .build();
     }
@@ -225,8 +225,7 @@ public class CrossConnectImpl121 {
         // post the cross connect on the device
         deviceTx.merge(
             LogicalDatastoreType.CONFIGURATION,
-            InstanceIdentifier
-                .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+            DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(ctNumber))
                 .build(),
             newRdmConn);
index ea0dfef20329bfc716b3275474125f809d5ce482..8b2645d514e1dea4eee602d301d239b6737d1ae5 100644 (file)
@@ -43,7 +43,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.otn.renderer.nodes.Nodes;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
@@ -105,8 +105,7 @@ public class CrossConnectImpl221 {
         // post the cross connect on the device
         deviceTx.merge(
             LogicalDatastoreType.CONFIGURATION,
-            InstanceIdentifier
-                .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+            DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
                 .build(),
             rdmConn);
@@ -251,8 +250,7 @@ public class CrossConnectImpl221 {
         // post the cross connect on the device
         deviceTx.merge(
             LogicalDatastoreType.CONFIGURATION,
-            InstanceIdentifier
-                .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+            DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(ctName))
                 .build(),
             newRdmConn);
@@ -268,16 +266,14 @@ public class CrossConnectImpl221 {
         return false;
     }
 
-    private InstanceIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
-        return InstanceIdentifier
-            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+    private DataObjectIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
+        return DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
             .build();
     }
 
-    private InstanceIdentifier<OduConnection> generateOduConnectionIID(String connectionNumber) {
-        return InstanceIdentifier
-            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+    private DataObjectIdentifier<OduConnection> generateOduConnectionIID(String connectionNumber) {
+        return DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(OduConnection.class, new OduConnectionKey(connectionNumber))
             .build();
     }
@@ -320,8 +316,7 @@ public class CrossConnectImpl221 {
         // post the cross connect on the device
         deviceTx.merge(
             LogicalDatastoreType.CONFIGURATION,
-            InstanceIdentifier
-                .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+            DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(OduConnection.class, new OduConnectionKey(oduXConnectionName))
                 .build(),
             oduConnection);
index ddd647f81abfda50b90c4aeb3651a341050d2c2f..099974c1090be4d0cf807e71a52a6ff999b7ad5a 100644 (file)
@@ -27,7 +27,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.OduConnectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.OduConnectionKey;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.otn.renderer.nodes.Nodes;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -46,9 +46,8 @@ public class CrossConnectImpl710 {
             Timeouts.DEVICE_READ_TIMEOUT_UNIT);
     }
 
-    private InstanceIdentifier<OduConnection> generateOduConnectionIID(String connectionNumber) {
-        return InstanceIdentifier
-            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+    private DataObjectIdentifier<OduConnection> generateOduConnectionIID(String connectionNumber) {
+        return DataObjectIdentifier.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(OduConnection.class, new OduConnectionKey(connectionNumber))
             .build();
     }
@@ -77,7 +76,7 @@ public class CrossConnectImpl710 {
                 .SourceBuilder().setSrcIf(srcTp).build())
             .setDirection(Direction.Bidirectional);
 
-        InstanceIdentifier<OduConnection> oduConnectionIID = InstanceIdentifier
+        DataObjectIdentifier<OduConnection> oduConnectionIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(OduConnection.class, new OduConnectionKey(oduConnectionBuilder.getConnectionName()))
             .build();
index 5737b855e63de8cbcda35b5536eef43049deb877..34b752ab35b73ce8136a657c5e3e8eed5e7da359 100644 (file)
@@ -22,8 +22,8 @@ import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yangtools.binding.DataObject;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -54,20 +54,20 @@ public class DeviceTransaction {
     }
 
     public <T extends DataObject> ListenableFuture<Optional<T>> read(LogicalDatastoreType store,
-            InstanceIdentifier<T> path) {
+            DataObjectIdentifier<T> path) {
         return rwTx.read(store, path);
     }
 
-    public <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data) {
+    public <T extends DataObject> void put(LogicalDatastoreType store, DataObjectIdentifier<T> path, T data) {
         rwTx.put(store, path, data);
     }
 
-    public <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data) {
+    public <T extends DataObject> void merge(LogicalDatastoreType store, DataObjectIdentifier<T> path, T data) {
         rwTx.merge(store, path, data);
     }
 
 
-    public void delete(LogicalDatastoreType store, InstanceIdentifier<?> path) {
+    public void delete(LogicalDatastoreType store, DataObjectIdentifier<?> path) {
         rwTx.delete(store, path);
     }
 
index 56902a8a0ad6c58945794e944667ff61feb1b9e0..0624e1fd7a7cf12ae30b904f679a90482caeb7de 100644 (file)
@@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit;
 import org.opendaylight.mdsal.binding.api.MountPoint;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yangtools.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 
 /**
  * <p>
@@ -152,7 +152,7 @@ public interface DeviceTransactionManager {
      *         empty Optional will be returned.
      */
     <T extends DataObject> Optional<T> getDataFromDevice(String deviceId, LogicalDatastoreType logicalDatastoreType,
-            InstanceIdentifier<T> path, long timeout, TimeUnit timeUnit);
+            DataObjectIdentifier<T> path, long timeout, TimeUnit timeUnit);
 
     /**
      * Checks if device with specified ID is mounted.
index b0d20959a7a638dbd22e7c16b2c1f22386e5f47c..29f9d480e6d4bf25ea55e1a43434c708acaabd04 100644 (file)
@@ -34,7 +34,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
 import org.opendaylight.yangtools.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
@@ -173,14 +173,16 @@ public final class DeviceTransactionManagerImpl implements DeviceTransactionMana
 
     @Override
     public Optional<MountPoint> getDeviceMountPoint(String deviceId) {
-        InstanceIdentifier<Node> netconfNodeIID = InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class,
-                new NodeKey(new NodeId(deviceId)));
-        return mountPointService.getMountPoint(netconfNodeIID);
+        DataObjectIdentifier<Node> netconfNodeIID = InstanceIdentifiers.NETCONF_TOPOLOGY_II
+                .toBuilder()
+                .child(Node.class, new NodeKey(new NodeId(deviceId)))
+                .build();
+        return mountPointService.findMountPoint(netconfNodeIID);
     }
 
     @Override
     public <T extends DataObject> Optional<T> getDataFromDevice(String deviceId,
-            LogicalDatastoreType logicalDatastoreType, InstanceIdentifier<T> path, long timeout, TimeUnit timeUnit) {
+            LogicalDatastoreType logicalDatastoreType, DataObjectIdentifier<T> path, long timeout, TimeUnit timeUnit) {
         Optional<DeviceTransaction> deviceTxOpt;
         try {
             deviceTxOpt = getDeviceTransaction(deviceId, timeout, timeUnit).get();
index e1496c5b54ac3910e936b09e7b40828e4ce71996..3716c7fe491fcf62fffda750761b6ba9a1dbb045 100644 (file)
@@ -59,7 +59,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOT
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOtsiOtsigroup;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOtsiOtucnOducn;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
@@ -250,8 +250,9 @@ public final class MappingUtilsImpl implements MappingUtils {
         /*
          * Getting physical mapping corresponding to logical connection point
          */
-        InstanceIdentifier<NodeInfo> nodeInfoIID = InstanceIdentifier.builder(Network.class).child(Nodes.class,
-                new NodesKey(nodeId)).child(NodeInfo.class).build();
+        DataObjectIdentifier<NodeInfo> nodeInfoIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId)).child(NodeInfo.class)
+                .build();
         try (ReadTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             Optional<NodeInfo> nodeInfoObj =
                     readTx.read(LogicalDatastoreType.CONFIGURATION, nodeInfoIID).get();
@@ -284,8 +285,9 @@ public final class MappingUtilsImpl implements MappingUtils {
     @Override
     public List<McCapabilities> getMcCapabilitiesForNode(String nodeId) {
         List<McCapabilities> mcCapabilities = new ArrayList<>();
-        InstanceIdentifier<Nodes> nodePortMappingIID = InstanceIdentifier.builder(Network.class)
-                .child(Nodes.class, new NodesKey(nodeId)).build();
+        DataObjectIdentifier<Nodes> nodePortMappingIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId))
+                .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodePortMapObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodePortMappingIID)
                     .get();
index 6ec344446a5e34f3ed9746045cf0e44169e43d26..231876bbe10c8a0c28545d6748006b7a2be17701 100644 (file)
@@ -97,7 +97,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.Xp
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.SupportedIfCapability;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.switching.pool.types.rev191129.SwitchingPoolTypes;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
@@ -146,8 +146,8 @@ public class OCPortMappingVersion190 {
         NodeInfo nodeInfo = null;
         List<Mapping> portMapList = new ArrayList<>();
         Map<McCapabilitiesKey, McCapabilities> mcCapabilities = new HashMap<>();
-        InstanceIdentifier<Components> componentIId =
-                InstanceIdentifier.builderOfInherited(OpenconfigPlatformData.class, Components.class).build();
+        DataObjectIdentifier<Components> componentIId =
+                DataObjectIdentifier.builderOfInherited(OpenconfigPlatformData.class, Components.class).build();
         var componentOptional =
                 this.deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL,
                         componentIId, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
@@ -949,7 +949,7 @@ public class OCPortMappingVersion190 {
         nodesList.put(nodes.key(),nodes);
         Network network = new NetworkBuilder().setNodes(nodesList).build();
         final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        DataObjectIdentifier<Network> nodesIID = DataObjectIdentifier.builder(Network.class).build();
         writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
         FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
         try {
index 2c0a5282ccf2b8ec9d7b4b2bc0b88b788da798d3..32a0a68373c8787860db44b507d3fcf3364db361 100644 (file)
@@ -16,7 +16,7 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmappi
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.network.Nodes;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.OduSwitchingPools;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.odu.switching.pools.non.blocking.list.PortList;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 
@@ -203,8 +203,8 @@ public interface PortMapping {
      *
      * @return Result true/false based on status of operation.
      */
-    boolean updatePortMappingWithOduSwitchingPools(String nodeId, InstanceIdentifier<OduSwitchingPools> ospIID,
-        Map<Uint16, List<InstanceIdentifier<PortList>>> nbliidMap);
+    boolean updatePortMappingWithOduSwitchingPools(String nodeId, DataObjectIdentifier<OduSwitchingPools> ospIID,
+        Map<Uint16, List<DataObjectIdentifier<PortList>>> nbliidMap);
 
     /**
      * This method check the presence or not of a given node inside the PortMapping
index e382ff45258cee9577c8131e570756267e42ab30..4187a38d1482a44befb44265ff6317b632e32f81 100644 (file)
@@ -32,8 +32,8 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmappi
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.network.NodesKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.OduSwitchingPools;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.odu.switching.pools.non.blocking.list.PortList;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -100,8 +100,10 @@ public class PortMappingImpl implements PortMapping {
         /*
          * Getting physical mapping corresponding to logical connection point
          */
-        InstanceIdentifier<Mapping> portMappingIID = InstanceIdentifier.builder(Network.class).child(Nodes.class,
-            new NodesKey(nodeId)).child(Mapping.class, new MappingKey(logicalConnPoint)).build();
+        DataObjectIdentifier<Mapping> portMappingIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId))
+                .child(Mapping.class, new MappingKey(logicalConnPoint))
+                .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Mapping> mapObject = readTx.read(LogicalDatastoreType.CONFIGURATION, portMappingIID).get();
             if (mapObject.isPresent()) {
@@ -119,8 +121,9 @@ public class PortMappingImpl implements PortMapping {
 
     @Override
     public Mapping getMapping(String nodeId, String circuitPackName, String portName) {
-        KeyedInstanceIdentifier<Nodes, NodesKey> portMappingIID = InstanceIdentifier.create(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId));
+        WithKey<Nodes, NodesKey> portMappingIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId))
+            .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> portMapppingOpt = readTx.read(LogicalDatastoreType.CONFIGURATION, portMappingIID).get();
             if (portMapppingOpt.isEmpty()) {
@@ -145,8 +148,10 @@ public class PortMappingImpl implements PortMapping {
     public void deleteMapping(String nodeId, String logicalConnectionPoint) {
         LOG.info("Deleting Mapping {} of node '{}'", logicalConnectionPoint, nodeId);
         WriteTransaction rw = this.dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Mapping> mappingIID = InstanceIdentifier.create(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId)).child(Mapping.class, new MappingKey(logicalConnectionPoint));
+        DataObjectIdentifier<Mapping> mappingIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId))
+            .child(Mapping.class, new MappingKey(logicalConnectionPoint))
+            .build();
         rw.delete(LogicalDatastoreType.CONFIGURATION, mappingIID);
         try {
             rw.commit().get(1, TimeUnit.SECONDS);
@@ -161,8 +166,10 @@ public class PortMappingImpl implements PortMapping {
         /*
          * Getting physical mapping corresponding to logical connection point
          */
-        InstanceIdentifier<McCapabilities> mcCapabilitiesIID = InstanceIdentifier.builder(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId)).child(McCapabilities.class, new McCapabilitiesKey(mcLcp)).build();
+        DataObjectIdentifier<McCapabilities> mcCapabilitiesIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId))
+            .child(McCapabilities.class, new McCapabilitiesKey(mcLcp))
+            .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<McCapabilities> mcCapObject = readTx.read(LogicalDatastoreType.CONFIGURATION,
                 mcCapabilitiesIID).get();
@@ -184,8 +191,9 @@ public class PortMappingImpl implements PortMapping {
     public void deletePortMappingNode(String nodeId) {
         LOG.info("Deleting Mapping Data corresponding at node '{}'", nodeId);
         WriteTransaction rw = this.dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.create(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId));
+        DataObjectIdentifier<Nodes> nodesIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId))
+            .build();
         rw.delete(LogicalDatastoreType.CONFIGURATION, nodesIID);
         try {
             rw.commit().get(1, TimeUnit.SECONDS);
@@ -212,8 +220,9 @@ public class PortMappingImpl implements PortMapping {
 
     @Override
     public Nodes getNode(String nodeId) {
-        InstanceIdentifier<Nodes> nodePortMappingIID = InstanceIdentifier.builder(Network.class).child(Nodes.class,
-            new NodesKey(nodeId)).build();
+        DataObjectIdentifier<Nodes> nodePortMappingIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId))
+                .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodePortMapObject =
                 readTx.read(LogicalDatastoreType.CONFIGURATION, nodePortMappingIID).get();
@@ -230,8 +239,8 @@ public class PortMappingImpl implements PortMapping {
     }
 
     @Override
-    public boolean updatePortMappingWithOduSwitchingPools(String nodeId, InstanceIdentifier<OduSwitchingPools> ospIID,
-            Map<Uint16, List<InstanceIdentifier<PortList>>> nbliidMap) {
+    public boolean updatePortMappingWithOduSwitchingPools(String nodeId, DataObjectIdentifier<OduSwitchingPools> ospIID,
+            Map<Uint16, List<DataObjectIdentifier<PortList>>> nbliidMap) {
         OpenroadmNodeVersion openROADMversion = getNode(nodeId).getNodeInfo().getOpenroadmVersion();
         switch (openROADMversion.getIntValue()) {
             case 3:
@@ -250,8 +259,9 @@ public class PortMappingImpl implements PortMapping {
 
     @Override
     public Mapping getMappingFromOtsInterface(String nodeId, String interfName) {
-        KeyedInstanceIdentifier<Nodes, NodesKey> nodePortmappingIID = InstanceIdentifier.create(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId));
+        WithKey<Nodes, NodesKey> nodePortmappingIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId))
+            .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodePortmapppingOpt
                 = readTx.read(LogicalDatastoreType.CONFIGURATION, nodePortmappingIID).get();
index a3600764fa3bf49e5534c47b4ab7c9fec8069e91..fb83f0c271f66567559c9f30de2e1657043f33db 100644 (file)
@@ -78,7 +78,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.Lldp;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.PortConfig;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev161014.SupportedIfCapability;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -111,8 +111,10 @@ public class PortMappingVersion121 {
 
     public boolean createMappingData(String nodeId) {
         LOG.info(PortMappingUtils.CREATE_MAPPING_DATA_LOGMSG, nodeId, "1.2.1");
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
-            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class).child(Info.class).build();
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
+            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+            .child(Info.class)
+            .build();
         Optional<Info> deviceInfoOptional = this.deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType
             .OPERATIONAL, infoIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
         if (deviceInfoOptional.isEmpty()) {
@@ -168,7 +170,7 @@ public class PortMappingVersion121 {
             LOG.error(PortMappingUtils.UNABLE_MAPPING_LOGMSG, nodeId, PortMappingUtils.UPDATE, "a null value");
             return false;
         }
-        InstanceIdentifier<Ports> portId = InstanceIdentifier
+        DataObjectIdentifier<Ports> portId = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName()))
             .child(Ports.class, new PortsKey(oldMapping.getSupportingPort()))
@@ -180,9 +182,10 @@ public class PortMappingVersion121 {
             LOG.debug(PortMappingUtils.UPDATE_MAPPING_LOGMSG,
                 nodeId, oldMapping, oldMapping.getLogicalConnectionPoint(), newMapping);
             final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
-            InstanceIdentifier<Mapping> mapIID = InstanceIdentifier.create(Network.class)
+            DataObjectIdentifier<Mapping> mapIID = DataObjectIdentifier.builder(Network.class)
                 .child(Nodes.class, new NodesKey(nodeId))
-                .child(Mapping.class, new MappingKey(oldMapping.getLogicalConnectionPoint()));
+                .child(Mapping.class, new MappingKey(oldMapping.getLogicalConnectionPoint()))
+                .build();
             writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, mapIID, newMapping);
             FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
             commit.get();
@@ -196,8 +199,9 @@ public class PortMappingVersion121 {
 
     private boolean createXpdrPortMapping(String nodeId, List<Mapping> portMapList) {
         // Creating for Xponder Line and Client Ports
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
-            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class).build();
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
+            .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
+            .build();
         Optional<OrgOpenroadmDevice> deviceObject = deviceTransactionManager.getDataFromDevice(nodeId,
             LogicalDatastoreType.OPERATIONAL, deviceIID,
             Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
@@ -285,7 +289,7 @@ public class PortMappingVersion121 {
             List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps
                 = new ArrayList<>();
             LOG.debug(PortMappingUtils.GETTING_CP_LOGMSG, deviceId, srgCounter);
-            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier
+            DataObjectIdentifier<SharedRiskGroup> srgIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)))
                 .build();
@@ -366,7 +370,7 @@ public class PortMappingVersion121 {
                 nodeId, port.getPortName(), circuitPackName);
             return null;
         }
-        InstanceIdentifier<Ports> port2ID = InstanceIdentifier
+        DataObjectIdentifier<Ports> port2ID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(port.getPartnerPort().getCircuitPackName()))
             .child(Ports.class, new PortsKey(port.getPartnerPort().getPortName()))
@@ -394,7 +398,7 @@ public class PortMappingVersion121 {
     }
 
     private List<Ports> getPortList(String circuitPackName, String nodeId) {
-        InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> cpIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .build();
@@ -434,7 +438,7 @@ public class PortMappingVersion121 {
 
         for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
             LOG.debug(PortMappingUtils.GETTING_CONPORT_LOGMSG, deviceId, degreeCounter);
-            InstanceIdentifier<Degree> deviceIID = InstanceIdentifier
+            DataObjectIdentifier<Degree> deviceIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Degree.class, new DegreeKey(Uint16.valueOf(degreeCounter)))
                 .build();
@@ -459,7 +463,7 @@ public class PortMappingVersion121 {
 
     private Map<String, String> getEthInterfaceList(String nodeId) {
         LOG.info(PortMappingUtils.GETTING_ETH_LIST_LOGMSG, nodeId);
-        InstanceIdentifier<Protocols> protocoliid = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocoliid = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -476,7 +480,7 @@ public class PortMappingVersion121 {
             if (!portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
                 continue;
             }
-            InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier
+            DataObjectIdentifier<Interface> interfaceIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Interface.class, new InterfaceKey(portConfig.getIfName()))
                 .build();
@@ -488,7 +492,7 @@ public class PortMappingVersion121 {
             }
             String supportingCircuitPackName = interfaceObject.orElseThrow().getSupportingCircuitPackName();
             cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
-            InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
+            DataObjectIdentifier<CircuitPacks> circuitPacksIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName))
                 .build();
@@ -546,7 +550,7 @@ public class PortMappingVersion121 {
         Network network = new NetworkBuilder().setNodes(nodesList).build();
 
         final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        DataObjectIdentifier<Network> nodesIID = DataObjectIdentifier.builder(Network.class).build();
         writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
         FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
         try {
@@ -902,7 +906,7 @@ public class PortMappingVersion121 {
     }
 
     private Ports getTtpPort(ConnectionPorts cp, String cpName, String nodeId) {
-        InstanceIdentifier<Ports> portID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(cpName))
             .child(Ports.class, new PortsKey(cp.getPortName()))
@@ -1000,7 +1004,7 @@ public class PortMappingVersion121 {
     }
 
     private Optional<Interface> getInterfaceFromDevice(String nodeId, String interfaceName) {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
index ce809fbecfe12f93b9c9c0afac4879112b246292..c21612e00cdbb3bfd4e79afacd43e02e9caa13d5 100644 (file)
@@ -94,7 +94,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.lldp.conta
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.capability.rev181019.Ports1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev181019.SupportedIfCapability;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.switching.pool.types.rev191129.SwitchingPoolTypes;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -125,7 +125,7 @@ public class PortMappingVersion221 {
 
     public boolean createMappingData(String nodeId) {
         LOG.info(PortMappingUtils.CREATE_MAPPING_DATA_LOGMSG, nodeId, "2.2.1");
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Info.class)
             .build();
@@ -201,7 +201,7 @@ public class PortMappingVersion221 {
                         nodeId,
                         LogicalDatastoreType.OPERATIONAL,
                         // port Identifier
-                        InstanceIdentifier
+                        DataObjectIdentifier
                             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                             .child(CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName()))
                             .child(Ports.class, new PortsKey(oldMapping.getSupportingPort()))
@@ -217,7 +217,7 @@ public class PortMappingVersion221 {
                             nodeId,
                             LogicalDatastoreType.OPERATIONAL,
                             //interface Identifier
-                            InstanceIdentifier
+                            DataObjectIdentifier
                                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                                 .child(Interface.class, new InterfaceKey(oldMapping.getSupportingOts()))
                                 .build(),
@@ -228,9 +228,10 @@ public class PortMappingVersion221 {
             LOG.debug(PortMappingUtils.UPDATE_MAPPING_LOGMSG,
                 nodeId, oldMapping, oldMapping.getLogicalConnectionPoint(), newMapping);
             final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
-            InstanceIdentifier<Mapping> mapIID = InstanceIdentifier.create(Network.class)
+            DataObjectIdentifier<Mapping> mapIID = DataObjectIdentifier.builder(Network.class)
                 .child(Nodes.class, new NodesKey(nodeId))
-                .child(Mapping.class, new MappingKey(oldMapping.getLogicalConnectionPoint()));
+                .child(Mapping.class, new MappingKey(oldMapping.getLogicalConnectionPoint()))
+                .build();
             writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, mapIID, newMapping);
             FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
             commit.get();
@@ -279,7 +280,7 @@ public class PortMappingVersion221 {
     }
 
     private OrgOpenroadmDevice getXpdrDevice(String nodeId) {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject = deviceTransactionManager.getDataFromDevice(nodeId,
@@ -440,7 +441,7 @@ public class PortMappingVersion221 {
             List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.srg.CircuitPacks> srgCps
                 = new ArrayList<>();
             LOG.debug(PortMappingUtils.GETTING_CP_LOGMSG, deviceId, srgCounter);
-            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier
+            DataObjectIdentifier<SharedRiskGroup> srgIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)))
                 .build();
@@ -521,7 +522,7 @@ public class PortMappingVersion221 {
                 nodeId, port.getPortName(), circuitPackName);
             return null;
         }
-        InstanceIdentifier<Ports> port2ID = InstanceIdentifier
+        DataObjectIdentifier<Ports> port2ID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(port.getPartnerPort().getCircuitPackName()))
             .child(Ports.class, new PortsKey(port.getPartnerPort().getPortName()))
@@ -549,7 +550,7 @@ public class PortMappingVersion221 {
     }
 
     private List<Ports> getPortList(String circuitPackName, String nodeId) {
-        InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> cpIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .build();
@@ -589,7 +590,7 @@ public class PortMappingVersion221 {
 
         for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
             LOG.debug(PortMappingUtils.GETTING_CONPORT_LOGMSG, deviceId, degreeCounter);
-            InstanceIdentifier<Degree> deviceIID = InstanceIdentifier
+            DataObjectIdentifier<Degree> deviceIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Degree.class, new DegreeKey(Uint16.valueOf(degreeCounter)))
                 .build();
@@ -619,7 +620,7 @@ public class PortMappingVersion221 {
         // if not present assume to be 20 (temporary)
         Integer maxSrg = ordmInfo.getMaxSrgs() == null ? 20 : ordmInfo.getMaxSrgs().toJava();
         for (int srgCounter = 1; srgCounter <= maxSrg; srgCounter++) {
-            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier
+            DataObjectIdentifier<SharedRiskGroup> srgIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)))
                 .build();
@@ -636,7 +637,7 @@ public class PortMappingVersion221 {
 
     private Map<String, String> getEthInterfaceList(String nodeId) {
         LOG.info(PortMappingUtils.GETTING_ETH_LIST_LOGMSG, nodeId);
-        InstanceIdentifier<Protocols> protocoliid = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocoliid = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -653,7 +654,7 @@ public class PortMappingVersion221 {
             if (!portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
                 continue;
             }
-            InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier
+            DataObjectIdentifier<Interface> interfaceIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Interface.class, new InterfaceKey(portConfig.getIfName()))
                 .build();
@@ -665,7 +666,7 @@ public class PortMappingVersion221 {
             }
             String supportingCircuitPackName = interfaceObject.orElseThrow().getSupportingCircuitPackName();
             cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
-            InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
+            DataObjectIdentifier<CircuitPacks> circuitPacksIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName))
                 .build();
@@ -747,7 +748,7 @@ public class PortMappingVersion221 {
 
         Network network = new NetworkBuilder().setNodes(nodesList).build();
         final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        DataObjectIdentifier<Network> nodesIID = DataObjectIdentifier.builder(Network.class).build();
         writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
         FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
         try {
@@ -1171,7 +1172,7 @@ public class PortMappingVersion221 {
     }
 
     private Ports getTtpPort(ConnectionPorts cp, String cpName, String nodeId) {
-        InstanceIdentifier<Ports> portID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(cpName))
             .child(Ports.class, new PortsKey(cp.getPortName()))
@@ -1260,7 +1261,7 @@ public class PortMappingVersion221 {
     }
 
     private Optional<Interface> getInterfaceFromDevice(String nodeId, String interfaceName) {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
index c9cf6cba2591922ae6f071257f77ea97059c8e16..f5ade6ffe9f533b30db828abac95ad1d2c988634 100644 (file)
@@ -101,8 +101,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev200529.lldp.conta
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OpucnTribSlotDef;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.capability.rev200529.Ports1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.capability.rev200529.port.capability.grp.port.capabilities.SupportedInterfaceCapability;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -135,7 +135,7 @@ public class PortMappingVersion710 {
 
     public boolean createMappingData(String nodeId) {
         LOG.info(PortMappingUtils.CREATE_MAPPING_DATA_LOGMSG, nodeId, "7.1");
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Info.class)
             .build();
@@ -210,7 +210,7 @@ public class PortMappingVersion710 {
             LOG.error(PortMappingUtils.UNABLE_MAPPING_LOGMSG, nodeId, PortMappingUtils.UPDATE, "a null value");
             return false;
         }
-        InstanceIdentifier<Ports> portId = InstanceIdentifier
+        DataObjectIdentifier<Ports> portId = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName()))
             .child(Ports.class, new PortsKey(oldMapping.getSupportingPort()))
@@ -222,9 +222,10 @@ public class PortMappingVersion710 {
             LOG.debug(PortMappingUtils.UPDATE_MAPPING_LOGMSG,
                 nodeId, oldMapping, oldMapping.getLogicalConnectionPoint(), newMapping);
             final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
-            InstanceIdentifier<Mapping> mapIID = InstanceIdentifier.create(Network.class)
+            DataObjectIdentifier<Mapping> mapIID = DataObjectIdentifier.builder(Network.class)
                 .child(Nodes.class, new NodesKey(nodeId))
-                .child(Mapping.class, new MappingKey(oldMapping.getLogicalConnectionPoint()));
+                .child(Mapping.class, new MappingKey(oldMapping.getLogicalConnectionPoint()))
+                .build();
             writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, mapIID, newMapping);
             FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
             commit.get();
@@ -236,11 +237,12 @@ public class PortMappingVersion710 {
         }
     }
 
-    public boolean updatePortMappingWithOduSwitchingPools(String nodeId, InstanceIdentifier<OduSwitchingPools> ospIID,
-            Map<Uint16, List<InstanceIdentifier<PortList>>> nbliidMap) {
+    public boolean updatePortMappingWithOduSwitchingPools(String nodeId, DataObjectIdentifier<OduSwitchingPools> ospIID,
+            Map<Uint16, List<DataObjectIdentifier<PortList>>> nbliidMap) {
 
-        KeyedInstanceIdentifier<Nodes, NodesKey> portMappingNodeIID =
-            InstanceIdentifier.create(Network.class).child(Nodes.class, new NodesKey(nodeId));
+        WithKey<Nodes, NodesKey> portMappingNodeIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey(nodeId))
+                .build();
         Nodes portmappingNode = null;
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             portmappingNode = readTx.read(LogicalDatastoreType.CONFIGURATION, portMappingNodeIID).get().orElseThrow();
@@ -261,7 +263,7 @@ public class PortMappingVersion710 {
             : new SwitchingPoolLcpBuilder().setSwitchingPoolNumber(ospNumber)
                 .setSwitchingPoolType(osp.getSwitchingPoolType());
         Map<NonBlockingListKey, NonBlockingList> nblMap = new HashMap<>();
-        for (Entry<Uint16, List<InstanceIdentifier<PortList>>> entry : nbliidMap.entrySet()) {
+        for (Entry<Uint16, List<DataObjectIdentifier<PortList>>> entry : nbliidMap.entrySet()) {
             NonBlockingList nbl = createNonBlockingList(
                 splBldr,
                 osp.getNonBlockingList()
@@ -284,13 +286,14 @@ public class PortMappingVersion710 {
     }
 
     private NonBlockingList createNonBlockingList(SwitchingPoolLcpBuilder splBldr, Uint32 interconnectBw,
-            Entry<Uint16, List<InstanceIdentifier<PortList>>> entry, Map<MappingKey, Mapping> mappings, String nodeId) {
+            Entry<Uint16, List<DataObjectIdentifier<PortList>>> entry, Map<MappingKey, Mapping> mappings,
+            String nodeId) {
         NonBlockingListBuilder nblBldr = splBldr.getNonBlockingList() == null
             || !splBldr.getNonBlockingList().containsKey(new NonBlockingListKey(entry.getKey()))
                 ? new NonBlockingListBuilder().setNblNumber(entry.getKey()).setInterconnectBandwidth(interconnectBw)
                 : new NonBlockingListBuilder(splBldr.getNonBlockingList().get(new NonBlockingListKey(entry.getKey())));
         Set<String> lcpList = nblBldr.getLcpList() != null ? nblBldr.getLcpList() : new HashSet<>();
-        for (InstanceIdentifier<PortList> id : entry.getValue()) {
+        for (DataObjectIdentifier<PortList> id : entry.getValue()) {
             PortList portList = deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL,
                 id, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT).orElseThrow();
             String lcp = getLcpFromCpAndPort(mappings, portList.getCircuitPackName(), portList.getPortName());
@@ -339,7 +342,7 @@ public class PortMappingVersion710 {
     }
 
     private OrgOpenroadmDevice getXpdrDevice(String nodeId) {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject = deviceTransactionManager.getDataFromDevice(nodeId,
@@ -499,7 +502,7 @@ public class PortMappingVersion710 {
             List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.srg.CircuitPacks> srgCps
                 = new ArrayList<>();
             LOG.debug(PortMappingUtils.GETTING_CP_LOGMSG, deviceId, srgCounter);
-            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier
+            DataObjectIdentifier<SharedRiskGroup> srgIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)))
                 .build();
@@ -580,7 +583,7 @@ public class PortMappingVersion710 {
                 nodeId, port.getPortName(), circuitPackName);
             return null;
         }
-        InstanceIdentifier<Ports> port2ID = InstanceIdentifier
+        DataObjectIdentifier<Ports> port2ID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(port.getPartnerPort().getCircuitPackName()))
             .child(Ports.class, new PortsKey(port.getPartnerPort().getPortName()))
@@ -608,7 +611,7 @@ public class PortMappingVersion710 {
     }
 
     private List<Ports> getPortList(String circuitPackName, String nodeId) {
-        InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> cpIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .build();
@@ -638,7 +641,7 @@ public class PortMappingVersion710 {
 
     private Map<McCapabilityProfileKey, McCapabilityProfile> getMcCapabilityProfiles(String deviceId, Info ordmInfo) {
         Map<McCapabilityProfileKey, McCapabilityProfile>  mcCapabilityProfiles = new HashMap<>();
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject = deviceTransactionManager.getDataFromDevice(deviceId,
@@ -667,7 +670,7 @@ public class PortMappingVersion710 {
 
         for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
             LOG.debug(PortMappingUtils.GETTING_CONPORT_LOGMSG, deviceId, degreeCounter);
-            InstanceIdentifier<Degree> deviceIID = InstanceIdentifier
+            DataObjectIdentifier<Degree> deviceIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Degree.class, new DegreeKey(Uint16.valueOf(degreeCounter)))
                 .build();
@@ -697,7 +700,7 @@ public class PortMappingVersion710 {
         // if not present assume to be 20 (temporary)
         Integer maxSrg = ordmInfo.getMaxSrgs() == null ? 20 : ordmInfo.getMaxSrgs().toJava();
         for (int srgCounter = 1; srgCounter <= maxSrg; srgCounter++) {
-            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier
+            DataObjectIdentifier<SharedRiskGroup> srgIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(srgCounter)))
                 .build();
@@ -714,7 +717,7 @@ public class PortMappingVersion710 {
 
     private Map<String, String> getEthInterfaceList(String nodeId) {
         LOG.info(PortMappingUtils.GETTING_ETH_LIST_LOGMSG, nodeId);
-        InstanceIdentifier<Protocols> protocoliid = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocoliid = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -731,7 +734,7 @@ public class PortMappingVersion710 {
             if (!portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
                 continue;
             }
-            InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier
+            DataObjectIdentifier<Interface> interfaceIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Interface.class, new InterfaceKey(portConfig.getIfName()))
                 .build();
@@ -743,7 +746,7 @@ public class PortMappingVersion710 {
             }
             String supportingCircuitPackName = interfaceObject.orElseThrow().getSupportingCircuitPackName();
             cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
-            InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
+            DataObjectIdentifier<CircuitPacks> circuitPacksIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName))
                 .build();
@@ -829,7 +832,7 @@ public class PortMappingVersion710 {
         Network network = new NetworkBuilder().setNodes(nodesList).build();
 
         final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        DataObjectIdentifier<Network> nodesIID = DataObjectIdentifier.builder(Network.class).build();
         writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
         FluentFuture<? extends @NonNull CommitInfo> commit = writeTransaction.commit();
         try {
@@ -1142,7 +1145,7 @@ public class PortMappingVersion710 {
         ArrayList<OpucnTribSlotDef> minMaxOpucnTribSlots = new ArrayList<>(2);
 
         LOG.info("{} : Getting Min/Max Trib-slots from {}", deviceId, mxpProfileName);
-        InstanceIdentifier<MuxpProfile> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<MuxpProfile> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(MuxpProfile.class, new MuxpProfileKey(mxpProfileName))
             .build();
@@ -1399,7 +1402,7 @@ public class PortMappingVersion710 {
     }
 
     private Ports getTtpPort(ConnectionPorts cp, String cpName, String nodeId) {
-        InstanceIdentifier<Ports> portID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(cpName))
             .child(Ports.class, new PortsKey(cp.getPortName()))
@@ -1499,7 +1502,7 @@ public class PortMappingVersion710 {
     }
 
     private Optional<Interface> getInterfaceFromDevice(String nodeId, String interfaceName) {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
index d6d9cd09426989a03c084b11f0c75a4210bc4ee3..5526c68ccd58e83f805925d25112476d0a8a8a7e 100644 (file)
@@ -14,7 +14,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.open.terminal.meta.data.rev240124.OpenTerminalMetaData;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
@@ -45,8 +45,8 @@ public class OCMetaDataTransactionImpl implements OCMetaDataTransaction {
     @Override
     public OpenTerminalMetaData getXPDROpenTerminalMetaData() {
         OpenTerminalMetaData terminalMetaData = null;
-        InstanceIdentifier<OpenTerminalMetaData> iidOTMD = InstanceIdentifier
-                .builder(OpenTerminalMetaData.class).build();
+        DataObjectIdentifier<OpenTerminalMetaData> iidOTMD = DataObjectIdentifier.builder(OpenTerminalMetaData.class)
+                .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<OpenTerminalMetaData> openTerminalMetaData =
                     readTx.read(LogicalDatastoreType.CONFIGURATION, iidOTMD).get();
index a4512d8a5c9f8a9e92d681beade782ffa2e13a96..cb92bd43f1634b6828eec03d7694b91338e5a099 100755 (executable)
@@ -32,7 +32,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev161014.AdminStates;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev161014.States;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,7 +62,7 @@ public class OpenRoadmInterfacesImpl121 {
                 nodeId), e);
         }
 
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(ifBuilder.getName()))
             .build();
@@ -105,7 +105,7 @@ public class OpenRoadmInterfacesImpl121 {
 
 
     public Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
@@ -137,7 +137,7 @@ public class OpenRoadmInterfacesImpl121 {
                     + " deleting it!", interfaceName, AdminStates.OutOfService), ex);
             }
 
-            InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+            DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Interface.class, new InterfaceKey(interfaceName))
                 .build();
@@ -182,7 +182,7 @@ public class OpenRoadmInterfacesImpl121 {
     public void postEquipmentState(String nodeId, String circuitPackName, boolean activate)
         throws OpenRoadmInterfaceException {
 
-        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPackIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .build();
@@ -253,7 +253,7 @@ public class OpenRoadmInterfacesImpl121 {
     }
 
     private boolean checkIfDevicePortIsUpdatedWithInterface(String nodeId, InterfaceBuilder ifBuilder) {
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(ifBuilder.getSupportingCircuitPackName()))
             .child(Ports.class, new PortsKey(ifBuilder.getSupportingPort()))
index ab8c59ef456f67943291d38f881de6b3f7c1bc42..eb6327fb0e235acf6e1fb94a4beb31c5dd75954d 100755 (executable)
@@ -35,7 +35,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.port.Interfaces;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.AdminStates;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.States;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,7 +69,7 @@ public class OpenRoadmInterfacesImpl221 {
                 nodeId), e);
         }
 
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(ifBuilder.getName()))
             .build();
@@ -114,7 +114,7 @@ public class OpenRoadmInterfacesImpl221 {
 
 
     public Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
@@ -147,7 +147,7 @@ public class OpenRoadmInterfacesImpl221 {
                     + " deleting it!", interfaceName, AdminStates.OutOfService), ex);
             }
 
-            InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+            DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Interface.class, new InterfaceKey(interfaceName))
                 .build();
@@ -195,7 +195,7 @@ public class OpenRoadmInterfacesImpl221 {
 
     public void postEquipmentState(String nodeId, String circuitPackName, boolean activate)
         throws OpenRoadmInterfaceException {
-        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPackIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .build();
@@ -267,7 +267,7 @@ public class OpenRoadmInterfacesImpl221 {
     }
 
     private boolean checkIfDevicePortIsUpdatedWithInterface(String nodeId, InterfaceBuilder ifBuilder) {
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(ifBuilder.getSupportingCircuitPackName()))
             .child(Ports.class, new PortsKey(ifBuilder.getSupportingPort()))
index b3d9dea5398f8c5dd60defce0c16b6e132930791..b9ab5bcd180895e4c072c7f7d5f3ec1f02d9ba2f 100644 (file)
@@ -35,7 +35,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.port.Interfaces;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.States;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,7 +69,7 @@ public class OpenRoadmInterfacesImpl710 {
                 nodeId), e);
         }
 
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(ifBuilder.getName()))
             .build();
@@ -114,7 +114,7 @@ public class OpenRoadmInterfacesImpl710 {
 
 
     public Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
@@ -153,7 +153,7 @@ public class OpenRoadmInterfacesImpl710 {
                     + " deleting it!", interfaceName, AdminStates.OutOfService), ex);
             }
 
-            InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+            DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(Interface.class, new InterfaceKey(interfaceName))
                 .build();
@@ -202,7 +202,7 @@ public class OpenRoadmInterfacesImpl710 {
 
     public void postEquipmentState(String nodeId, String circuitPackName, boolean activate)
         throws OpenRoadmInterfaceException {
-        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPackIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .build();
@@ -274,7 +274,7 @@ public class OpenRoadmInterfacesImpl710 {
     }
 
     private boolean checkIfDevicePortIsUpdatedWithInterface(String nodeId, InterfaceBuilder ifBuilder) {
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(ifBuilder.getSupportingCircuitPackName()))
             .child(Ports.class, new PortsKey(ifBuilder.getSupportingPort()))
index e1d977858c14b0b78f1e78e8baaa49e1383b037c..149a39b753293e9d22c3e6cd5ecd708d7aa2a7ed 100644 (file)
@@ -31,7 +31,7 @@ import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.transportpce.test.converter.DataObjectConverter;
 import org.opendaylight.transportpce.test.converter.JSONDataObjectConverter;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OperationalModeCatalog;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.slf4j.Logger;
@@ -60,7 +60,7 @@ public class CatalogUtilsTest extends AbstractTest {
             WriteTransaction newWriteOnlyTransaction = getDataBroker().newWriteOnlyTransaction();
             newWriteOnlyTransaction
                 .put(LogicalDatastoreType.CONFIGURATION,
-                    InstanceIdentifier.create(OperationalModeCatalog.class),
+                    DataObjectIdentifier.builder(OperationalModeCatalog.class).build(),
                     omCatalog);
             newWriteOnlyTransaction.commit().get();
         } catch (IOException e) {
index 1f66142b9ed3e068c3e1fc9966334dd7aedf0d5d..7fbe218c014709d6e8f115bf83c7e6de48c9f904 100644 (file)
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
 import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.transportpce.test.converter.JSONDataObjectConverter;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev220221.Request;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 
@@ -35,7 +35,7 @@ public class JsonStringConverterTest extends AbstractTest {
                 Files.readString(Paths.get("src/test/resources/expected_string.json")),
                 new JsonStringConverter<Request>(getDataStoreContextUtil().getBindingDOMCodecServices())
                     .createJsonStringFromDataObject(
-                        InstanceIdentifier.builder(Request.class).build(),
+                        DataObjectIdentifier.builder(Request.class).build(),
                         //gnpyRequest
                         (Request) getDataStoreContextUtil()
                             .getBindingDOMCodecServices()
index 6c247be1ae5dd5f1ea7a9076d068e022dd9f7ae3..c4874df56cbbd559e1f3146737c7adccaab354ac 100644 (file)
@@ -37,8 +37,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
@@ -59,7 +59,7 @@ public class CrossConnectImpl121Test {
         crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
 
         //mock responses for deviceTransactionManager calls
-        InstanceIdentifier<RoadmConnections> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<RoadmConnections> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey("1"))
             .build();
@@ -78,7 +78,7 @@ public class CrossConnectImpl121Test {
 
     @Test
     void postCrossConnectTest() {
-        when(mountPointServiceMock.getMountPoint(any())).thenReturn(Optional.of(mountPointMock));
+        when(mountPointServiceMock.findMountPoint(any())).thenReturn(Optional.of(mountPointMock));
         when(mountPointMock.getService(any())).thenReturn(Optional.of(dataBrokerMock));
         when(dataBrokerMock.newReadWriteTransaction()).thenReturn(rwTransactionMock);
         when(rwTransactionMock.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
@@ -94,7 +94,7 @@ public class CrossConnectImpl121Test {
 
     @Test
     void setPowerLevelTest() {
-        InstanceIdentifier<RoadmConnections> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<RoadmConnections> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey("1"))
             .build();
index 03735fdd2d536c9c4f56611d187067aeda0863c9..597d23a0383c946422605e8bb3147bf2cc55b666 100644 (file)
@@ -40,8 +40,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.otn.renderer.nodes.Nodes;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
@@ -61,7 +61,7 @@ public class CrossConnectImpl221Test {
         crossConnectImpl221 = new CrossConnectImpl221(deviceTransactionManager);
 
         //mock responses for deviceTransactionManager calls
-        InstanceIdentifier<RoadmConnections> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<RoadmConnections> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey("1"))
             .build();
@@ -81,7 +81,7 @@ public class CrossConnectImpl221Test {
 
     @Test
     void postCrossConnectTest() {
-        when(mountPointServiceMock.getMountPoint(any())).thenReturn(Optional.of(mountPointMock));
+        when(mountPointServiceMock.findMountPoint(any())).thenReturn(Optional.of(mountPointMock));
         when(mountPointMock.getService(any())).thenReturn(Optional.of(dataBrokerMock));
         when(dataBrokerMock.newReadWriteTransaction()).thenReturn(rwTransactionMock);
         when(rwTransactionMock.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
@@ -97,7 +97,7 @@ public class CrossConnectImpl221Test {
 
     @Test
     void setPowerLevelTest() {
-        InstanceIdentifier<RoadmConnections> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<RoadmConnections> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey("1"))
             .build();
index 9cbf36c8f6de86fc3a92b65a6038c4f69d57a466..83ee94b28597214716492617dee701181c6f2b84 100644 (file)
@@ -38,9 +38,10 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.NetworkBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.NetworkKey;
 import org.opendaylight.yangtools.binding.DataObject;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 @ExtendWith(MockitoExtension.class)
 public class DeviceTransactionManagerTest {
@@ -58,15 +59,16 @@ public class DeviceTransactionManagerTest {
     private DeviceTransactionManagerImpl transactionManager;
     private String defaultDeviceId = "device-id";
     private LogicalDatastoreType defaultDatastore = LogicalDatastoreType.OPERATIONAL;
-    private InstanceIdentifier<Network> defaultIid = InstanceIdentifier
-        .builder(Networks.class).child(Network.class).build();
+    private DataObjectIdentifier<Network> defaultIid = DataObjectIdentifier.builder(Networks.class)
+            .child(Network.class, new NetworkKey(new NetworkId("default-network")))
+            .build();
     private Network defaultData;
     private long defaultTimeout = 1000;
     private TimeUnit defaultTimeUnit = TimeUnit.MILLISECONDS;
 
     @BeforeEach
     void before() {
-        when(mountPointServiceMock.getMountPoint(any())).thenReturn(Optional.of(mountPointMock));
+        when(mountPointServiceMock.findMountPoint(any())).thenReturn(Optional.of(mountPointMock));
         when(mountPointMock.getService(any())).thenReturn(Optional.of(dataBrokerMock));
         when(dataBrokerMock.newReadWriteTransaction()).thenReturn(rwTransactionMock);
         lenient().when(rwTransactionMock.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
@@ -304,7 +306,7 @@ public class DeviceTransactionManagerTest {
     }
 
     private <T extends DataObject> void putAndSubmit(DeviceTransactionManagerImpl deviceTxManager, String deviceId,
-            LogicalDatastoreType store, InstanceIdentifier<T> path, T data)
+            LogicalDatastoreType store, DataObjectIdentifier<T> path, T data)
             throws ExecutionException, InterruptedException {
         Future<java.util.Optional<DeviceTransaction>> deviceTxFuture = deviceTxManager.getDeviceTransaction(deviceId);
         DeviceTransaction deviceTx = deviceTxFuture.get().orElseThrow();
index dab1fc0c0effb22173678b599df0fbcfc61e8cac..475d4e29d9b7509b2a2a17a699403169d5700f64 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.transportpce.test.converter.DataObjectConverter;
 import org.opendaylight.transportpce.test.converter.JSONDataObjectConverter;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.Network;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.slf4j.Logger;
@@ -50,8 +50,10 @@ public class MappingUtilsImplTest extends AbstractTest {
                     .getBindingDOMCodecServices().fromNormalizedNode(YangInstanceIdentifier
                             .of(Network.QNAME), normalizedNode).getValue();
             WriteTransaction writeNetworkTransaction = getDataBroker().newWriteOnlyTransaction();
-            writeNetworkTransaction.put(LogicalDatastoreType.CONFIGURATION,
-                    InstanceIdentifier.builder(Network.class).build(), network);
+            writeNetworkTransaction.put(
+                    LogicalDatastoreType.CONFIGURATION,
+                    DataObjectIdentifier.builder(Network.class).build(),
+                    network);
             writeNetworkTransaction.commit().get();
         } catch (IOException e) {
             LOG.error("Cannot load network ", e);
index 550ed803c8e19dc9c19f50ecc3d875c862c269fe..cda493a6929712ab5dc58fb030eca55e13328912 100644 (file)
@@ -36,7 +36,7 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmappi
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.network.NodesKey;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.network.nodes.NodeInfo;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.network.nodes.NodeInfoBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 
 public class PortMappingImplTest {
 
@@ -77,17 +77,19 @@ public class PortMappingImplTest {
                 .setPortDirection("1").setConnectionMapLcp("1").setPartnerLcp("1")
                 .setPortQual("1").setSupportingCircuitPackName("1").setSupportingOms("1")
                 .setSupportingOts("1").setSupportingPort("1").build();
-        InstanceIdentifier<Mapping> portMappingIID = InstanceIdentifier.builder(Network.class)
+        DataObjectIdentifier<Mapping> portMappingIID = DataObjectIdentifier.builder(Network.class)
                 .child(Nodes.class, new NodesKey("node"))
                 .child(Mapping.class, new MappingKey("logicalConnectionPoint"))
                 .build();
-        InstanceIdentifier<NodeInfo> nodeInfoIID = InstanceIdentifier.builder(Network.class).child(Nodes.class,
-                new NodesKey("node")).child(NodeInfo.class).build();
+        DataObjectIdentifier<NodeInfo> nodeInfoIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey("node")).child(NodeInfo.class)
+                .build();
         final NodeInfo nodeInfo = new NodeInfoBuilder().setOpenroadmVersion(OpenroadmNodeVersion._221).build();
         final NodeInfo nodeInfo2 = new NodeInfoBuilder().setOpenroadmVersion(OpenroadmNodeVersion._121).build();
         Nodes nodes = new NodesBuilder().setNodeId("node").setNodeInfo(nodeInfo).build();
-        InstanceIdentifier<Nodes> nodeIID = InstanceIdentifier.builder(Network.class).child(Nodes.class,
-                new NodesKey("node")).build();
+        DataObjectIdentifier<Nodes> nodeIID = DataObjectIdentifier.builder(Network.class)
+                .child(Nodes.class, new NodesKey("node"))
+                .build();
         //create node with portmapping and nodeifno version 2
         WriteTransaction wr = dataBroker.newWriteOnlyTransaction();
         wr.merge(LogicalDatastoreType.CONFIGURATION, nodeIID, nodes);
index 54bdbd5b986a9eb6300ca6e425c7d4743a9575b0..d09a23a5e24d5d8a1985d2b7de9dd4cf507674ec 100644 (file)
@@ -85,7 +85,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.conta
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yangtools.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -284,7 +284,7 @@ public class PortMappingVersion121Test {
         Protocols protocols = new ProtocolsBuilder().addAugmentation(augmentation).build();
 
         // mock responses for deviceTransactionManager calls
-        InstanceIdentifier<Degree> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<Degree> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Degree.class, new DegreeKey(Uint16.valueOf(1)))
             .build();
@@ -292,7 +292,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(ordmDegreeObject));
 
-        InstanceIdentifier<Degree> deviceIID3 = InstanceIdentifier
+        DataObjectIdentifier<Degree> deviceIID3 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Degree.class, new DegreeKey(Uint16.valueOf(2)))
             .build();
@@ -300,7 +300,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(ordmDegreeObject3));
 
-        InstanceIdentifier<Degree> deviceIID5 = InstanceIdentifier
+        DataObjectIdentifier<Degree> deviceIID5 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Degree.class, new DegreeKey(Uint16.valueOf(3)))
             .build();
@@ -308,7 +308,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(ordmDegreeObject5));
 
-        InstanceIdentifier<Protocols> protocoliid = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocoliid = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -317,7 +317,7 @@ public class PortMappingVersion121Test {
 
         Interface interfaceObject = new InterfaceBuilder().withKey(new InterfaceKey("itf1"))
                 .setSupportingCircuitPackName("sc1").build();
-        InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfaceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(portConfig.getIfName()))
             .build();
@@ -325,58 +325,58 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(interfaceObject));
 
-        InstanceIdentifier<Ports> portID = getChild("c1", "p1");
+        DataObjectIdentifier<Ports> portID = getChild("c1", "p1");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports));
 
         // mock 2 bidirectional port for SRG
         Ports ports1 = getPortsWithInterfaces(interfacesList, "p2");
-        InstanceIdentifier<Ports> portID1 = getChild("c2", "p1");
+        DataObjectIdentifier<Ports> portID1 = getChild("c2", "p1");
         when(deviceTransactionManager.getDataFromDevice("node",
             LogicalDatastoreType.OPERATIONAL, portID1,
             Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
             .thenReturn(Optional.of(ports1));
 
-        InstanceIdentifier<Ports> portID2 = getChild("c3", "p2");
+        DataObjectIdentifier<Ports> portID2 = getChild("c3", "p2");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID2,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports2));
 
-        InstanceIdentifier<Ports> portID3 = getChild("c3", "p3");
+        DataObjectIdentifier<Ports> portID3 = getChild("c3", "p3");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID3,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports3));
 
-        InstanceIdentifier<Ports> portID22 = getChild("c5", "p22");
+        DataObjectIdentifier<Ports> portID22 = getChild("c5", "p22");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID22,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports22));
 
-        InstanceIdentifier<Ports> portID33 = getChild("c5", "p33");
+        DataObjectIdentifier<Ports> portID33 = getChild("c5", "p33");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID33,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports33));
 
-        InstanceIdentifier<Ports> portID4 = getChild("c4", "p4");
+        DataObjectIdentifier<Ports> portID4 = getChild("c4", "p4");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID4,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports4));
 
-        InstanceIdentifier<Ports> portID5 = getChild("c4", "p5");
+        DataObjectIdentifier<Ports> portID5 = getChild("c4", "p5");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID5,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports5));
 
-        InstanceIdentifier<Ports> portID44 = getChild("c6", "p44");
+        DataObjectIdentifier<Ports> portID44 = getChild("c6", "p44");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID44,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports44));
 
-        InstanceIdentifier<Ports> portID55 = getChild("c6", "p55");
+        DataObjectIdentifier<Ports> portID55 = getChild("c6", "p55");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID55,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports55));
 
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Info.class)
             .build();
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, infoIID,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(info));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c1"))
             .build();
@@ -384,7 +384,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID2 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID2 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c2"))
             .build();
@@ -392,7 +392,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject2));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID3 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID3 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c3"))
             .build();
@@ -400,7 +400,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject3));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID4 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID4 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c4"))
             .build();
@@ -408,7 +408,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject4));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID5 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID5 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c5"))
             .build();
@@ -416,7 +416,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject5));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID6 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID6 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c6"))
             .build();
@@ -424,7 +424,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject6));
 
-        InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier
+        DataObjectIdentifier<SharedRiskGroup> srgIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(1)))
             .build();
@@ -432,7 +432,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(ordmSrgObject));
 
-        InstanceIdentifier<SharedRiskGroup> srgIID4 = InstanceIdentifier
+        DataObjectIdentifier<SharedRiskGroup> srgIID4 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(2)))
             .build();
@@ -440,7 +440,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(ordmSrgObject4));
 
-        InstanceIdentifier<SharedRiskGroup> srgIID6 = InstanceIdentifier
+        DataObjectIdentifier<SharedRiskGroup> srgIID6 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(SharedRiskGroup.class, new SharedRiskGroupKey(Uint16.valueOf(3)))
             .build();
@@ -454,7 +454,7 @@ public class PortMappingVersion121Test {
 
         // assert all portmappings have been created for the roadm node
         ReadTransaction rr = dataBroker.newReadOnlyTransaction();
-        InstanceIdentifier<Network> mappingIID = InstanceIdentifier.create(Network.class);
+        DataObjectIdentifier<Network> mappingIID = DataObjectIdentifier.builder(Network.class).build();
         Network network = new NetworkBuilder().build();
         try {
             Optional<Network> optionalNetwork = rr.read(LogicalDatastoreType.CONFIGURATION, mappingIID).get();
@@ -534,31 +534,31 @@ public class PortMappingVersion121Test {
         connectionMapMap.put(connectionMap.key(), connectionMap);
 
         // mock reponses for deviceTransactionManager
-        InstanceIdentifier<Ports> portID = getChild("c1", "p1");
+        DataObjectIdentifier<Ports> portID = getChild("c1", "p1");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports));
 
-        InstanceIdentifier<Ports> portID11 = getChild("c2", "p11");
+        DataObjectIdentifier<Ports> portID11 = getChild("c2", "p11");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID11,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports11));
 
-        InstanceIdentifier<Ports> portID2 = getChild("c3", "p2");
+        DataObjectIdentifier<Ports> portID2 = getChild("c3", "p2");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID2,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports2));
 
-        InstanceIdentifier<Ports> portID3 = getChild("c3", "p3");
+        DataObjectIdentifier<Ports> portID3 = getChild("c3", "p3");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID3,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports3));
 
-        InstanceIdentifier<Ports> portID4 = getChild("c4", "p4");
+        DataObjectIdentifier<Ports> portID4 = getChild("c4", "p4");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID4,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports4));
 
-        InstanceIdentifier<Ports> portID5 = getChild("c4", "p5");
+        DataObjectIdentifier<Ports> portID5 = getChild("c4", "p5");
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, portID5,
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT)).thenReturn(Optional.of(ports5));
 
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Info.class)
             .build();
@@ -571,7 +571,7 @@ public class PortMappingVersion121Test {
         CircuitPacks circuitPackObject3 = getCircuitPacks(portsList2, "c3", "pc3");
         CircuitPacks circuitPackObject4 = getCircuitPacks(portsList4, "c4", "pc4");
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c1"))
             .build();
@@ -579,7 +579,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID2 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID2 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c2"))
             .build();
@@ -587,7 +587,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject2));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID3 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID3 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c3"))
             .build();
@@ -595,7 +595,7 @@ public class PortMappingVersion121Test {
                 Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
                         .thenReturn(Optional.of(circuitPackObject3));
 
-        InstanceIdentifier<CircuitPacks> circuitPacksIID4 = InstanceIdentifier
+        DataObjectIdentifier<CircuitPacks> circuitPacksIID4 = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey("c4"))
             .build();
@@ -611,7 +611,7 @@ public class PortMappingVersion121Test {
 
         OrgOpenroadmDevice deviceObject = new OrgOpenroadmDeviceBuilder().setCircuitPacks(circuitPacksMap)
                 .setConnectionMap(connectionMapMap).build();
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         when(deviceTransactionManager.getDataFromDevice("node", LogicalDatastoreType.OPERATIONAL, deviceIID,
@@ -622,7 +622,7 @@ public class PortMappingVersion121Test {
 
         // assert all portmappings have been created for the xpdr node
         ReadTransaction rr = dataBroker.newReadOnlyTransaction();
-        InstanceIdentifier<Network> mappingIID = InstanceIdentifier.create(Network.class);
+        DataObjectIdentifier<Network> mappingIID = DataObjectIdentifier.builder(Network.class).build();
         Network network = new NetworkBuilder().build();
         try {
             Optional<Network> optionalNetwork = rr.read(LogicalDatastoreType.CONFIGURATION, mappingIID).get();
@@ -648,8 +648,8 @@ public class PortMappingVersion121Test {
     }
 
     @NonNull
-    private InstanceIdentifier<Ports> getChild(String c4, String p5) {
-        return InstanceIdentifier
+    private DataObjectIdentifier<Ports> getChild(String c4, String p5) {
+        return DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(c4))
             .child(Ports.class, new PortsKey(p5))
index def34d0e9eb0665543d0c36e200965f957b23da7..10cb70760050f52c8e37527ebd522c664524bddd 100644 (file)
@@ -80,7 +80,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.wavelength.map.rev161014.wavelength.map.g.Wavelengths;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.wavelength.map.rev161014.wavelength.map.g.WavelengthsKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -101,7 +101,7 @@ public class INode121 {
 
     public boolean addNode(String deviceId) {
 
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Info.class)
             .build();
@@ -203,7 +203,7 @@ public class INode121 {
     }
 
     public void getRoadmShelves(String nodeId) throws InterruptedException, ExecutionException {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject = deviceTransactionManager.getDataFromDevice(nodeId,
@@ -234,7 +234,7 @@ public class INode121 {
     }
 
     public void getCircuitPacks(String nodeId) throws InterruptedException, ExecutionException {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1035,7 +1035,7 @@ public class INode121 {
 
     private void persistDevInterfaces(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1065,7 +1065,7 @@ public class INode121 {
 
     private void persistDevProtocols(String nodeId, Connection connection) {
 
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -1110,7 +1110,7 @@ public class INode121 {
 
     private void persistDevProtocolLldpPortConfig(String nodeId, Connection connection) {
 
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -1155,7 +1155,7 @@ public class INode121 {
 
     private void persistDevProtocolLldpNbrList(String nodeId, Connection connection) {
 
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -1220,7 +1220,7 @@ public class INode121 {
 
     private void persistDevInternalLinks(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1267,7 +1267,7 @@ public class INode121 {
 
     private void persistDevExternalLinks(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1317,7 +1317,7 @@ public class INode121 {
 
     private void persistDevPhysicalLinks(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1379,7 +1379,7 @@ public class INode121 {
 
     private void persistDevDegree(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1512,7 +1512,7 @@ public class INode121 {
 
     private void persistDevSrg(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1626,7 +1626,7 @@ public class INode121 {
 
         //int opticalcontrolmodeEnu=-1;
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1694,7 +1694,7 @@ public class INode121 {
 
     private void persistDevConnectionMap(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1739,7 +1739,7 @@ public class INode121 {
 
     private void persistDevWavelengthMap(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
index f42261759dfbf70be54cd5e664cc074c17eb9c5b..84a0ab4b857d06518451cb7df9ae6f9ea66884b4 100644 (file)
@@ -76,7 +76,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.opu.opu.msi.TxMsi;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.opu.opu.msi.TxMsiKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -96,7 +96,7 @@ public class INode221 {
 
     public boolean addNode(String deviceId) {
 
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier
+        DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Info.class)
             .build();
@@ -201,7 +201,7 @@ public class INode221 {
     }
 
     public void getRoadmShelves(String nodeId) throws InterruptedException, ExecutionException {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject = deviceTransactionManager.getDataFromDevice(nodeId,
@@ -236,7 +236,7 @@ public class INode221 {
     }
 
     public void getCircuitPacks(String nodeId) throws InterruptedException, ExecutionException {
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -914,7 +914,7 @@ public class INode221 {
 
     private void persistDevInterfaces(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -957,7 +957,7 @@ public class INode221 {
 
     private void persistDevProtocols(String nodeId, Connection connection) {
 
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -1006,7 +1006,7 @@ public class INode221 {
 
     private void persistDevProtocolLldpPortConfig(String nodeId, Connection connection) {
 
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -1052,7 +1052,7 @@ public class INode221 {
 
     private void persistDevProtocolLldpNbrList(String nodeId, Connection connection) {
 
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+        DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Protocols.class)
             .build();
@@ -1109,7 +1109,7 @@ public class INode221 {
 
     private void persistDevInternalLinks(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1158,7 +1158,7 @@ public class INode221 {
 
     private void persistDevExternalLinks(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1210,7 +1210,7 @@ public class INode221 {
 
     private void persistDevPhysicalLinks(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1259,7 +1259,7 @@ public class INode221 {
 
     private void persistDevDegree(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1393,7 +1393,7 @@ public class INode221 {
 
     private void persistDevSrg(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1491,7 +1491,7 @@ public class INode221 {
 
     private void persistDevRoadmConnections(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
@@ -1547,7 +1547,7 @@ public class INode221 {
 
     private void persistDevConnectionMap(String nodeId, Connection connection) {
 
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+        DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .build();
         Optional<OrgOpenroadmDevice> deviceObject =
index d38d94adb7b583240a0cc91cc8532c4fb8a76547..24e5818c687558aeff8681c9bd28d792c7f8a529 100644 (file)
@@ -21,8 +21,14 @@ import org.opendaylight.transportpce.inventory.listener.DeviceConfigListener;
 import org.opendaylight.transportpce.inventory.listener.DeviceListener;
 import org.opendaylight.transportpce.inventory.listener.OverlayNetworkChangeListener;
 import org.opendaylight.transportpce.inventory.listener.UnderlayNetworkChangeListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.network.topology.topology.topology.types.TopologyNetconf;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
@@ -37,6 +43,10 @@ import org.slf4j.LoggerFactory;
 public class ListenerProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(ListenerProvider.class);
+    private static final InstanceIdentifier<Node> NETCONF_NODE_II = InstanceIdentifier
+            .create(NetworkTopology.class)
+            .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
+            .child(Node.class);
     private List<Registration> listeners = new ArrayList<>();
 
     /**
@@ -60,12 +70,12 @@ public class ListenerProvider {
         LOG.info("Overlay network change listener was successfully registered");
         UnderlayNetworkChangeListener underlayNetworkListener = new UnderlayNetworkChangeListener();
         listeners.add(dataBroker.registerDataTreeChangeListener(
-                DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.UNDERLAY_NETWORK_II),
+                DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.UNDERLAY_NETWORK_II),
                 underlayNetworkListener));
         LOG.info("Underlay network change listener was successfully registered");
         ClliNetworkChangeListener clliNetworkChangeListener = new ClliNetworkChangeListener();
         listeners.add(dataBroker.registerDataTreeChangeListener(
-                DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.CLLI_NETWORK_II),
+                DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, InstanceIdentifiers.CLLI_NETWORK_II),
                 clliNetworkChangeListener));
         LOG.info("CLLI network change listener was successfully registered");
         INode121 inode121 = new INode121(dataSource, deviceTransactionManager);
@@ -73,13 +83,13 @@ public class ListenerProvider {
         DeviceInventory deviceInventory = new DeviceInventory(dataSource, inode);
         DeviceListener deviceListener = new DeviceListener(deviceInventory);
         listeners.add(dataBroker.registerDataTreeChangeListener(
-                DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL,
-                InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), deviceListener));
+                DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, NETCONF_NODE_II),
+                deviceListener));
         LOG.info("Device change listener was successfully registered");
         DeviceConfigListener deviceConfigListener = new DeviceConfigListener(deviceInventory);
         listeners.add(dataBroker.registerDataTreeChangeListener(
-                DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
-                InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), deviceConfigListener));
+                DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, NETCONF_NODE_II),
+                deviceConfigListener));
         LOG.info("Device config change listener was successfully registered");
     }
 
index 2d403abc3f5a915fcdab281a3f09acd1c7a39971..6f2308e78d20366ba1e4d3a8daf2909b4b1dca2c 100644 (file)
@@ -13,7 +13,7 @@ import java.util.Map;
 import org.apache.kafka.common.serialization.Serializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.yang.gen.v1.nbi.notifications.rev230728.NotificationAlarmService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,8 +42,8 @@ public class NotificationAlarmServiceSerializer implements Serializer<Notificati
             return new byte[0];
         }
         try {
-            InstanceIdentifier<NotificationAlarmService> iid =
-                    InstanceIdentifier.builder(NotificationAlarmService.class).build();
+            DataObjectIdentifier<NotificationAlarmService> iid = DataObjectIdentifier
+                    .builder(NotificationAlarmService.class).build();
             String serialized = converter.createJsonStringFromDataObject(iid, data, JSONCodecFactorySupplier.RFC7951);
             LOG.info("Serialized event {}", serialized);
             return serialized.getBytes(StandardCharsets.UTF_8);
index 55c9c1c7d8451c20e32f1cef182afacfce193bab..824c2a5b07b7eb44a482292666201ed8231e55e2 100644 (file)
@@ -13,7 +13,7 @@ import java.util.Map;
 import org.apache.kafka.common.serialization.Serializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.yang.gen.v1.nbi.notifications.rev230728.NotificationProcessService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@ public class NotificationServiceSerializer implements Serializer<NotificationPro
             return new byte[0];
         }
         try {
-            InstanceIdentifier<NotificationProcessService> iid = InstanceIdentifier
+            DataObjectIdentifier<NotificationProcessService> iid = DataObjectIdentifier
                     .builder(NotificationProcessService.class).build();
             String serialized = converter.createJsonStringFromDataObject(iid, data, JSONCodecFactorySupplier.RFC7951);
             LOG.info("Serialized event {}", serialized);
index 38bcce0099239cc6c058109ab59bb65ec6a5986c..525e83f9c91a9870c6dcca2bb7fe66cc7b589f8e 100644 (file)
@@ -13,7 +13,7 @@ import java.util.Map;
 import org.apache.kafka.common.serialization.Serializer;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.yang.gen.v1.nbi.notifications.rev230728.NotificationTapiService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,8 +43,8 @@ public class TapiNotificationSerializer implements Serializer<NotificationTapiSe
             return new byte[0];
         }
         try {
-            InstanceIdentifier<NotificationTapiService> iid = InstanceIdentifier.builder(NotificationTapiService.class)
-                .build();
+            DataObjectIdentifier<NotificationTapiService> iid = DataObjectIdentifier
+                    .builder(NotificationTapiService.class).build();
             String serialized = converter.createJsonStringFromDataObject(iid, data, JSONCodecFactorySupplier.RFC7951);
             LOG.info("Serialized event {}", serialized);
             return serialized.getBytes(StandardCharsets.UTF_8);
index 5dcf60cc3060a4e8582fd505230b6308a9e6ee0a..ae2828689ece32c61bc13c62c2a3b23a365473d7 100644 (file)
@@ -43,7 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.co
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.NetconfNodeAugment;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.netconf.node.augment.NetconfNode;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -234,7 +234,9 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
     }
 
     private List<String> getSupportedStream(String nodeId) {
-        InstanceIdentifier<Streams> streamsIID = InstanceIdentifier.create(Netconf.class).child(Streams.class);
+        DataObjectIdentifier<Streams> streamsIID = DataObjectIdentifier.builder(Netconf.class)
+                .child(Streams.class)
+                .build();
         Optional<Streams> ordmInfoObject =
                 deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, streamsIID,
                         Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
index 35caf096abb639ba23468a5a241f377766cee956..c8fdb4ee616e3519c78dbf7f98890c0c03c1ab3c 100644 (file)
@@ -13,7 +13,6 @@ import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.NotificationService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.transportpce.common.InstanceIdentifiers;
 import org.opendaylight.transportpce.common.NetworkUtils;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
@@ -25,6 +24,11 @@ import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
 import org.opendaylight.transportpce.networkmodel.util.TpceNetwork;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.Network;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.mapping.Mapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.network.topology.topology.topology.types.TopologyNetconf;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -39,11 +43,16 @@ import org.slf4j.LoggerFactory;
 public class NetworkModelProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetworkModelProvider.class);
+    private static final InstanceIdentifier<Node> NETCONF_NODE_II = InstanceIdentifier
+            .create(NetworkTopology.class)
+            .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
+            .child(Node.class);
     private static final InstanceIdentifier<Mapping> MAPPING_II = InstanceIdentifier.create(Network.class)
         .child(org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.network
                 .Nodes.class)
         .child(Mapping.class);
 
+
     private final DataBroker dataBroker;
     private final NetConfTopologyListener topologyListener;
     private List<Registration> listeners;
@@ -82,9 +91,7 @@ public class NetworkModelProvider {
         tpceNetwork.createLayer(NetworkUtils.OVERLAY_NETWORK_ID);
         tpceNetwork.createLayer(NetworkUtils.OTN_NETWORK_ID);
         listeners.add(dataBroker.registerTreeChangeListener(
-                DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL,
-                    InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)),
-                topologyListener));
+                DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, NETCONF_NODE_II), topologyListener));
         listeners.add(dataBroker.registerTreeChangeListener(
                 DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, MAPPING_II), portMappingListener));
         serviceHandlerListenerRegistration = notificationService.registerCompositeListener(
index 8b3fcf49fc1f58dff6c4566822ec7fad51e83221..04fd2576c054d83b2c408609877c0084493d0c1c 100644 (file)
@@ -38,7 +38,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.conta
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.nbr.list.IfName;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.Direction;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -61,7 +61,7 @@ public class R2RLinkDiscovery {
     public boolean readLLDP(NodeId nodeId, String nodeVersion) {
         switch (nodeVersion) {
             case OPENROADM_DEVICE_VERSION_1_2_1:
-                InstanceIdentifier<Protocols> protocols121IID = InstanceIdentifier
+                DataObjectIdentifier<Protocols> protocols121IID = DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Protocols.class)
                     .build();
@@ -79,8 +79,8 @@ public class R2RLinkDiscovery {
                 // try to create rdm2rdm link
                 return rdm2rdmLinkCreatedv121(nodeId, nbr121List);
             case OPENROADM_DEVICE_VERSION_2_2_1:
-                InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device
-                        .container.org.openroadm.device.Protocols> protocols221IID = InstanceIdentifier
+                DataObjectIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm
+                        .device.container.org.openroadm.device.Protocols> protocols221IID = DataObjectIdentifier
                     .builderOfInherited(
                         org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.OrgOpenroadmDeviceData.class,
                         org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container
@@ -188,8 +188,9 @@ public class R2RLinkDiscovery {
     }
 
     public Direction getDegreeDirection(Integer degreeCounter, NodeId nodeId) {
-        InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.builder(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId.getValue())).build();
+        DataObjectIdentifier<Nodes> nodesIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId.getValue()))
+            .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID).get();
             if (nodesObject.isPresent() && (nodesObject.orElseThrow().getMapping() != null)) {
@@ -343,8 +344,9 @@ public class R2RLinkDiscovery {
     }
 
     private Integer getDegFromInterface(NodeId nodeId, String interfaceName) {
-        InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.builder(Network.class)
-            .child(Nodes.class, new NodesKey(nodeId.getValue())).build();
+        DataObjectIdentifier<Nodes> nodesIID = DataObjectIdentifier.builder(Network.class)
+            .child(Nodes.class, new NodesKey(nodeId.getValue()))
+            .build();
         try (ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID).get();
             if (nodesObject.isPresent() && (nodesObject.orElseThrow().getCpToDegree() != null)) {
index 56a5efba77caf900302893cd898a29dc7a26b858..96c8e797ab51da1c90fe85e2fd8e6f28e9662fa6 100644 (file)
@@ -26,6 +26,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.odu.switching.pools.NonBlockingList;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.odu.switching.pools.non.blocking.list.PortList;
 import org.opendaylight.yangtools.binding.DataObject;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.binding.DataObjectStep;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
@@ -64,7 +65,7 @@ public class DeviceListener710 {
             LOG.warn("unable to handle {} notificatin received - list of edit is null", ChangeNotification.QNAME);
             return;
         }
-        Map<Uint16, List<InstanceIdentifier<PortList>>> nbliidMap = new HashMap<>();
+        Map<Uint16, List<DataObjectIdentifier<PortList>>> nbliidMap = new HashMap<>();
         InstanceIdentifier<OduSwitchingPools> ospIID = null;
         for (Edit edit : notification.getEdit()) {
             if (edit.getTarget() == null) {
@@ -101,9 +102,9 @@ public class DeviceListener710 {
                 case "PortList":
                     InstanceIdentifier<PortList> plIID = path.firstIdentifierOf(PortList.class);
                     Uint16 nblNb = path.firstKeyOf(NonBlockingList.class).getNblNumber();
-                    List<InstanceIdentifier<PortList>> iidList = nbliidMap.containsKey(nblNb)
+                    List<DataObjectIdentifier<PortList>> iidList = nbliidMap.containsKey(nblNb)
                         ? nbliidMap.get(nblNb) : new ArrayList<>();
-                    iidList.add(plIID);
+                    iidList.add(plIID.toIdentifier());
                     nbliidMap.put(nblNb, iidList);
                     break;
                 default:
@@ -112,7 +113,7 @@ public class DeviceListener710 {
             }
         }
         if (!nbliidMap.isEmpty() && ospIID != null) {
-            InstanceIdentifier<OduSwitchingPools> id = ospIID;
+            DataObjectIdentifier<OduSwitchingPools> id = ospIID.toIdentifier();
             Runnable handleNetconfEvent = new Runnable() {
                 @Override
                 public void run() {
index 9418fd12b7452f55e60f8d11f94ce07bbd85141c..876af58fdaa91b8b63230b71fd4f0dc16354644e 100644 (file)
@@ -38,7 +38,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1Builder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.och.container.OchBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,7 +64,7 @@ public final class PowerMgmtVersion121 {
      */
     public static Map<String, Double> getXponderPowerRange(String circuitPackName, String portName, String deviceId,
             DeviceTransactionManager deviceTransactionManager) {
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .child(Ports.class, new PortsKey(portName))
@@ -108,7 +108,7 @@ public final class PowerMgmtVersion121 {
             String circuitPackName, String portName) {
         LOG.debug("Coming inside SRG power range");
         LOG.debug("Mapping object exists.");
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .child(Ports.class, new PortsKey(portName))
@@ -182,7 +182,7 @@ public final class PowerMgmtVersion121 {
                     + "setup!", nodeId, e);
             return false;
         }
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
@@ -248,7 +248,7 @@ public final class PowerMgmtVersion121 {
                 return false;
             }
             // post the cross connect on the device
-            InstanceIdentifier<RoadmConnections> roadmConnIID = InstanceIdentifier
+            DataObjectIdentifier<RoadmConnections> roadmConnIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
                 .build();
index 761947dac1939d61118b410fd3073f59ec48b27d..c79a3e4b1ab91d713e41f650e90c23f326b4ee15 100644 (file)
@@ -39,7 +39,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.open
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev181019.Interface1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev181019.Interface1Builder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev181019.och.container.OchBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -67,7 +67,7 @@ public final class PowerMgmtVersion221 {
      */
     public static Map<String, Double> getXponderPowerRange(String circuitPackName, String portName, String deviceId,
             DeviceTransactionManager deviceTransactionManager) {
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .child(Ports.class, new PortsKey(portName))
@@ -111,7 +111,7 @@ public final class PowerMgmtVersion221 {
             String circuitPackName, String portName) {
         LOG.debug("Coming inside SRG power range");
         LOG.debug("Mapping object exists.");
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .child(Ports.class, new PortsKey(portName))
@@ -184,7 +184,7 @@ public final class PowerMgmtVersion221 {
                     + "setup!", nodeId, e);
             return false;
         }
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
@@ -249,7 +249,7 @@ public final class PowerMgmtVersion221 {
                 return false;
             }
             // post the cross connect on the device
-            InstanceIdentifier<RoadmConnections> roadmConnIID = InstanceIdentifier
+            DataObjectIdentifier<RoadmConnections> roadmConnIID = DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
                 .build();
index 75a72e581b8ff997068757ade51b881945e09b9d..0fbc2d0f59487718bad7c7d4d2ea13cd0deaef9c 100644 (file)
@@ -44,7 +44,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.tributary
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCH;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOCHOTU4ODU4;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev230526.IfOtsiOtsigroup;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -72,7 +72,7 @@ public final class PowerMgmtVersion710 {
      */
     public static Map<String, Double> getXponderPowerRange(String circuitPackName, String portName, String deviceId,
             DeviceTransactionManager deviceTransactionManager) {
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .child(Ports.class, new PortsKey(portName))
@@ -115,7 +115,7 @@ public final class PowerMgmtVersion710 {
             String circuitPackName, String portName) {
         LOG.debug("Coming inside SRG power range");
         LOG.debug("Mapping object exists.");
-        InstanceIdentifier<Ports> portIID = InstanceIdentifier
+        DataObjectIdentifier<Ports> portIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
             .child(Ports.class, new PortsKey(portName))
@@ -204,7 +204,7 @@ public final class PowerMgmtVersion710 {
             LOG.error("Unable to get transaction for device {} during transponder power setup!", nodeId, e);
             return false;
         }
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey(interfaceName))
             .build();
@@ -270,7 +270,7 @@ public final class PowerMgmtVersion710 {
             return false;
         }
         // post the cross connect on the device
-        InstanceIdentifier<RoadmConnections> roadmConnIID = InstanceIdentifier
+        DataObjectIdentifier<RoadmConnections> roadmConnIID = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber))
             .build();
index 6cba4f92d0b395c301af8deabe206ebcffa1f6c5..35b755dcb4018e223feb6ba47462d23071cbbc52 100644 (file)
@@ -89,7 +89,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.top
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.LinkKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.osgi.service.component.annotations.Activate;
@@ -308,8 +308,8 @@ public class OlmPowerServiceImpl implements OlmPowerService {
     private List<Link> getNetworkLinks() {
         NetworkKey overlayTopologyKey = new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID));
 
-        InstanceIdentifier<Network1> networkIID = InstanceIdentifier.builder(Networks.class)
-            .child(Network.class, overlayTopologyKey)
+        DataObjectIdentifier<Network1> networkIID = DataObjectIdentifier.builder(Networks.class)
+                .child(Network.class, overlayTopologyKey)
                 .augmentation(Network1.class)
                 .build();
         Optional<Network1> networkOptional;
@@ -604,7 +604,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
 
     private Link getNetworkLinkById(LinkId linkId) {
         NetworkKey overlayTopologyKey = new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID));
-        InstanceIdentifier<Link> linkIID = InstanceIdentifier.builder(Networks.class)
+        DataObjectIdentifier<Link> linkIID = DataObjectIdentifier.builder(Networks.class)
             .child(Network.class, overlayTopologyKey)
             .augmentation(Network1.class).child(Link.class, new LinkKey(linkId))
             .build();
index 4b2312d15c7c900c086542928473f9fb6db40a3b..f4c4eb33ddbdbe9171bedeb79eeeeeaccb09a436 100644 (file)
@@ -37,7 +37,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resour
 import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resource.resource.resource.Srg;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.olm.get.pm.input.ResourceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -64,7 +64,7 @@ final class OlmUtils121 {
         LOG.info("Getting PM Data for 1.2.1 NodeId: {} ResourceType: {} ResourceName: {}", input.getNodeId(),
                 input.getResourceType(), input.getResourceIdentifier());
         GetPmOutputBuilder pmOutputBuilder = new GetPmOutputBuilder();
-        InstanceIdentifier<CurrentPmlist> currentPmsIID = InstanceIdentifier.create(CurrentPmlist.class);
+        DataObjectIdentifier<CurrentPmlist> currentPmsIID = DataObjectIdentifier.builder(CurrentPmlist.class).build();
         Optional<CurrentPmlist> currentPmList;
         currentPmList = deviceTransactionManager
                 .getDataFromDevice(input.getNodeId(), LogicalDatastoreType.OPERATIONAL, currentPmsIID,
index de11d56d1794c4802f45f252dcee7804d66bc5ed..148e013f8cb7c7f013bb595fe812697371623f34 100644 (file)
@@ -53,7 +53,7 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.PmGranularity;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.PmNamesEnum;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.olm.get.pm.input.ResourceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,14 +83,16 @@ final class OlmUtils221 {
 
         GetPmOutputBuilder pmOutputBuilder = new GetPmOutputBuilder();
 
-        InstanceIdentifier<?> resourceKeyIID =
+        DataObjectIdentifier<?> resourceKeyIID =
                 findClassKeyIdentifiers(input.getResourceType(), input.getResourceIdentifier());
         if (resourceKeyIID == null) {
             return pmOutputBuilder;
         }
         CurrentPmEntryKey resourceKey = new CurrentPmEntryKey(resourceKeyIID.toIdentifier(),
                 convertResourceTypeEnum(input.getResourceType()),"");
-        InstanceIdentifier<CurrentPmList> iidCurrentPmList = InstanceIdentifier.create(CurrentPmList.class);
+        DataObjectIdentifier<CurrentPmList> iidCurrentPmList = DataObjectIdentifier
+                .builder(CurrentPmList.class)
+                .build();
 
         Optional<CurrentPmList> currentPmListOpt = deviceTransactionManager.getDataFromDevice(input.getNodeId(),
                 LogicalDatastoreType.OPERATIONAL, iidCurrentPmList, Timeouts.DEVICE_READ_TIMEOUT,
@@ -184,7 +186,7 @@ final class OlmUtils221 {
         return olmMeasurements;
     }
 
-    private static InstanceIdentifier<?> findClassKeyIdentifiers(ResourceTypeEnum wantedResourceType,
+    private static DataObjectIdentifier<?> findClassKeyIdentifiers(ResourceTypeEnum wantedResourceType,
             ResourceIdentifier wantedResourceIdentifier) {
         if (wantedResourceIdentifier.getResourceName() == null) {
             LOG.debug("resource {} is null", wantedResourceType);
@@ -192,54 +194,54 @@ final class OlmUtils221 {
         }
         switch (wantedResourceType) {
             case Device:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .build();
             case Degree:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Degree.class, new DegreeKey(Uint16.valueOf(wantedResourceIdentifier.getResourceName())))
                     .build();
             case SharedRiskGroup:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(
                         SharedRiskGroup.class,
                         new SharedRiskGroupKey(Uint16.valueOf(wantedResourceIdentifier.getResourceName())))
                     .build();
             case Connection:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(RoadmConnections.class, new RoadmConnectionsKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case CircuitPack:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(CircuitPacks.class, new CircuitPacksKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case Port:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(CircuitPacks.class, new CircuitPacksKey(wantedResourceIdentifier.getCircuitPackName()))
                     .child(Ports.class, new PortsKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case Interface:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Interface.class, new InterfaceKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case InternalLink:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(InternalLink.class, new InternalLinkKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case PhysicalLink:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(PhysicalLink.class, new PhysicalLinkKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case Shelf:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Shelves.class, new ShelvesKey(wantedResourceIdentifier.getResourceName()))
                     .build();
index 3f33c4df4f19b9127176c3f2f70e675942d65d72..86d25fb7d0e379fecb2e5cbbd2c70287126c2da3 100644 (file)
@@ -53,7 +53,7 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.PmGranularity;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.PmNamesEnum;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev220926.olm.get.pm.input.ResourceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,12 +83,14 @@ final class OlmUtils710 {
 
         GetPmOutputBuilder pmOutputBuilder = new GetPmOutputBuilder();
 
-        InstanceIdentifier<?> resourceKeyIID =
+        DataObjectIdentifier<?> resourceKeyIID =
                 findClassKeyIdentifiers(input.getResourceType(), input.getResourceIdentifier());
         CurrentPmEntryKey resourceKey = new CurrentPmEntryKey(resourceKeyIID.toIdentifier(),
                 convertResourceTypeEnum(input.getResourceType()), "");
 
-        InstanceIdentifier<CurrentPmList> iidCurrentPmList = InstanceIdentifier.create(CurrentPmList.class);
+        DataObjectIdentifier<CurrentPmList> iidCurrentPmList = DataObjectIdentifier
+                .builder(CurrentPmList.class)
+                .build();
 
         Optional<CurrentPmList> currentPmListOpt = deviceTransactionManager.getDataFromDevice(input.getNodeId(),
                 LogicalDatastoreType.OPERATIONAL, iidCurrentPmList, Timeouts.DEVICE_READ_TIMEOUT,
@@ -179,58 +181,58 @@ final class OlmUtils710 {
         return olmMeasurements;
     }
 
-    private static InstanceIdentifier<?> findClassKeyIdentifiers(ResourceTypeEnum wantedResourceType,
+    private static DataObjectIdentifier<?> findClassKeyIdentifiers(ResourceTypeEnum wantedResourceType,
         ResourceIdentifier wantedResourceIdentifier) {
         switch (wantedResourceType) {
             case Device:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .build();
             case Degree:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Degree.class, new DegreeKey(Uint16.valueOf(wantedResourceIdentifier.getResourceName())))
                     .build();
             case SharedRiskGroup:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(
                         SharedRiskGroup.class,
                         new SharedRiskGroupKey(Uint16.valueOf(wantedResourceIdentifier.getResourceName())))
                     .build();
             case Connection:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(RoadmConnections.class, new RoadmConnectionsKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case CircuitPack:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(CircuitPacks.class, new CircuitPacksKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case Port:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(CircuitPacks.class, new CircuitPacksKey(wantedResourceIdentifier.getCircuitPackName()))
                     .child(Ports.class, new PortsKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case Interface:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Interface.class, new InterfaceKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case InternalLink:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(InternalLink.class, new InternalLinkKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case PhysicalLink:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(PhysicalLink.class, new PhysicalLinkKey(wantedResourceIdentifier.getResourceName()))
                     .build();
             case Shelf:
-                return InstanceIdentifier
+                return DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Shelves.class, new ShelvesKey(wantedResourceIdentifier.getResourceName()))
                     .build();
index 24fa516f8bec66a423a5f69fcd67f87abfa8e7d1..6d8d1990477e8b1cfe181092956bb5aad31ca4f7 100644 (file)
@@ -58,7 +58,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.NetworkKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -96,7 +96,9 @@ class OlmPowerServiceImplSpanLossBaseTest extends AbstractTest {
         when(this.portMapping.getMapping("ROADM-A1", "DEG2-TTP-TXRX")).thenReturn(OlmTransactionUtils.getMapping1());
         when(this.portMapping.getMapping("ROADM-C1", "DEG1-TTP-TXRX")).thenReturn(OlmTransactionUtils.getMapping2());
 
-        InstanceIdentifier<CurrentPmList> iidCurrentPmList = InstanceIdentifier.create(CurrentPmList.class);
+        DataObjectIdentifier<CurrentPmList> iidCurrentPmList = DataObjectIdentifier
+                .builder(CurrentPmList.class)
+                .build();
         when(this.deviceTransactionManager.getDataFromDevice("ROADM-A1", LogicalDatastoreType.OPERATIONAL,
                 iidCurrentPmList, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
             .thenReturn(OlmTransactionUtils.getCurrentPmListA());
@@ -104,11 +106,11 @@ class OlmPowerServiceImplSpanLossBaseTest extends AbstractTest {
                 iidCurrentPmList, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT))
             .thenReturn(OlmTransactionUtils.getCurrentPmListC());
 
-        InstanceIdentifier<Interface> interfacesIIDA = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIIDA = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey("OTS-DEG2-TTP-TXRX"))
             .build();
-        InstanceIdentifier<Interface> interfacesIIDC = InstanceIdentifier
+        DataObjectIdentifier<Interface> interfacesIIDC = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(Interface.class, new InterfaceKey("OTS-DEG1-TTP-TXRX"))
             .build();
@@ -145,8 +147,9 @@ class OlmPowerServiceImplSpanLossBaseTest extends AbstractTest {
     void testCalculateSpanlossBaseLink() {
         // initialise and store openroadm-topology in datastore
         NetworkKey overlayTopologyKey = new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID));
-        InstanceIdentifier<Network> ietfNetworkIID = InstanceIdentifier.builder(Networks.class)
-                .child(Network.class, overlayTopologyKey).build();
+        DataObjectIdentifier<Network> ietfNetworkIID = DataObjectIdentifier.builder(Networks.class)
+                .child(Network.class, overlayTopologyKey)
+                .build();
         Network openroadmTopology = OlmTransactionUtils.getNetworkForSpanLoss();
         OlmTransactionUtils.writeTransaction(this.dataBroker, ietfNetworkIID, openroadmTopology);
         try {
@@ -168,8 +171,9 @@ class OlmPowerServiceImplSpanLossBaseTest extends AbstractTest {
 
         // initialise and store openroadm-topology in datastore
         NetworkKey overlayTopologyKey = new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID));
-        InstanceIdentifier<Network> ietfNetworkIID = InstanceIdentifier.builder(Networks.class)
-                .child(Network.class, overlayTopologyKey).build();
+        DataObjectIdentifier<Network> ietfNetworkIID = DataObjectIdentifier.builder(Networks.class)
+                .child(Network.class, overlayTopologyKey)
+                .build();
         Network openroadmTopology = OlmTransactionUtils.getNetworkForSpanLoss();
         OlmTransactionUtils.writeTransaction(this.dataBroker, ietfNetworkIID, openroadmTopology);
         try {
index 846150af6e2aaed93c8732b26d468ec98ae2b10b..21485995ce0083d172ce7fb82487d0d49cae1465 100644 (file)
@@ -71,7 +71,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.top
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.link.SourceBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 import org.opendaylight.yangtools.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -86,7 +86,7 @@ public final class OlmTransactionUtils {
     // Raw types use are discouraged since they lack type safety.
     // Resulting Problems are observed at run time and not at compile time
     public static void writeTransaction(
-            DataBroker dataBroker, InstanceIdentifier instanceIdentifier, DataObject object) {
+            DataBroker dataBroker, DataObjectIdentifier instanceIdentifier, DataObject object) {
         @NonNull
         WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
         transaction.put(LogicalDatastoreType.CONFIGURATION, instanceIdentifier, object);
@@ -286,8 +286,7 @@ public final class OlmTransactionUtils {
         CurrentPmEntry currentPmEntryA =
             new CurrentPmEntryBuilder()
                 .setCurrentPm(Map.of(cpA.key(),cpA))
-                .setPmResourceInstance(
-                    InstanceIdentifier
+                .setPmResourceInstance(DataObjectIdentifier
                         .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                         .child(Interface.class, new InterfaceKey("OTS-DEG2-TTP-TXRX"))
                         .build()
@@ -322,8 +321,7 @@ public final class OlmTransactionUtils {
         CurrentPmEntry currentPmEntryC =
             new CurrentPmEntryBuilder()
                 .setCurrentPm(Map.of(cpC.key(),cpC))
-                .setPmResourceInstance(
-                    InstanceIdentifier
+                .setPmResourceInstance(DataObjectIdentifier
                         .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                         .child(Interface.class, new InterfaceKey("OTS-DEG1-TTP-TXRX"))
                         .build()
index 41a9f56cebb4ffc2ccb75df57de3861ebb36de71..39d6a3d181354dc55a749b1b0b2f90eec87a1d71 100644 (file)
@@ -18,8 +18,8 @@ import java.nio.charset.StandardCharsets;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev220221.Request;
 import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.Result;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.binding.data.codec.spi.BindingDOMCodecServices;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.osgi.service.component.annotations.Activate;
@@ -107,7 +107,7 @@ public class GnpyConsumerImpl implements GnpyConsumer {
     public Result computePaths(final Request request) {
         try {
             String requestBody = requestConverter.createJsonStringFromDataObject(
-                            InstanceIdentifier.create(Request.class),
+                            DataObjectIdentifier.builder(Request.class).build(),
                             request,
                             JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02)
                     .replace("gnpy-network-topology:", "");
index 1cf6195c692890789bd8b5170b4aa2252650dbd6..d21219582e45824b8f07c3efe24f183a1ffc170e 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.OTU4;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.OtuAttributes;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -319,7 +319,7 @@ public class OpenRoadmInterface121 {
         Optional<RoadmConnections> crossconnection = deviceTransactionManager.getDataFromDevice(
             nodeId,
             LogicalDatastoreType.CONFIGURATION,
-            InstanceIdentifier
+            DataObjectIdentifier
                 .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                 .child(RoadmConnections.class, new RoadmConnectionsKey(xc))
                 .build(),
index 3205f3ffda58de452d6c0add9c6ce36f772aa2eb..fc3b36b6a33865f0cdc64914a6eb00bbea45c3c1 100644 (file)
@@ -70,7 +70,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.opu.OpuBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev181019.OtuAttributes;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev181019.otu.container.OtuBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -468,8 +468,8 @@ public class OpenRoadmInterface221 {
     }
 
     public boolean isUsedByXc(String nodeId, String interfaceName, String xc,
-        DeviceTransactionManager deviceTransactionManager) {
-        InstanceIdentifier<RoadmConnections> xciid = InstanceIdentifier
+            DeviceTransactionManager deviceTransactionManager) {
+        DataObjectIdentifier<RoadmConnections> xciid = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(RoadmConnections.class, new RoadmConnectionsKey(xc))
             .build();
@@ -497,7 +497,7 @@ public class OpenRoadmInterface221 {
 
     public boolean isUsedByOtnXc(String nodeId, String interfaceName, String xc,
             DeviceTransactionManager deviceTransactionManager) {
-        InstanceIdentifier<OduConnection> xciid = InstanceIdentifier
+        DataObjectIdentifier<OduConnection> xciid = DataObjectIdentifier
             .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
             .child(OduConnection.class, new OduConnectionKey(xc))
             .build();
index 289b5e6f0c1c2e4bb43f0a0ec45ce4ccdcb38217..1719a9618e43fede3020bee4f91ce8bf5f5b86c7 100644 (file)
@@ -821,9 +821,6 @@ public class OpenRoadmInterface710 {
             throw new OpenRoadmInterfaceException(
                 OpenRoadmInterfaceException.mapping_msg_err(nodeId, logicalConnPoint));
         }
-        // Depending on OTU4 or OTUCn, supporting interface should
-        // reflect that
-        String interfaceOdu4OducnOduflex = null;
         // Depending on OTU4 or OTUCn, supporting interface should reflect that
         if (portMap.getSupportedInterfaceCapability().contains(IfOCHOTU4ODU4.VALUE)) {
             // create OTU4 interface
index fbedc423b9ecb663bb57514281026c06db6ad0f1..23f7fcc52c90be65ca0cf69ec0f2f6979dbd951e 100644 (file)
@@ -66,7 +66,7 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
@@ -247,8 +247,9 @@ public class RendererServiceOperationsImplDeleteTest extends AbstractTest {
                 this.deviceTransactionManager,
                 "node1" + StringConstants.PP_TOKEN,
                 LogicalDatastoreType.OPERATIONAL,
-                InstanceIdentifier.create(ServicePathList.class)
-                    .child(ServicePaths.class, new ServicePathsKey("service 1")),
+                DataObjectIdentifier.builder(ServicePathList.class)
+                    .child(ServicePaths.class, new ServicePathsKey("service 1"))
+                    .build(),
                 new ServicePathsBuilder()
                     .setPathDescription(ServiceDeleteDataUtils
                         .createTransactionPathDescription(StringConstants.PP_TOKEN))
index a9fbc5dcac2e3d35c3536b1c848455710a045654..c2e4d2d1c12df3d8a77e56bd48ffddcf90b5bf09 100644 (file)
@@ -16,7 +16,7 @@ import org.opendaylight.transportpce.common.Timeouts;
 import org.opendaylight.transportpce.common.device.DeviceTransaction;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.yangtools.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.binding.DataObjectIdentifier;
 
 public final class TransactionUtils {
 
@@ -32,7 +32,7 @@ public final class TransactionUtils {
     public static boolean writeTransaction(DeviceTransactionManager deviceTransactionManager,
                                     String nodeId,
                                     LogicalDatastoreType logicalDatastoreType,
-                                    InstanceIdentifier instanceIdentifier,
+                                    DataObjectIdentifier instanceIdentifier,
                                     DataObject object)
             throws ExecutionException, InterruptedException {
         Future<Optional<DeviceTransaction>> deviceTxFuture =
@@ -49,7 +49,7 @@ public final class TransactionUtils {
     public static DataObject readTransaction(DeviceTransactionManager deviceTransactionManager,
                                   String nodeId,
                                   LogicalDatastoreType logicalDatastoreType,
-                                  InstanceIdentifier<? extends DataObject> instanceIdentifier)
+                                  DataObjectIdentifier<? extends DataObject> instanceIdentifier)
             throws ExecutionException, InterruptedException {
         Future<Optional<DeviceTransaction>> deviceTxFuture =
                 deviceTransactionManager.getDeviceTransaction(nodeId);
index 44c6a76fdec23861da97933260022f6539381a57..9c6099f2a66be4e664b3804624608da55b5d67ff 100644 (file)
@@ -39,7 +39,6 @@ import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.Uuid
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Link;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.LinkKey;
 import org.opendaylight.yangtools.binding.DataObjectIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -65,7 +64,7 @@ public class R2RTapiLinkDiscovery {
         switch (nodeVersion) {
             case 1:
                 // 1.2.1
-                InstanceIdentifier<Protocols> protocols121IID = InstanceIdentifier
+                DataObjectIdentifier<Protocols> protocols121IID = DataObjectIdentifier
                     .builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
                     .child(Protocols.class)
                     .build();
@@ -84,8 +83,9 @@ public class R2RTapiLinkDiscovery {
                 return rdm2rdmLinkCreatev121(nodeId, tapiTopoUuid, nbr121List);
             case 2:
                 // 2.2.1
-                InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device
-                        .container.org.openroadm.device.Protocols> protocols221IID = InstanceIdentifier
+                DataObjectIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019
+                        .org.openroadm.device.container.org.openroadm.device.Protocols>
+                        protocols221IID = DataObjectIdentifier
                     .builderOfInherited(
                         org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.OrgOpenroadmDeviceData.class,
                         org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container
index 6f8de4a1e5d67226d19e9ac9ca394645e4a6ed33..b5f355a4300520460850fbf44132e876fc1b93b3 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.mdsal.binding.api.NotificationService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.binding.api.RpcService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.transportpce.common.InstanceIdentifiers;
 import org.opendaylight.transportpce.common.NetworkUtils;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
@@ -60,7 +59,12 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Network1;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.Uuid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.network.topology.topology.topology.types.TopologyNetconf;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.tapi.rev230728.ServiceInterfacePoints;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -82,6 +86,10 @@ public class TapiProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(TapiProvider.class);
 
+    private static final InstanceIdentifier<Node> NETCONF_NODE_II = InstanceIdentifier
+            .create(NetworkTopology.class)
+            .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
+            .child(Node.class);
     private static final InstanceIdentifier<Nodes> MAPPING_II = InstanceIdentifier.create(Network.class)
         .child(org.opendaylight.yang.gen.v1.http
             .org.opendaylight.transportpce.portmapping.rev240315.network.Nodes.class);
@@ -158,8 +166,7 @@ public class TapiProvider {
         listeners.add(dataBroker.registerTreeChangeListener(
                 DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, LINK_II), orLinkListener));
         listeners.add(dataBroker.registerTreeChangeListener(
-                DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, InstanceIdentifiers.NETCONF_TOPOLOGY_II
-                    .child(Node.class)),
+                DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, NETCONF_NODE_II),
                 topologyListener));
         listeners.add(dataBroker.registerTreeChangeListener(
                 DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, MAPPING_II), tapiPortMappingListener));