- if (checkTpForOdtuTermination(ontTp1)) {
- LOG.info("TP {} of XPONDER {} is validated", tp.getTpId(), node.getNodeId().getValue());
- this.availableXpdrNWTps.add(tp.getTpId());
- } else {
- LOG.error("TP {} of {} does not allow ODU4 termination creation", tp.getTpId().getValue(),
- node.getNodeId().getValue());
- }
- } else if (OpenroadmTpType.XPONDERNETWORK.equals(ocnTp1.getTpType())
- && (this.otnServiceType.equals("10GE") || this.otnServiceType.equals("1GE"))) {
- TerminationPoint1 ontTp1;
- if (tp.augmentation(TerminationPoint1.class) != null) {
- ontTp1 = tp.augmentation(TerminationPoint1.class);
- } else {
- continue;
- }
- if ("10GE".equals(otnServiceType) && checkOdtuTTPforLoOduCreation(ontTp1, 10)
- || "1GE".equals(otnServiceType) && checkOdtuTTPforLoOduCreation(ontTp1, 1)) {
- LOG.info("TP {} of XPONDER {} is validated", tp.getTpId(), node.getNodeId().getValue());
- this.availableXpdrNWTps.add(tp.getTpId());
- } else {
- if ("10GE".equals(otnServiceType)) {
- LOG.error("TP {} of {} does not allow OD2e termination creation", tp.getTpId().getValue(),
- node.getNodeId().getValue());
- } else if ("1GE".equals(otnServiceType)) {
- LOG.error("TP {} of {} does not allow ODU0 termination creation", tp.getTpId().getValue(),
- node.getNodeId().getValue());
- } else {
- LOG.error("TP {} of {} does not allow any termination creation", tp.getTpId().getValue(),
- node.getNodeId().getValue());
- }
+ switch (this.otnServiceType) {
+ case StringConstants.SERVICE_TYPE_100GE_S:
+ // TODO verify the capability of network port to support ODU4 CTP interface creation
+ 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());
+ continue;