-
- for (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network
- .node.TerminationPoint tp : allTps) {
- org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.@Nullable TerminationPoint1 ocnTp1
- = tp.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529
- .TerminationPoint1.class);
- //TODO many nested if-structures below, this needs to be reworked
- if (OpenroadmTpType.XPONDERNETWORK.equals(ocnTp1.getTpType())) {
- TerminationPoint1 ontTp1;
- if (tp.augmentation(TerminationPoint1.class) != null) {
- ontTp1 = tp.augmentation(TerminationPoint1.class);
- } else {
- continue;
- }
- switch (this.otnServiceType) {
- case StringConstants.SERVICE_TYPE_ODU4:
- case StringConstants.SERVICE_TYPE_ODUC4:
- if (!checkTpForOdtuTermination(ontTp1)) {
- LOG.error("TP {} of {} does not allow ODU4 termination creation",
- tp.getTpId().getValue(), node.getNodeId().getValue());
- continue;
- }
- break;
-
- case StringConstants.SERVICE_TYPE_10GE:
- if (!checkOdtuTTPforLoOduCreation(ontTp1, 10)) {
- LOG.error("TP {} of {} does not allow OD2e termination creation",
- tp.getTpId().getValue(), node.getNodeId().getValue());
- continue;
- }
- break;
- case StringConstants.SERVICE_TYPE_100GE_M:
- if (!checkOdtuTTPforLoOduCreation(ontTp1, 20)) {
- LOG.error("TP {} of {} does not allow ODU4 termination creation",
- tp.getTpId().getValue(), node.getNodeId().getValue());
- continue;
- }
- break;
- case StringConstants.SERVICE_TYPE_1GE:
- if (!checkOdtuTTPforLoOduCreation(ontTp1, 1)) {
- LOG.error("TP {} of {} does not allow ODU0 termination creation",
- tp.getTpId().getValue(), node.getNodeId().getValue());
- continue;
- }
- break;
-
- default:
- LOG.error("TP {} of {} does not allow any termination creation",
- tp.getTpId().getValue(), node.getNodeId().getValue());
+ for (TerminationPoint tp : allTps) {
+ org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210
+ .TerminationPoint1 ocnTp1
+ = tp.augmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210
+ .TerminationPoint1.class);
+ if (ocnTp1 == null) {
+ LOG.warn("null ocn TP {}", tp);
+ continue;
+ }
+ TerminationPoint1 ontTp1 = tp.augmentation(TerminationPoint1.class);
+ if (ontTp1 == null) {
+ continue;
+ }
+ //TODO many nested structures below, this needs to be reworked
+ switch (ocnTp1.getTpType()) {
+ case XPONDERNETWORK:
+ String notCreatedServiceType = xpdrNetTpCreation(ontTp1);
+ if (notCreatedServiceType == null) {
+ LOG.info("TP {} of XPONDER {} is validated",
+ tp.getTpId().getValue(),
+ node.getNodeId().getValue());
+ this.availableXpdrNWTps.add(tp.getTpId());
+ } else {
+ LOG.error("TP {} of {} does not allow {} termination creation",
+ tp.getTpId().getValue(),
+ node.getNodeId().getValue(),
+ notCreatedServiceType);
+ }
+ break;
+ case XPONDERCLIENT:
+ if (!SERVICE_TYPE_ETH_CLASS_MAP.containsKey(this.otnServiceType)) {