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)
.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
.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,
* @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,
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;
* @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() -
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;
// 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(),
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();
}
// 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);
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;
// 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);
// 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);
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();
}
// 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);
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;
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();
}
.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();
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;
}
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);
}
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>
* 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.
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;
@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();
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;
/*
* 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();
@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();
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;
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);
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 {
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;
*
* @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
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;
/*
* 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()) {
@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()) {
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);
/*
* 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();
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);
@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();
}
@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:
@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();
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;
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()) {
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()))
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();
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);
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();
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()))
}
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();
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();
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();
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();
}
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();
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 {
}
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()))
}
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();
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;
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();
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()))
nodeId,
LogicalDatastoreType.OPERATIONAL,
//interface Identifier
- InstanceIdentifier
+ DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Interface.class, new InterfaceKey(oldMapping.getSupportingOts()))
.build(),
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();
}
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,
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();
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()))
}
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();
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();
// 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();
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();
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();
}
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();
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 {
}
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()))
}
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();
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;
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();
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()))
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();
}
}
- 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();
: 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()
}
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());
}
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,
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();
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()))
}
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();
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,
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();
// 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();
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();
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();
}
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();
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 {
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();
}
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()))
}
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();
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;
@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();
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;
nodeId), e);
}
- InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+ DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Interface.class, new InterfaceKey(ifBuilder.getName()))
.build();
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();
+ " 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();
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();
}
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()))
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;
nodeId), e);
}
- InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+ DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Interface.class, new InterfaceKey(ifBuilder.getName()))
.build();
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();
+ " 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();
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();
}
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()))
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;
nodeId), e);
}
- InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier
+ DataObjectIdentifier<Interface> interfacesIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Interface.class, new InterfaceKey(ifBuilder.getName()))
.build();
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();
+ " 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();
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();
}
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()))
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;
WriteTransaction newWriteOnlyTransaction = getDataBroker().newWriteOnlyTransaction();
newWriteOnlyTransaction
.put(LogicalDatastoreType.CONFIGURATION,
- InstanceIdentifier.create(OperationalModeCatalog.class),
+ DataObjectIdentifier.builder(OperationalModeCatalog.class).build(),
omCatalog);
newWriteOnlyTransaction.commit().get();
} catch (IOException e) {
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;
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()
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;
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();
@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());
@Test
void setPowerLevelTest() {
- InstanceIdentifier<RoadmConnections> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<RoadmConnections> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(RoadmConnections.class, new RoadmConnectionsKey("1"))
.build();
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;
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();
@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());
@Test
void setPowerLevelTest() {
- InstanceIdentifier<RoadmConnections> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<RoadmConnections> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(RoadmConnections.class, new RoadmConnectionsKey("1"))
.build();
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 {
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());
}
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();
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;
.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);
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 {
.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);
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;
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();
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();
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();
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();
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();
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();
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();
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();
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();
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();
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();
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();
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();
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();
// 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();
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();
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();
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();
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();
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();
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,
// 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();
}
@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))
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;
public boolean addNode(String deviceId) {
- InstanceIdentifier<Info> infoIID = InstanceIdentifier
+ DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Info.class)
.build();
}
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,
}
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 =
private void persistDevInterfaces(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevProtocols(String nodeId, Connection connection) {
- InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
private void persistDevProtocolLldpPortConfig(String nodeId, Connection connection) {
- InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
private void persistDevProtocolLldpNbrList(String nodeId, Connection connection) {
- InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
private void persistDevInternalLinks(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevExternalLinks(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevPhysicalLinks(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevDegree(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevSrg(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
//int opticalcontrolmodeEnu=-1;
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevConnectionMap(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevWavelengthMap(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
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;
public boolean addNode(String deviceId) {
- InstanceIdentifier<Info> infoIID = InstanceIdentifier
+ DataObjectIdentifier<Info> infoIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Info.class)
.build();
}
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,
}
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 =
private void persistDevInterfaces(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevProtocols(String nodeId, Connection connection) {
- InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
private void persistDevProtocolLldpPortConfig(String nodeId, Connection connection) {
- InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
private void persistDevProtocolLldpNbrList(String nodeId, Connection connection) {
- InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocolsIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
private void persistDevInternalLinks(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevExternalLinks(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevPhysicalLinks(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevDegree(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevSrg(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevRoadmConnections(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
private void persistDevConnectionMap(String nodeId, Connection connection) {
- InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier
+ DataObjectIdentifier<OrgOpenroadmDevice> deviceIID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.build();
Optional<OrgOpenroadmDevice> deviceObject =
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;
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<>();
/**
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);
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");
}
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;
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);
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;
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);
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;
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);
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;
}
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);
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;
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;
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;
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(
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;
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();
// 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
}
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)) {
}
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)) {
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;
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) {
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:
}
}
if (!nbliidMap.isEmpty() && ospIID != null) {
- InstanceIdentifier<OduSwitchingPools> id = ospIID;
+ DataObjectIdentifier<OduSwitchingPools> id = ospIID.toIdentifier();
Runnable handleNetconfEvent = new Runnable() {
@Override
public void run() {
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;
*/
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))
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))
+ "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();
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();
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;
*/
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))
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))
+ "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();
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();
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;
*/
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))
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))
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();
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();
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;
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;
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();
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;
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,
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;
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,
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);
}
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();
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;
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,
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();
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;
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());
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();
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 {
// 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 {
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;
// 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);
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()
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()
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;
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:", "");
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;
Optional<RoadmConnections> crossconnection = deviceTransactionManager.getDataFromDevice(
nodeId,
LogicalDatastoreType.CONFIGURATION,
- InstanceIdentifier
+ DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(RoadmConnections.class, new RoadmConnectionsKey(xc))
.build(),
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;
}
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();
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();
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
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;
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))
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 {
public static boolean writeTransaction(DeviceTransactionManager deviceTransactionManager,
String nodeId,
LogicalDatastoreType logicalDatastoreType,
- InstanceIdentifier instanceIdentifier,
+ DataObjectIdentifier instanceIdentifier,
DataObject object)
throws ExecutionException, InterruptedException {
Future<Optional<DeviceTransaction>> deviceTxFuture =
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);
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;
switch (nodeVersion) {
case 1:
// 1.2.1
- InstanceIdentifier<Protocols> protocols121IID = InstanceIdentifier
+ DataObjectIdentifier<Protocols> protocols121IID = DataObjectIdentifier
.builderOfInherited(OrgOpenroadmDeviceData.class, OrgOpenroadmDevice.class)
.child(Protocols.class)
.build();
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
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;
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;
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);
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));