+ private List<String> getInterfacesTodelete(String nodeId, String srcTp, String destTp, String spectralSlotName) {
+
+ OpenroadmNodeVersion nodeOpenRoadmVersion =
+ this.portMapping.getNode(nodeId).getNodeInfo().getOpenroadmVersion();
+ List<String> interfacesToDelete = new LinkedList<>();
+ Map<String, List<String>> suffixListMap =
+ nodeOpenRoadmVersion.equals(OpenroadmNodeVersion._71)
+ ? Map.of(
+ "ODU", List.of("ODUC4","ODUFLEX"),
+ // -400G added due to the change in naming convention
+ "other", List.of("OTUC4", "OTSIGROUP-400G", spectralSlotName))
+ : Map.of(
+ "ODU", List.of("ODU", "ODU4"),
+ "other", List.of("OTU", spectralSlotName));
+ // this last suffix used to be retrieved from openRoadmInterfaceFactory.createOpenRoadmOchInterfaceName
+ // i.e. String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, destTp, spectralSlotName) with
+ // common GridConstant that states NAME_PARAMETERS_SEPARATOR = "-"
+
+ if (destTp.contains(StringConstants.NETWORK_TOKEN)) {
+ try {
+ for (String suffix : suffixListMap.get("ODU")) {
+ if (this.openRoadmInterfaces.getInterface(
+ nodeId, String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, destTp, suffix)).isPresent()) {
+ interfacesToDelete.add(String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, destTp, suffix));
+ }
+ }
+ }
+ catch (OpenRoadmInterfaceException e) {
+ LOG.error("impossible to get one of the interfaces {}",
+ destTp + GridConstant.NAME_PARAMETERS_SEPARATOR + String.join(
+ " or " + destTp + GridConstant.NAME_PARAMETERS_SEPARATOR,
+ suffixListMap.get("ODU")),
+ e);
+ }
+ for (String suffix : suffixListMap.get("other")) {
+ interfacesToDelete.add(String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, destTp, suffix));
+ }
+ }
+ if (srcTp.contains(StringConstants.NETWORK_TOKEN)) {
+ interfacesToDelete.add(
+ String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, srcTp, suffixListMap.get("ODU").get(0)));
+ for (String suffix : suffixListMap.get("other")) {
+ interfacesToDelete.add(String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, srcTp, suffix));
+ }
+ }
+
+ if (srcTp.contains(StringConstants.CLIENT_TOKEN)) {
+ interfacesToDelete.add(String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, srcTp, "ETHERNET"));
+ }
+ if (destTp.contains(StringConstants.CLIENT_TOKEN)) {
+
+ interfacesToDelete.add(String.join(GridConstant.NAME_PARAMETERS_SEPARATOR, destTp, "ETHERNET"));
+ }
+ return interfacesToDelete;
+ }
+
+
+