.collect(Collectors.toList());
if (!OpenroadmNodeType.TPDR.equals(this.ietfNodeType)) {
this.oorOduSwitchingPool = ietfNode.augmentation(Node1.class).getSwitchingPools().getOduSwitchingPools()
- .values().stream().findFirst().get();
+ .values().stream().findFirst().orElseThrow();
this.oorClientPortList = ietfNode.augmentation(
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
.getTerminationPoint().values().stream()
prunedTapiPhotonicNodes = new ArrayList<>();
List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node> tapiPhotonicNodes
= this.tapiNodes.values().stream()
- .filter(n -> LayerProtocolName.PHOTONICMEDIA.equals(n.getLayerProtocolName().stream().findFirst().get()))
+ .filter(n -> LayerProtocolName.PHOTONICMEDIA.equals(n.getLayerProtocolName().stream().findFirst()
+ .orElseThrow()))
.collect(Collectors.toList());
for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node
: tapiPhotonicNodes) {
String nodeUuid = node.getUuid().getValue();
String nepUuid = nep.getUuid().getValue();
String nodeName = node.getName().get(new NameKey("otsi node name")).getValue();
- String nepName = nep.getName().get(new NameKey(nep.getName().keySet().stream().findFirst().get()))
+ String nepName = nep.getName().get(new NameKey(nep.getName().keySet().stream().findFirst()
+ .orElseThrow()))
.getValue();
uuidNameMap.put(String.join("--", nodeUuid, nepUuid), String.join("--", nodeName, nepName));
}
.setUuid(nepUuid)
.setLayerProtocolName(LayerProtocolName.PHOTONICMEDIA)
.setName(Map.of(nepName.key(), nepName))
- .setSupportedCepLayerProtocolQualifier(Set.of(PHOTONICLAYERQUALIFIEROMS.class))
+ .setSupportedCepLayerProtocolQualifier(Set.of(PHOTONICLAYERQUALIFIEROMS.VALUE))
.setLinkPortDirection(PortDirection.BIDIRECTIONAL).setLinkPortRole(PortRole.SYMMETRIC)
.setAdministrativeState(AdministrativeState.UNLOCKED).setOperationalState(OperationalState.ENABLED)
.setLifecycleState(LifecycleState.INSTALLED).setTerminationDirection(TerminationDirection.BIDIRECTIONAL)
return msipl;
}
- private Set<Class<? extends LAYERPROTOCOLQUALIFIER>>
+ private Set<LAYERPROTOCOLQUALIFIER>
createSupportedCepLayerProtocolQualifier(TerminationPoint tp, LayerProtocolName lpn) {
- Set<Class<? extends LAYERPROTOCOLQUALIFIER>> sclpqSet = new HashSet<>();
+ Set<LAYERPROTOCOLQUALIFIER> sclpqSet = new HashSet<>();
Collection<SupportedInterfaceCapability> sicList = tp.augmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.TerminationPoint1.class)
.getTpSupportedInterfaces()
.getSupportedInterfaceCapability().values();
for (SupportedInterfaceCapability sic : sicList) {
+ String ifCapType = sic.getIfCapType().toString().split("\\{")[0];
switch (lpn.getName()) {
case "DSR":
- switch (sic.getIfCapType().getSimpleName()) {
+ switch (ifCapType) {
case "If10GEODU2e":
- sclpqSet.add(ODUTYPEODU2E.class);
- sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.class);
+ sclpqSet.add(ODUTYPEODU2E.VALUE);
+ sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.VALUE);
break;
case "If10GEODU2":
- sclpqSet.add(ODUTYPEODU2.class);
- sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.class);
+ sclpqSet.add(ODUTYPEODU2.VALUE);
+ sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.VALUE);
break;
case "If10GE":
- sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.class);
+ sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.VALUE);
break;
case "If100GEODU4":
- sclpqSet.add(DIGITALSIGNALTYPE100GigE.class);
- sclpqSet.add(ODUTYPEODU4.class);
+ sclpqSet.add(DIGITALSIGNALTYPE100GigE.VALUE);
+ sclpqSet.add(ODUTYPEODU4.VALUE);
break;
case "If100GE":
- sclpqSet.add(DIGITALSIGNALTYPE100GigE.class);
+ sclpqSet.add(DIGITALSIGNALTYPE100GigE.VALUE);
break;
case "IfOCHOTU4ODU4":
case "IfOCH":
- sclpqSet.add(ODUTYPEODU4.class);
+ sclpqSet.add(ODUTYPEODU4.VALUE);
break;
default:
LOG.error("IfCapability type not managed");
}
break;
case "PHOTONIC_MEDIA":
- if (sic.getIfCapType().getSimpleName().equals("IfOCHOTU4ODU4")
- || sic.getIfCapType().getSimpleName().equals("IfOCH")) {
- sclpqSet.add(PHOTONICLAYERQUALIFIEROTSi.class);
- sclpqSet.add(PHOTONICLAYERQUALIFIEROMS.class);
+ if (ifCapType.equals("IfOCHOTU4ODU4") || ifCapType.equals("IfOCH")) {
+ sclpqSet.add(PHOTONICLAYERQUALIFIEROTSi.VALUE);
+ sclpqSet.add(PHOTONICLAYERQUALIFIEROMS.VALUE);
}
break;
default: