- if (("100GE".equals(serviceType)) || ("OTU4".equals(serviceType))) {
- // 100GE or OTU4 services are handled at WDM Layer
- PceLink pcelink = new PceLink(link, source, dest);
- if (!pcelink.isValid()) {
- dropOppositeLink(link);
- LOG.error(" validateLink: Link is ignored due errors in network data or in opposite link");
- return false;
- }
- LinkId linkId = pcelink.getLinkId();
- if (validateLinkConstraints(pcelink).equals(ConstraintTypes.HARD_EXCLUDE)) {
- dropOppositeLink(link);
- LOG.debug("validateLink: constraints : link is ignored == {}", linkId.getValue());
- return false;
- }
- switch (pcelink.getlinkType()) {
- case ROADMTOROADM:
- case EXPRESSLINK:
- allPceLinks.put(linkId, pcelink);
- source.addOutgoingLink(pcelink);
- LOG.debug("validateLink: {}-LINK added to allPceLinks {}",
- pcelink.getlinkType(), pcelink);
- break;
- case ADDLINK:
- pcelink.setClient(source.getRdmSrgClient(pcelink.getSourceTP().toString()));
- addLinks.add(pcelink);
- LOG.debug("validateLink: ADD-LINK saved {}", pcelink);
- break;
- case DROPLINK:
- pcelink.setClient(dest.getRdmSrgClient(pcelink.getDestTP().toString()));
- dropLinks.add(pcelink);
- LOG.debug("validateLink: DROP-LINK saved {}", pcelink);
- break;
- case XPONDERINPUT:
- // store separately all SRG links directly
- azSrgs.add(sourceId);
- // connected to A/Z
- if (!dest.checkTP(pcelink.getDestTP().toString())) {
- LOG.debug(
- "validateLink: XPONDER-INPUT is rejected as NW port is busy - {} ", pcelink);
- return false;
- }
- if (dest.getXpdrClient(pcelink.getDestTP().toString()) != null) {
- pcelink.setClient(dest.getXpdrClient(pcelink.getDestTP().toString()));
- }
- allPceLinks.put(linkId, pcelink);
- source.addOutgoingLink(pcelink);
- LOG.debug("validateLink: XPONDER-INPUT link added to allPceLinks {}", pcelink);
- break;
- // does it mean XPONDER==>>SRG ?
- case XPONDEROUTPUT:
- // store separately all SRG links directly
- azSrgs.add(destId);
- // connected to A/Z
- if (!source.checkTP(pcelink.getSourceTP().toString())) {
- LOG.debug(
- "validateLink: XPONDER-OUTPUT is rejected as NW port is busy - {} ", pcelink);
- return false;
- }
- if (source.getXpdrClient(pcelink.getSourceTP().toString()) != null) {
- pcelink.setClient(source.getXpdrClient(pcelink.getSourceTP().toString()));
- }
- allPceLinks.put(linkId, pcelink);
- source.addOutgoingLink(pcelink);
- LOG.debug("validateLink: XPONDER-OUTPUT link added to allPceLinks {}", pcelink);
- break;
- default:
- LOG.warn("validateLink: link type is not supported {}", pcelink);
- }
- return true;
-
- } else if (("ODU4".equals(serviceType)) || ("10GE".equals(serviceType)) || ("1GE".equals(serviceType))) {
- // ODU4, 1GE and 10GE services relying on ODU2, ODU2e or ODU0 services are handled at OTN layer
- PceLink pceOtnLink = new PceLink(link, source, dest);
-
- if (!pceOtnLink.isOtnValid(link, serviceType)) {
- dropOppositeLink(link);
- LOG.error(" validateLink: Link is ignored due errors in network data or in opposite link");
- return false;
- }
-
- LinkId linkId = pceOtnLink.getLinkId();
- if (validateLinkConstraints(pceOtnLink).equals(ConstraintTypes.HARD_EXCLUDE)) {
- dropOppositeLink(link);
- LOG.debug("validateLink: constraints : link is ignored == {}", linkId.getValue());
- return false;
- }
-
- switch (pceOtnLink.getlinkType()) {
- case OTNLINK:
- if (dest.getXpdrClient(pceOtnLink.getDestTP().toString()) != null) {
- pceOtnLink.setClient(dest.getXpdrClient(pceOtnLink.getDestTP().toString()));
- }
-
- allPceLinks.put(linkId, pceOtnLink);
- source.addOutgoingLink(pceOtnLink);
- LOG.info("validateLink: OTN-LINK added to allPceLinks {}", pceOtnLink);
- break;
- default:
- LOG.warn("validateLink: link type is not supported {}", pceOtnLink);
- }
- return true;
-
- } else {
- LOG.error(" validateLink: Unmanaged service type {}", serviceType);