- 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()
+ .orElseThrow();
+ 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_OTS);
+ putRdmCepInTopologyContext(roadm, spcRdmAD, TapiStringConstants.PHTNC_MEDIA_OTS, 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().orElseThrow();
+ LOG.info("Degree port of ROADm {} = {}", roadm, spcRdmDEG);
+
+ ConnectionEndPoint degCep0 = createCepRoadm(spcRdmDEG, TapiStringConstants.PHTNC_MEDIA_OTS);
+ putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.PHTNC_MEDIA_OTS, degCep0);
+ ConnectionEndPoint degCep1 = createCepRoadm(spcRdmDEG, TapiStringConstants.PHTNC_MEDIA_OMS);
+ putRdmCepInTopologyContext(roadm, spcRdmDEG, TapiStringConstants.PHTNC_MEDIA_OMS, 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(degCep0.key(), degCep0);
+ 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.rev221121.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.rev221121.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().orElseThrow();
+ LOG.info("Degree 1 port of ROADm {} = {}", roadm, spcRdmDEG1);
+
+ ConnectionEndPoint deg1Cep0 = createCepRoadm(spcRdmDEG1, TapiStringConstants.PHTNC_MEDIA_OTS);
+ putRdmCepInTopologyContext(roadm, spcRdmDEG1, TapiStringConstants.PHTNC_MEDIA_OTS, deg1Cep0);
+ ConnectionEndPoint deg1Cep1 = createCepRoadm(spcRdmDEG1, TapiStringConstants.PHTNC_MEDIA_OMS);
+ putRdmCepInTopologyContext(roadm, spcRdmDEG1, TapiStringConstants.PHTNC_MEDIA_OMS, 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(deg1Cep0.key(), deg1Cep0);
+ 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()
+ .orElseThrow();
+ LOG.info("Degree 2 port of ROADm {} = {}", roadm, spcRdmDEG2);
+
+ ConnectionEndPoint deg2Cep0 = createCepRoadm(spcRdmDEG2, TapiStringConstants.PHTNC_MEDIA_OTS);
+ putRdmCepInTopologyContext(roadm, spcRdmDEG2, TapiStringConstants.PHTNC_MEDIA_OTS, deg2Cep0);
+ ConnectionEndPoint deg2Cep1 = createCepRoadm(spcRdmDEG2, TapiStringConstants.PHTNC_MEDIA_OMS);
+ putRdmCepInTopologyContext(roadm, spcRdmDEG2, TapiStringConstants.PHTNC_MEDIA_OMS, 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(deg2Cep0.key(), deg2Cep0);
+ 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.rev221121.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.rev221121.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);