- linkTerminations.add(atermination);
- linkTerminations.add(ztermination);
-
- List<Link> supportedOdu4Links = getSupportingOdu4Links(linkTerminations, serviceRate);
+ List<Link> supportedOdu4Links = null;
+ if (notifLink != null) {
+ // retreive termination-points to be updated
+ linkTerminations.add(new LinkTpBuilder()
+ .setNodeId(notifLink.getATermination().getNodeId())
+ .setTpId(notifLink.getATermination().getTpId())
+ .build());
+ linkTerminations.add(new LinkTpBuilder()
+ .setNodeId(notifLink.getZTermination().getNodeId())
+ .setTpId(notifLink.getZTermination().getTpId())
+ .build());
+ // retreive supported links
+ supportedOdu4Links = getSupportingOdu4Links(linkTerminations, serviceRate);
+ } else if (suppLinks != null) {
+ // retreive supported links
+ List<LinkId> linkIdList = new ArrayList<>();
+ if (suppLinks != null) {
+ suppLinks.forEach(lk -> linkIdList.add(new LinkId(lk)));
+ }
+ supportedOdu4Links = getOtnLinks(linkIdList);
+ // retreive termination-points to be updated
+ for (Link link : supportedOdu4Links) {
+ LinkTp atermination = new LinkTpBuilder()
+ .setNodeId(link.getSource().getSourceNode().getValue())
+ .setTpId(link.getSource().getSourceTp().getValue())
+ .build();
+ linkTerminations.add(atermination);
+ }
+ } else {
+ LOG.error("Impossible to update OTN links and their associated termination points in otn-topology");
+ return;
+ }