+
+ public boolean isUsedByXc(String nodeId, String interfaceName, String xc,
+ DeviceTransactionManager deviceTransactionManager) {
+ InstanceIdentifier<RoadmConnections> xciid = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(RoadmConnections.class, new RoadmConnectionsKey(xc));
+ LOG.info("reading xc {} in node {}", xc, nodeId);
+ Optional<RoadmConnections> crossconnection = deviceTransactionManager.getDataFromDevice(nodeId,
+ LogicalDatastoreType.CONFIGURATION, xciid, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ if (crossconnection.isPresent()) {
+ RoadmConnections rc = crossconnection.get();
+ LOG.info("xd {} found", xc);
+ if (rc.getSource().getSrcIf().equals(interfaceName)
+ || rc.getDestination().getDstIf().equals(interfaceName)) {
+ return true;
+ }
+ } else {
+ LOG.info("xd {} not found !", xc);
+ }
+ return false;
+ }
+