X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Ftapi%2Fconnectivity%2FConnectivityUtils.java;fp=tapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Ftapi%2Fconnectivity%2FConnectivityUtils.java;h=c88c5239c689c25cc09c859a790aaeac49fdfbcd;hb=98ba9741bc45b3770f82465e241d64b536bf7341;hp=392ae6d60736019cd6486a7e43d0a68a824c9b63;hpb=89593c27e1aee06510ae215c994a929868a080a2;p=transportpce.git diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/connectivity/ConnectivityUtils.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/connectivity/ConnectivityUtils.java index 392ae6d60..c88c5239c 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/connectivity/ConnectivityUtils.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/connectivity/ConnectivityUtils.java @@ -7,7 +7,7 @@ */ package org.opendaylight.transportpce.tapi.connectivity; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; @@ -119,7 +119,7 @@ import org.slf4j.LoggerFactory; public final class ConnectivityUtils { private final Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); private static final Logger LOG = LoggerFactory.getLogger(ConnectivityUtils.class); private final ServiceDataStoreOperations serviceDataStoreOperations; @@ -130,6 +130,9 @@ public final class ConnectivityUtils { org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection> connectionFullMap; // this variable is for complete connection objects private final NetworkTransactionService networkTransactionService; + private Connection topConnRdmRdm; + private Connection topConnXpdrXpdrPhtn; + private Connection topConnXpdrXpdrOdu; // TODO -> handle cases for which node id is ROADM-A1 and not ROADMA01 or XPDR-A1 and not XPDRA01 public ConnectivityUtils(ServiceDataStoreOperations serviceDataStoreOperations, @@ -140,6 +143,9 @@ public final class ConnectivityUtils { this.sipMap = sipMap; this.connectionFullMap = new HashMap<>(); this.networkTransactionService = networkTransactionService; + this.topConnRdmRdm = null; + this.topConnXpdrXpdrPhtn = null; + this.topConnXpdrXpdrOdu = null; } public static ServiceCreateInput buildServiceCreateInput(GenericServiceEndpoint sepA, GenericServiceEndpoint sepZ) { @@ -301,7 +307,7 @@ public final class ConnectivityUtils { .setAdministrativeState(AdministrativeState.UNLOCKED) .setOperationalState(OperationalState.ENABLED) .setLifecycleState(LifecycleState.INSTALLED) - .setUuid(new Uuid(UUID.nameUUIDFromBytes(service.getServiceName().getBytes(Charset.forName("UTF-8"))) + .setUuid(new Uuid(UUID.nameUUIDFromBytes(service.getServiceName().getBytes(StandardCharsets.UTF_8)) .toString())) .setServiceLayer(mapServiceLayer(serviceAEnd.getServiceFormat(), endPoint1, endPoint2)) .setServiceType(ServiceType.POINTTOPOINTCONNECTIVITY) @@ -336,7 +342,7 @@ public final class ConnectivityUtils { private OpenroadmNodeType getOpenroadmType(String nodeName) { LOG.info("Node name = {}", nodeName); Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+",nodeName, TapiStringConstants.DSR)) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node tapiNode = this.tapiContext.getTapiNode(this.tapiTopoUuid, nodeUuid); if (tapiNode != null) { @@ -348,10 +354,10 @@ public final class ConnectivityUtils { private Map createConnectionsFromService( org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.ServiceAEnd - serviceAEnd, + serviceAEnd, org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.ServiceZEnd - serviceZEnd, - PathDescription pathDescription) { + serviceZEnd, + PathDescription pathDescription) { Map connectionServMap = new HashMap<>(); // build lists with ROADM nodes, XPDR/MUX/SWITCH nodes, ROADM DEG TTPs, ROADM SRG TTPs, XPDR CLIENT TTPs // and XPDR NETWORK TTPs (if any). From the path description. This will help to build the uuid of the CEPs @@ -364,7 +370,7 @@ public final class ConnectivityUtils { List rdmNodelist = new ArrayList<>(); List xpdrNodelist = new ArrayList<>(); for (AToZ elem:pathDescription.getAToZDirection().getAToZ().values().stream() - .sorted(Comparator.comparing(AToZ::getId)).collect(Collectors.toList())) { + .sorted((Comparator.comparing(atoz -> Integer.valueOf(atoz.getId())))).collect(Collectors.toList())) { resourceType = elem.getResource().getResource().implementedInterface().getSimpleName(); switch (resourceType) { case TapiStringConstants.TP: @@ -466,11 +472,16 @@ public final class ConnectivityUtils { // - XC Connection OTSi betwwen iOTSi y eOTSi of xpdr // - Top connection OTSi between network ports of xpdrs in the Photonic media layer -> i_OTSi connectionServMap.putAll(createXpdrCepsAndConnectionsPht(xpdrNetworkTplist, xpdrNodelist)); + this.topConnRdmRdm = null; break; case ODU: + // TODO: verify if this is correct // - XC Connection OTSi betwwen iODU and eODU of xpdr // - Top connection in the ODU layer, between xpdr eODU ports (?) - connectionServMap.putAll(createXpdrCepsAndConnectionsOdu(xpdrNetworkTplist, xpdrNodelist)); + if (openroadmNodeType.equals(OpenroadmNodeType.MUXPDR)) { + connectionServMap.putAll(createXpdrCepsAndConnectionsOdu(xpdrNetworkTplist, xpdrNodelist)); + this.topConnXpdrXpdrPhtn = null; + } break; case Ethernet: // Check if OC, OTU and ODU are created @@ -479,23 +490,26 @@ public final class ConnectivityUtils { connectionServMap.putAll(createRoadmCepsAndConnections(rdmAddDropTplist, rdmDegTplist, rdmNodelist, edgeRoadm1, edgeRoadm2)); connectionServMap.putAll(createXpdrCepsAndConnectionsPht(xpdrNetworkTplist, xpdrNodelist)); + this.topConnRdmRdm = null; xpdrClientTplist = getAssociatedClientsPort(xpdrNetworkTplist); LOG.info("Associated client ports = {}", xpdrClientTplist); connectionServMap.putAll(createXpdrCepsAndConnectionsEth(xpdrClientTplist, xpdrNodelist, connectionServMap)); + this.topConnXpdrXpdrPhtn = null; } if (openroadmNodeType.equals(OpenroadmNodeType.SWITCH)) { // TODO: We create both ODU and DSR because there is no ODU service creation for the switch // - XC Connection OTSi betwwen iODU and eODU of xpdr // - Top connection in the ODU layer, between xpdr eODU ports (?) - connectionServMap.putAll(createXpdrCepsAndConnectionsOdu(xpdrNetworkTplist, xpdrNodelist)); connectionServMap.putAll(createXpdrCepsAndConnectionsDsr(xpdrClientTplist, xpdrNetworkTplist, xpdrNodelist)); + this.topConnXpdrXpdrPhtn = null; } if (openroadmNodeType.equals(OpenroadmNodeType.MUXPDR)) { // TODO: OTN service but mux has 3 steps at rendering. Verify that things exist connectionServMap.putAll(createXpdrCepsAndConnectionsDsr(xpdrClientTplist, xpdrNetworkTplist, xpdrNodelist)); + this.topConnXpdrXpdrOdu = null; } break; default: @@ -537,7 +551,7 @@ public final class ConnectivityUtils { // DSR top connection between edge xpdr CLIENT DSR org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connectionDsr = createTopConnection(spcXpdr1, spcXpdr2, cepMapDsr, TapiStringConstants.DSR, - LayerProtocolName.DSR, xcMap); + LayerProtocolName.DSR, xcMap, this.topConnXpdrXpdrPhtn); this.connectionFullMap.put(connectionDsr.key(), connectionDsr); // DSR top connection that will be added to the service object @@ -598,7 +612,7 @@ public final class ConnectivityUtils { org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connectionOdu = createTopConnection(spcXpdr1, spcXpdr2, cepMapOdu, TapiStringConstants.E_ODU, - LayerProtocolName.ODU, xcMap); + LayerProtocolName.ODU, xcMap, this.topConnXpdrXpdrOdu); this.connectionFullMap.put(connectionOdu.key(), connectionOdu); // ODU top connection that will be added to the service object @@ -609,7 +623,7 @@ public final class ConnectivityUtils { org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connectionDsr = createTopConnection(spcXpdr1, spcXpdr2, cepMapDsr, TapiStringConstants.DSR, - LayerProtocolName.DSR, xcMap); + LayerProtocolName.DSR, xcMap, this.topConnXpdrXpdrPhtn); this.connectionFullMap.put(connectionDsr.key(), connectionDsr); // DSR top connection that will be added to the service object @@ -649,12 +663,13 @@ public final class ConnectivityUtils { .get(xpdrNodelist.size() - 1))).findFirst().get(); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.I_ODU, - LayerProtocolName.ODU, xcMap); + LayerProtocolName.ODU, xcMap, this.topConnXpdrXpdrPhtn); this.connectionFullMap.put(connection.key(), connection); // ODU top connection that will be added to the service object Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build(); connServMap.put(conn.key(), conn); + this.topConnXpdrXpdrOdu = conn; return connServMap; } @@ -709,13 +724,13 @@ public final class ConnectivityUtils { .get(xpdrNodelist.size() - 1))).findFirst().get(); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.I_OTSI, - LayerProtocolName.PHOTONICMEDIA, xcMap); + LayerProtocolName.PHOTONICMEDIA, xcMap, this.topConnRdmRdm); this.connectionFullMap.put(connection.key(), connection); // OTSi top connection that will be added to the service object Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build(); connServMap.put(conn.key(), conn); - + this.topConnXpdrXpdrPhtn = conn; return connServMap; } @@ -724,106 +739,149 @@ public final class ConnectivityUtils { List rdmDegTplist, List rdmNodelist, String edgeRoadm1, String edgeRoadm2) { - // TODO: when the number of roadms between 2 SPDR/XPDR is more thatn 1, we need to refine this code - Map connServMap = new HashMap<>(); + // TODO: will need to check if things exist already or not Map cepMap = new HashMap<>(); - Map xcMap = new HashMap<>(); // create ceps and x connections within roadm + Map xcLowerMap = new HashMap<>(); for (String roadm : rdmNodelist) { LOG.info("Creating ceps and xc for roadm {}", roadm); - String spcRdmAD = rdmAddDropTplist.stream().filter(adp -> adp.contains(roadm)).findFirst().get(); - LOG.info("AD port of ROADm {} = {}", roadm, spcRdmAD); - // There should be only 1 AD and 1 DEG per roadm - // TODO photonic media model should be updated to have the corresponding CEPs. I will just create - // 3 different MC CEPs giving different IDs to show that they are different - // Create 3 CEPs for each AD and DEG and the corresponding cross connections, matching the NEPs - // created in the topology creation - // add CEPs to the topology to the corresponding ONEP - ConnectionEndPoint adCep1 = createCepRoadm(spcRdmAD, TapiStringConstants.PHTNC_MEDIA); - putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.PHTNC_MEDIA, adCep1); - ConnectionEndPoint adCep2 = createCepRoadm(spcRdmAD, TapiStringConstants.MC); - putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.MC, adCep2); - ConnectionEndPoint adCep3 = createCepRoadm(spcRdmAD, TapiStringConstants.OTSI_MC); - putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.OTSI_MC, adCep3); - cepMap.put(adCep1.key(), adCep1); - cepMap.put(adCep2.key(), adCep2); - cepMap.put(adCep3.key(), adCep3); - - String spcRdmDEG = rdmDegTplist.stream().filter(adp -> adp.contains(roadm)).findFirst().get(); - LOG.info("Degree port of ROADm {} = {}", roadm, spcRdmDEG); - - ConnectionEndPoint degCep1 = createCepRoadm(spcRdmDEG, TapiStringConstants.PHTNC_MEDIA); - putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.PHTNC_MEDIA, degCep1); - ConnectionEndPoint degCep2 = createCepRoadm(spcRdmDEG, TapiStringConstants.MC); - putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.MC, degCep2); - ConnectionEndPoint degCep3 = createCepRoadm(spcRdmDEG, TapiStringConstants.OTSI_MC); - putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.OTSI_MC, degCep3); - cepMap.put(degCep1.key(), degCep1); - cepMap.put(degCep2.key(), degCep2); - cepMap.put(degCep3.key(), degCep3); - - LOG.info("Going to create cross connections for ROADM {}", roadm); - // Create X connections between MC and OTSi_MC for full map - org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection - connection1 = createXCBetweenCeps(adCep2, degCep2, spcRdmAD, spcRdmDEG, TapiStringConstants.MC, - LayerProtocolName.PHOTONICMEDIA); - LOG.info("Cross connection 1 created = {}", connection1); - org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection - connection2 = createXCBetweenCeps(adCep3, degCep3, spcRdmAD, spcRdmDEG, TapiStringConstants.OTSI_MC, - LayerProtocolName.PHOTONICMEDIA); - LOG.info("Cross connection 2 created = {}", connection2); - this.connectionFullMap.put(connection1.key(), connection1); - this.connectionFullMap.put(connection2.key(), connection2); - - // Create X connections that will be added to the service object - LowerConnection conn1 = new LowerConnectionBuilder().setConnectionUuid(connection1.getUuid()).build(); - LowerConnection conn2 = new LowerConnectionBuilder().setConnectionUuid(connection2.getUuid()).build(); - - xcMap.put(conn1.key(), conn1); - xcMap.put(conn2.key(), conn2); - } - LOG.info("Going to create top connections betwee roadms"); - // create top connections between roadms: MC connections between AD MC CEPs of roadms - for (int i = 0; i < rdmNodelist.size(); i++) { - if (rdmNodelist.size() <= (i + 1)) { - LOG.info("Reached last roadm. No more MC connections"); - break; + if (roadm.equals(edgeRoadm1) || roadm.equals(edgeRoadm2)) { + LOG.info("EDGE ROADM, cross connections needed between SRG and DEG"); + String spcRdmAD = rdmAddDropTplist.stream().filter(adp -> adp.contains(roadm)).findFirst().get(); + LOG.info("AD port of ROADm {} = {}", roadm, spcRdmAD); + // There should be only 1 AD and 1 DEG per roadm + // TODO photonic media model should be updated to have the corresponding CEPs. I will just create + // 3 different MC CEPs giving different IDs to show that they are different + // Create 3 CEPs for each AD and DEG and the corresponding cross connections, matching the NEPs + // created in the topology creation + // add CEPs to the topology to the corresponding ONEP + ConnectionEndPoint adCep1 = createCepRoadm(spcRdmAD, TapiStringConstants.PHTNC_MEDIA); + putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.PHTNC_MEDIA, adCep1); + ConnectionEndPoint adCep2 = createCepRoadm(spcRdmAD, TapiStringConstants.MC); + putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.MC, adCep2); + ConnectionEndPoint adCep3 = createCepRoadm(spcRdmAD, TapiStringConstants.OTSI_MC); + putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.OTSI_MC, adCep3); + cepMap.put(adCep1.key(), adCep1); + cepMap.put(adCep2.key(), adCep2); + cepMap.put(adCep3.key(), adCep3); + + String spcRdmDEG = rdmDegTplist.stream().filter(adp -> adp.contains(roadm)).findFirst().get(); + LOG.info("Degree port of ROADm {} = {}", roadm, spcRdmDEG); + + ConnectionEndPoint degCep1 = createCepRoadm(spcRdmDEG, TapiStringConstants.PHTNC_MEDIA); + putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.PHTNC_MEDIA, degCep1); + ConnectionEndPoint degCep2 = createCepRoadm(spcRdmDEG, TapiStringConstants.MC); + putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.MC, degCep2); + ConnectionEndPoint degCep3 = createCepRoadm(spcRdmDEG, TapiStringConstants.OTSI_MC); + putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.OTSI_MC, degCep3); + cepMap.put(degCep1.key(), degCep1); + cepMap.put(degCep2.key(), degCep2); + cepMap.put(degCep3.key(), degCep3); + + LOG.info("Going to create cross connections for ROADM {}", roadm); + // Create X connections between MC and OTSi_MC for full map + org.opendaylight.yang.gen.v1.urn + .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connection1 + = createXCBetweenCeps(adCep2, degCep2, spcRdmAD, spcRdmDEG, TapiStringConstants.MC, + LayerProtocolName.PHOTONICMEDIA); + LOG.info("Cross connection 1 created = {}", connection1.toString()); + org.opendaylight.yang.gen.v1.urn + .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connection2 + = createXCBetweenCeps(adCep3, degCep3, spcRdmAD, spcRdmDEG, TapiStringConstants.OTSI_MC, + LayerProtocolName.PHOTONICMEDIA); + LOG.info("Cross connection 2 created = {}", connection2.toString()); + this.connectionFullMap.put(connection1.key(), connection1); + this.connectionFullMap.put(connection2.key(), connection2); + + // Create X connections that will be added to the service object + LowerConnection conn1 = new LowerConnectionBuilder().setConnectionUuid(connection1.getUuid()).build(); + LowerConnection conn2 = new LowerConnectionBuilder().setConnectionUuid(connection2.getUuid()).build(); + + xcLowerMap.put(conn1.key(), conn1); + xcLowerMap.put(conn2.key(), conn2); + } else { + LOG.info("MIDDLE ROADM, cross connections needed between DEG and DEG"); + String spcRdmDEG1 = rdmDegTplist.stream().filter(adp -> adp.contains(roadm)).findFirst().get(); + LOG.info("Degree 1 port of ROADm {} = {}", roadm, spcRdmDEG1); + + ConnectionEndPoint deg1Cep1 = createCepRoadm(spcRdmDEG1, TapiStringConstants.PHTNC_MEDIA); + putRdmCepInTopologyContext(roadm, spcRdmDEG1, TapiStringConstants.PHTNC_MEDIA, deg1Cep1); + ConnectionEndPoint deg1Cep2 = createCepRoadm(spcRdmDEG1, TapiStringConstants.MC); + putRdmCepInTopologyContext(roadm, spcRdmDEG1, TapiStringConstants.MC, deg1Cep2); + ConnectionEndPoint deg1Cep3 = createCepRoadm(spcRdmDEG1, TapiStringConstants.OTSI_MC); + putRdmCepInTopologyContext(roadm, spcRdmDEG1, TapiStringConstants.OTSI_MC, deg1Cep3); + cepMap.put(deg1Cep1.key(), deg1Cep1); + cepMap.put(deg1Cep2.key(), deg1Cep2); + cepMap.put(deg1Cep3.key(), deg1Cep3); + + String spcRdmDEG2 = rdmDegTplist.stream().filter(adp -> adp.contains(roadm)).skip(1).findFirst().get(); + LOG.info("Degree 2 port of ROADm {} = {}", roadm, spcRdmDEG2); + + ConnectionEndPoint deg2Cep1 = createCepRoadm(spcRdmDEG2, TapiStringConstants.PHTNC_MEDIA); + putRdmCepInTopologyContext(roadm, spcRdmDEG2, TapiStringConstants.PHTNC_MEDIA, deg2Cep1); + ConnectionEndPoint deg2Cep2 = createCepRoadm(spcRdmDEG2, TapiStringConstants.MC); + putRdmCepInTopologyContext(roadm, spcRdmDEG2, TapiStringConstants.MC, deg2Cep2); + ConnectionEndPoint deg2Cep3 = createCepRoadm(spcRdmDEG2, TapiStringConstants.OTSI_MC); + putRdmCepInTopologyContext(roadm, spcRdmDEG2, TapiStringConstants.OTSI_MC, deg2Cep3); + cepMap.put(deg2Cep1.key(), deg2Cep1); + cepMap.put(deg2Cep2.key(), deg2Cep2); + cepMap.put(deg2Cep3.key(), deg2Cep3); + + LOG.info("Going to create cross connections for ROADM {}", roadm); + // Create X connections between MC and OTSi_MC for full map + org.opendaylight.yang.gen.v1.urn + .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connection1 + = createXCBetweenCeps(deg1Cep2, deg2Cep2, spcRdmDEG1, spcRdmDEG2, + TapiStringConstants.MC, LayerProtocolName.PHOTONICMEDIA); + LOG.info("Cross connection 1 created = {}", connection1.toString()); + org.opendaylight.yang.gen.v1.urn + .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection connection2 + = createXCBetweenCeps(deg1Cep3, deg2Cep3, spcRdmDEG1, spcRdmDEG2, + TapiStringConstants.OTSI_MC, LayerProtocolName.PHOTONICMEDIA); + LOG.info("Cross connection 2 created = {}", connection2.toString()); + this.connectionFullMap.put(connection1.key(), connection1); + this.connectionFullMap.put(connection2.key(), connection2); + + // Create X connections that will be added to the service object + LowerConnection conn1 = new LowerConnectionBuilder().setConnectionUuid(connection1.getUuid()).build(); + LowerConnection conn2 = new LowerConnectionBuilder().setConnectionUuid(connection2.getUuid()).build(); + + xcLowerMap.put(conn1.key(), conn1); + xcLowerMap.put(conn2.key(), conn2); } - // Current roadm with roadm i + 1 --> MC - String roadm1 = rdmNodelist.get(i); - String spcRdmAD1 = rdmAddDropTplist.stream().filter(adp -> adp.contains(roadm1)).findFirst().get(); - String roadm2 = rdmNodelist.get(i + 1); - String spcRdmAD2 = rdmAddDropTplist.stream().filter(adp -> adp.contains(roadm2)).findFirst().get(); - LOG.info("Creating top connection from {} to {} between tps: {}-{}", roadm1, roadm2, spcRdmAD1, spcRdmAD2); - - // Create top connections between MC for full map - org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection - connection = createTopConnection(spcRdmAD1, spcRdmAD2, cepMap, TapiStringConstants.MC, - LayerProtocolName.PHOTONICMEDIA, xcMap); - this.connectionFullMap.put(connection.key(), connection); - LOG.info("Top connection created = {}", connection); - - // Create top connections that will be added to the service object - Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build(); - connServMap.put(conn.key(), conn); - LowerConnection conn1 = new LowerConnectionBuilder().setConnectionUuid(connection.getUuid()).build(); - xcMap.put(conn1.key(), conn1); } - - // OTSiMC top connection between edge roadms - LOG.info("Going to created top connection between OTSiMC"); + LOG.info("Going to create top connections between roadms"); String spcRdmAD1 = rdmAddDropTplist.stream().filter(adp -> adp.contains(edgeRoadm1)).findFirst().get(); String spcRdmAD2 = rdmAddDropTplist.stream().filter(adp -> adp.contains(edgeRoadm2)).findFirst().get(); + // MC top connection between edge roadms + LOG.info("Going to created top connection between MC"); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection - connection = createTopConnection(spcRdmAD1, spcRdmAD2, cepMap, TapiStringConstants.OTSI_MC, - LayerProtocolName.PHOTONICMEDIA, xcMap); + connection = createTopConnection(spcRdmAD1, spcRdmAD2, cepMap, TapiStringConstants.MC, + LayerProtocolName.PHOTONICMEDIA, xcLowerMap, null); this.connectionFullMap.put(connection.key(), connection); - LOG.info("Top connection created = {}", connection); + LOG.info("Top connection created = {}", connection.toString()); + Map connServMap = new HashMap<>(); // OTSiMC top connections that will be added to the service object Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build(); connServMap.put(conn.key(), conn); + LowerConnection conn1 = new LowerConnectionBuilder().setConnectionUuid(connection.getUuid()).build(); + Map topLowerMap = new HashMap<>(); + topLowerMap.put(conn1.key(), conn1); + + // OTSiMC top connection between edge roadms + LOG.info("Going to created top connection between OTSiMC"); + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection + connection1 = createTopConnection(spcRdmAD1, spcRdmAD2, cepMap, TapiStringConstants.OTSI_MC, + LayerProtocolName.PHOTONICMEDIA, topLowerMap, null); + this.connectionFullMap.put(connection1.key(), connection1); + LOG.info("Top connection created = {}", connection1.toString()); + + // OTSiMC top connections that will be added to the service object + Connection conn2 = new ConnectionBuilder().setConnectionUuid(connection1.getUuid()).build(); + connServMap.put(conn2.key(), conn2); + this.topConnRdmRdm = conn2; return connServMap; } @@ -832,14 +890,14 @@ public final class ConnectivityUtils { Map cepMap, String qual, LayerProtocolName topPortocol, - Map xcMap) { + Map xcMap, Connection additionalLowerConn) { // find cep for each AD MC of roadm 1 and 2 LOG.info("Top connection name = {}", String.join("+", "TOP", tp1, tp2, qual)); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.ConnectionEndPoint adCep1 = cepMap.get(new org.opendaylight.yang.gen.v1.urn .onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey( new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP", tp1.split("\\+")[0], - qual, tp1.split("\\+")[1])).getBytes(Charset.forName("UTF-8"))) + qual, tp1.split("\\+")[1])).getBytes(StandardCharsets.UTF_8)) .toString()))); LOG.info("ADCEP1 = {}", adCep1); org.opendaylight.yang.gen.v1.urn @@ -858,7 +916,7 @@ public final class ConnectivityUtils { cepMap.get(new org.opendaylight.yang.gen.v1.urn .onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey( new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP", tp2.split("\\+")[0], - qual, tp2.split("\\+")[1])).getBytes(Charset.forName("UTF-8"))) + qual, tp2.split("\\+")[1])).getBytes(StandardCharsets.UTF_8)) .toString()))); LOG.info("ADCEP2 = {}", adCep2); org.opendaylight.yang.gen.v1.urn @@ -882,10 +940,14 @@ public final class ConnectivityUtils { .setValue(String.join("+", "TOP", tp1, tp2, qual)) .build(); // TODO: lower connection, supported link....... + if (additionalLowerConn != null) { + xcMap.putIfAbsent(new LowerConnectionKey(additionalLowerConn.getConnectionUuid()), + new LowerConnectionBuilder().setConnectionUuid(additionalLowerConn.getConnectionUuid()).build()); + } return new org.opendaylight.yang.gen.v1.urn .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.ConnectionBuilder() .setUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", "TOP", tp1, tp2, qual)) - .getBytes(Charset.forName("UTF-8"))).toString())) + .getBytes(StandardCharsets.UTF_8)).toString())) .setName(Map.of(connName.key(), connName)) .setConnectionEndPoint(ceps) .setOperationalState(OperationalState.ENABLED) @@ -939,7 +1001,7 @@ public final class ConnectivityUtils { return new org.opendaylight.yang.gen.v1.urn .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.ConnectionBuilder() .setUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", "XC", tp1, tp2, qual)) - .getBytes(Charset.forName("UTF-8"))).toString())) + .getBytes(StandardCharsets.UTF_8)).toString())) .setName(Map.of(connName.key(), connName)) .setConnectionEndPoint(ceps) .setOperationalState(OperationalState.ENABLED) @@ -958,19 +1020,19 @@ public final class ConnectivityUtils { .build(); ClientNodeEdgePoint cnep = new ClientNodeEdgePointBuilder() .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", id.split("\\+")[0], - qualifier, id.split("\\+")[1])).getBytes(Charset.forName("UTF-8"))) + qualifier, id.split("\\+")[1])).getBytes(StandardCharsets.UTF_8)) .toString())) .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+",id.split("\\+")[0], - qualifier)).getBytes(Charset.forName("UTF-8"))) + qualifier)).getBytes(StandardCharsets.UTF_8)) .toString())) .setTopologyUuid(new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER - .getBytes(Charset.forName("UTF-8"))).toString())) + .getBytes(StandardCharsets.UTF_8)).toString())) .build(); // TODO: add augmentation with the corresponding cep-spec (i.e. MC, OTSiMC...) // TODO: add parent ONEP?? ConnectionEndPointBuilder cepBldr = new ConnectionEndPointBuilder() .setUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP", id.split("\\+")[0], - qualifier, id.split("\\+")[1])).getBytes(Charset.forName("UTF-8"))) + qualifier, id.split("\\+")[1])).getBytes(StandardCharsets.UTF_8)) .toString())) .setClientNodeEdgePoint(Map.of(cnep.key(), cnep)) .setName(Map.of(cepName.key(), cepName)) @@ -991,19 +1053,19 @@ public final class ConnectivityUtils { .build(); ClientNodeEdgePoint cnep = new ClientNodeEdgePointBuilder() .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", id.split("\\+")[0], - qualifier, id.split("\\+")[1])).getBytes(Charset.forName("UTF-8"))) + qualifier, id.split("\\+")[1])).getBytes(StandardCharsets.UTF_8)) .toString())) .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+",id.split("\\+")[0], - nodeLayer)).getBytes(Charset.forName("UTF-8"))) + nodeLayer)).getBytes(StandardCharsets.UTF_8)) .toString())) .setTopologyUuid(new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER - .getBytes(Charset.forName("UTF-8"))).toString())) + .getBytes(StandardCharsets.UTF_8)).toString())) .build(); // TODO: add augmentation with the corresponding cep-spec (i.e. MC, OTSiMC...) // TODO: add parent ONEP?? ConnectionEndPointBuilder cepBldr = new ConnectionEndPointBuilder() .setUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP", id.split("\\+")[0], - qualifier, id.split("\\+")[1])).getBytes(Charset.forName("UTF-8"))) + qualifier, id.split("\\+")[1])).getBytes(StandardCharsets.UTF_8)) .toString())) .setClientNodeEdgePoint(Map.of(cnep.key(), cnep)) .setName(Map.of(cepName.key(), cepName)) @@ -1016,8 +1078,8 @@ public final class ConnectivityUtils { } private EndPoint mapServiceZEndPoint( - org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.ServiceZEnd - serviceZEnd, PathDescription pathDescription) { + org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.ServiceZEnd + serviceZEnd, PathDescription pathDescription) { EndPointBuilder endPointBuilder = new EndPointBuilder(); // 1. Service Format: ODU, OTU, ETH ServiceFormat serviceFormat = serviceZEnd.getServiceFormat(); @@ -1073,8 +1135,8 @@ public final class ConnectivityUtils { } private EndPoint mapServiceAEndPoint( - org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.ServiceAEnd - serviceAEnd, PathDescription pathDescription) { + org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.ServiceAEnd + serviceAEnd, PathDescription pathDescription) { EndPointBuilder endPointBuilder = new EndPointBuilder(); // 1. Service Format: ODU, OTU, ETH ServiceFormat serviceFormat = serviceAEnd.getServiceFormat(); @@ -1136,7 +1198,7 @@ public final class ConnectivityUtils { ZToA firstElement = mapztoa.values().stream().filter(ztoa -> ztoa.getId().equals("0")).findFirst().get(); TerminationPoint tp = (TerminationPoint) firstElement.getResource().getResource(); Uuid sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.MC, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) + tp.getTpNodeId(), TapiStringConstants.MC, tp.getTpId())).getBytes(StandardCharsets.UTF_8)) .toString()); LOG.info("SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.MC, tp.getTpId())); for (ServiceInterfacePoint sip:this.sipMap.values()) { @@ -1157,9 +1219,8 @@ public final class ConnectivityUtils { firstElement = mapztoa.values().stream().filter(ztoa -> ztoa.getId().equals("2")).findFirst().get(); tp = (TerminationPoint) firstElement.getResource().getResource(); // Network-Network ports --> iODU layer SIPs TODO --> updated to E_ODU - sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.I_ODU, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) - .toString()); + sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", tp.getTpNodeId(), + TapiStringConstants.I_ODU, tp.getTpId())).getBytes(StandardCharsets.UTF_8)).toString()); LOG.info("SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.I_ODU, tp.getTpId())); break; @@ -1167,9 +1228,8 @@ public final class ConnectivityUtils { firstElement = mapztoa.values().stream().filter(ztoa -> ztoa.getId().equals("2")).findFirst().get(); tp = (TerminationPoint) firstElement.getResource().getResource(); // Network-Network ports --> iOTSi layer SIPs - sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.I_OTSI, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) - .toString()); + sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", tp.getTpNodeId(), + TapiStringConstants.I_OTSI, tp.getTpId())).getBytes(StandardCharsets.UTF_8)).toString()); LOG.info("SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.I_OTSI, tp.getTpId())); break; @@ -1178,9 +1238,8 @@ public final class ConnectivityUtils { firstElement = mapztoa.values().stream().filter(ztoa -> ztoa.getId().equals("0")).findFirst().get(); tp = (TerminationPoint) firstElement.getResource().getResource(); // Client-client ports --> DSR layer SIPs - sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.DSR, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) - .toString()); + sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", tp.getTpNodeId(), + TapiStringConstants.DSR, tp.getTpId())).getBytes(StandardCharsets.UTF_8)).toString()); LOG.info("SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.DSR, tp.getTpId())); break; @@ -1211,7 +1270,7 @@ public final class ConnectivityUtils { LOG.info("First element of service path = {}", firstElement.getResource().getResource()); TerminationPoint tp = (TerminationPoint) firstElement.getResource().getResource(); Uuid sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.MC, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) + tp.getTpNodeId(), TapiStringConstants.MC, tp.getTpId())).getBytes(StandardCharsets.UTF_8)) .toString()); LOG.info("ROADM SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.MC, tp.getTpId())); @@ -1233,9 +1292,8 @@ public final class ConnectivityUtils { firstElement = mapatoz.values().stream().filter(atoz -> atoz.getId().equals("2")).findFirst().get(); tp = (TerminationPoint) firstElement.getResource().getResource(); // Network-Network ports --> iODU layer SIPs. TODO -> updated to eODU - sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.I_ODU, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) - .toString()); + sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", tp.getTpNodeId(), + TapiStringConstants.I_ODU, tp.getTpId())).getBytes(StandardCharsets.UTF_8)).toString()); LOG.info("ODU XPDR SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.I_ODU, tp.getTpId())); break; @@ -1243,9 +1301,8 @@ public final class ConnectivityUtils { firstElement = mapatoz.values().stream().filter(atoz -> atoz.getId().equals("2")).findFirst().get(); tp = (TerminationPoint) firstElement.getResource().getResource(); // Network-Network ports --> iOTSi layer SIPs - sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.I_OTSI, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) - .toString()); + sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", tp.getTpNodeId(), + TapiStringConstants.I_OTSI, tp.getTpId())).getBytes(StandardCharsets.UTF_8)).toString()); LOG.info("OTU XPDR SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.I_OTSI, tp.getTpId())); break; @@ -1254,9 +1311,8 @@ public final class ConnectivityUtils { firstElement = mapatoz.values().stream().filter(atoz -> atoz.getId().equals("0")).findFirst().get(); tp = (TerminationPoint) firstElement.getResource().getResource(); // Client-client ports --> DSR layer SIPs - sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", - tp.getTpNodeId(), TapiStringConstants.DSR, tp.getTpId())).getBytes(Charset.forName("UTF-8"))) - .toString()); + sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", tp.getTpNodeId(), + TapiStringConstants.DSR, tp.getTpId())).getBytes(StandardCharsets.UTF_8)).toString()); LOG.info("DSR XPDR SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.DSR, tp.getTpId())); break; @@ -1281,11 +1337,11 @@ public final class ConnectivityUtils { LOG.info("Node of NEP id before Merge = {}", String.join("+", node, TapiStringConstants.PHTNC_MEDIA)); // Give uuids so that it is easier to look for things: topology uuid, node uuid, nep uuid, cep Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", node, TapiStringConstants.PHTNC_MEDIA) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", node, qual, spcRdmAD.split("\\+")[1]) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); this.tapiContext.updateTopologyWithCep(topoUuid, nodeUuid, nepUuid, cep); } @@ -1293,17 +1349,17 @@ public final class ConnectivityUtils { ConnectionEndPoint cep) { // Give uuids so that it is easier to look for things: topology uuid, node uuid, nep uuid, cep Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", node, nodeLayer) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(String.join("+", node, qual, spcXpdrNet.split("\\+")[1]) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); this.tapiContext.updateTopologyWithCep(topoUuid, nodeUuid, nepUuid, cep); } public Map + .onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.ConnectionKey, + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection> getConnectionFullMap() { return this.connectionFullMap; } @@ -1404,7 +1460,7 @@ public final class ConnectivityUtils { // It could be obtained from the SIP which has the NEP and includes all the OR name. Uuid sipUuid = endPoint.getServiceInterfacePoint().getServiceInterfacePointUuid(); // Todo -> need to find the NEP associated to that SIP - Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(nodeZid.getBytes(Charset.forName("UTF-8"))).toString()); + Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(nodeZid.getBytes(StandardCharsets.UTF_8)).toString()); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node = this.tapiContext.getTapiNode(this.tapiTopoUuid, nodeUuid); if (node == null) { @@ -1492,10 +1548,10 @@ public final class ConnectivityUtils { if (!serviceLayer.equals(LayerProtocolName.ETH)) { serviceZEndBuilder .setEthernetAttributes(new EthernetAttributesBuilder().setSubrateEthSla(new SubrateEthSlaBuilder() - .setCommittedBurstSize(Uint16.valueOf(64)) - .setCommittedInfoRate(Uint32.valueOf(100000)) - .build()) - .build()); + .setCommittedBurstSize(Uint16.valueOf(64)) + .setCommittedInfoRate(Uint32.valueOf(100000)) + .build()) + .build()); } return serviceZEndBuilder.build(); } @@ -1509,7 +1565,7 @@ public final class ConnectivityUtils { // It could be obtained from the SIP which has the NEP and includes all the OR name. Uuid sipUuid = endPoint.getServiceInterfacePoint().getServiceInterfacePointUuid(); // Todo -> need to find the NEP associated to that SIP - Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(nodeAid.getBytes(Charset.forName("UTF-8"))).toString()); + Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(nodeAid.getBytes(StandardCharsets.UTF_8)).toString()); org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node = this.tapiContext.getTapiNode(this.tapiTopoUuid, nodeUuid); if (node == null) { @@ -1552,11 +1608,11 @@ public final class ConnectivityUtils { .setServiceFormat(serviceFormat) .setServiceRate(Uint32.valueOf(capacity)) .setEthernetAttributes(new EthernetAttributesBuilder().setSubrateEthSla( - new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.subrate.eth - .sla.SubrateEthSlaBuilder() - .setCommittedBurstSize(Uint16.valueOf(64)) - .setCommittedInfoRate(Uint32.valueOf(100000)) - .build()) + new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.subrate.eth + .sla.SubrateEthSlaBuilder() + .setCommittedBurstSize(Uint16.valueOf(64)) + .setCommittedInfoRate(Uint32.valueOf(100000)) + .build()) .build()) .setTxDirection(Map.of(new TxDirectionKey(Uint8.ZERO), new TxDirectionBuilder() .setPort(new PortBuilder() @@ -1599,10 +1655,10 @@ public final class ConnectivityUtils { if (!serviceLayer.equals(LayerProtocolName.ETH)) { serviceAEndBuilder .setEthernetAttributes(new EthernetAttributesBuilder().setSubrateEthSla(new SubrateEthSlaBuilder() - .setCommittedBurstSize(Uint16.valueOf(64)) - .setCommittedInfoRate(Uint32.valueOf(100000)) - .build()) - .build()); + .setCommittedBurstSize(Uint16.valueOf(64)) + .setCommittedInfoRate(Uint32.valueOf(100000)) + .build()) + .build()); } return serviceAEndBuilder.build(); } @@ -1631,13 +1687,13 @@ public final class ConnectivityUtils { private ConnectionEndPoint getAssociatediODUCep(String spcXpdrNetwork) { Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", spcXpdrNetwork.split("\\+")[0], - TapiStringConstants.DSR).getBytes(Charset.forName("UTF-8")))).toString()); + TapiStringConstants.DSR).getBytes(StandardCharsets.UTF_8))).toString()); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", spcXpdrNetwork.split("\\+")[0], - TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1]).getBytes(Charset.forName("UTF-8")))) + TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1]).getBytes(StandardCharsets.UTF_8))) .toString()); Uuid cepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP", spcXpdrNetwork.split("\\+")[0], TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1])) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); return this.tapiContext.getTapiCEP(this.tapiTopoUuid, nodeUuid, nepUuid, cepUuid); } @@ -1686,7 +1742,7 @@ public final class ConnectivityUtils { List openroadmNodeTypeList = new ArrayList<>(); for (String xpdrNode:xpdrNodelist) { Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+",xpdrNode, TapiStringConstants.DSR)) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); InstanceIdentifier nodeIID = InstanceIdentifier.builder( Context.class).augmentation(org.opendaylight.yang.gen.v1.urn @@ -1717,4 +1773,4 @@ public final class ConnectivityUtils { } return openroadmNodeTypeList.get(0); } -} +} \ No newline at end of file