ServiceListTopology topology = new ServiceListTopology();
AtomicBoolean success = new AtomicBoolean(true);
ForkJoinPool forkJoinPool = new ForkJoinPool();
+
ForkJoinTask forkJoinTask = forkJoinPool.submit(() -> nodes.parallelStream().forEach(node -> {
String nodeId = node.getNodeId();
+ // take the index of the node
+ int nodeIndex = nodes.indexOf(node);
LOG.info("Starting provisioning for node : {}", nodeId);
List<String> createdEthInterfaces = new ArrayList<>();
List<String> createdOtuInterfaces = new ArrayList<>();
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
nodeId, destTp, waveNumber, ModulationFormat.DpQpsk);
createdOchInterfaces.add(supportingOchInterface);
+ // Here we pass logical connection-point of z-end to set SAPI and DAPI
+ Nodes tgtNode = null;
+ if (nodeIndex + 1 == nodes.size()) {
+ // For the end node, tgtNode becomes the first node in the list
+ tgtNode = nodes.get(0);
+ } else {
+ tgtNode = nodes.get(nodeIndex + 1);
+ }
+ // tgtNode srcTp is null in this if cond
String supportingOtuInterface = this.openRoadmInterfaceFactory
- .createOpenRoadmOtu4Interface(nodeId, destTp, supportingOchInterface);
+ .createOpenRoadmOtu4Interface(nodeId, destTp, supportingOchInterface,
+ tgtNode.getNodeId(), tgtNode.getDestTp());
createdOtuInterfaces.add(supportingOtuInterface);
if (srcTp == null) {
otnNodesProvisioned.add(node);