- || SERVICE_TYPE_ETH_TS_NB_MAP.containsKey(this.otnServiceType)
- && isAzOrIntermediateAvl(mode, null, availableXpdrClientTps, availableXpdrNWTps)
- || StringConstants.SERVICE_TYPE_100GE_S.equals(this.otnServiceType)
- && isAzOrIntermediateAvl(mode, availableXpdrClientTps, availableXpdrClientTps, availableXpdrNWTps);
- //TODO very similar to isOtnServiceTypeValid method
- // check whether the different treatment for SERVICE_TYPE_100GE_S here is appropriate or not
+ || SERVICE_TYPE_ETH_CLASS_MAP.containsKey(this.otnServiceType)
+ && isAzOrIntermediateAvl(availableXpdrClientTps, availableXpdrNWTps,
+ StringConstants.SERVICE_TYPE_100GE_S.equals(this.otnServiceType)
+ ? availableXpdrClientTps
+ : null);
+ //TODO check whether it makes sense to pass twice availableXpdrClientTps tp isAzOrIntermediateAvl
+ // and to differentiate SERVICE_TYPE_100GE_S case
+ // better pass otnServiceType -> this should probably be refactored
+ }
+
+ private boolean isAzOrIntermediateAvl(List<TpId> clientTps, List<TpId> netwTps, List<TpId> clientTps0) {
+ switch (modeType) {
+ case "intermediate":
+ return checkSwPool(clientTps0, netwTps, 0, 2);
+
+ case "AZ":
+ return checkSwPool(clientTps, netwTps, 1, 1);
+
+ default:
+ LOG.error("unknown mode type {}", modeType);
+ return false;
+ }