- private void createTapiTransitionalLinks() {
- for (TerminationPoint tp : this.oorNetworkPortList) {
- Link transiLink = tapiLink.createTapiLink(this.ietfNodeId, tp.getTpId().getValue(), this.ietfNodeId,
- tp.getTpId().getValue(), TapiStringConstants.TRANSITIONAL_LINK, TapiStringConstants.DSR,
- TapiStringConstants.OTSI, TapiStringConstants.I_ODU, TapiStringConstants.I_OTSI,
- "inService", "inService", Set.of(LayerProtocolName.ODU, LayerProtocolName.PHOTONICMEDIA),
- Set.of(LayerProtocolName.ODU.getName(), LayerProtocolName.PHOTONICMEDIA.getName()),
- this.tapiTopoUuid);
- this.tapiLinks.put(transiLink.key(), transiLink);
+ private List<SupportedCepLayerProtocolQualifierInstances> createSupportedLayerProtocolQualifier(TerminationPoint tp,
+ LayerProtocolName lpn) {
+ List<SupportedCepLayerProtocolQualifierInstances> sclpqiList = new ArrayList<>();
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(PHOTONICLAYERQUALIFIEROMS.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(1))
+ .build());
+ org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526.TerminationPoint1 tp1 =
+ tp.augmentation(org.opendaylight.yang.gen.v1.http
+ .org.openroadm.otn.network.topology.rev230526.TerminationPoint1.class);
+ if (tp1 == null) {
+ return new ArrayList<>(sclpqiList);
+ }
+ if (tp1.getTpSupportedInterfaces() == null) {
+ LOG.warn("Tp supported interface doesnt exist on TP {}", tp.getTpId().getValue());
+ return new ArrayList<>(sclpqiList);
+ }
+ Collection<SupportedInterfaceCapability> sicList = tp1.getTpSupportedInterfaces()
+ .getSupportedInterfaceCapability().values();
+ for (SupportedInterfaceCapability sic : sicList) {
+ String ifCapType = sic.getIfCapType().toString().split("\\{")[0];
+ switch (lpn.getName()) {
+ case "DSR":
+ switch (ifCapType) {
+ // TODO: it may be needed to add more cases clauses if the interface capabilities of a
+ // port are extended in the config file
+ case "If1GEODU0":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU0.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(DIGITALSIGNALTYPEGigE.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If10GEODU2e":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU2E.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(DIGITALSIGNALTYPE10GigELAN.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If10GEODU2":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU2.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(DIGITALSIGNALTYPE10GigELAN.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If10GE":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(DIGITALSIGNALTYPE10GigELAN.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If100GEODU4":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(DIGITALSIGNALTYPE100GigE.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU4.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If100GE":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(DIGITALSIGNALTYPE100GigE.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "IfOCHOTU4ODU4":
+ case "IfOCH":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU4.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ default:
+ LOG.error("IfCapability type not managed");
+ break;
+ }
+ break;
+ case "ODU":
+ switch (ifCapType) {
+ // TODO: it may be needed to add more cases clauses if the interface capabilities of a
+ // port are extended in the config file
+ case "If1GEODU0":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU0.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If10GEODU2e":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU2E.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If10GEODU2":
+ case "If10GE":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU2.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ case "If100GEODU4":
+ case "If100GE":
+ case "IfOCHOTU4ODU4":
+ case "IfOCH":
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(ODUTYPEODU4.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ break;
+ default:
+ LOG.error("IfCapability type not managed");
+ break;
+ }
+ break;
+ case "PHOTONIC_MEDIA":
+ if (ifCapType.equals("IfOCHOTU4ODU4") || ifCapType.equals("IfOCH")) {
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(PHOTONICLAYERQUALIFIEROTSiMC.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ sclpqiList.add(new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setLayerProtocolQualifier(PHOTONICLAYERQUALIFIEROMS.VALUE)
+ .setNumberOfCepInstances(Uint64.valueOf(0))
+ .build());
+ }
+ break;
+ default:
+ LOG.error("Layer Protocol Name is unknown");
+ break;
+ }