- ForkJoinTask forkJoinTask = forkJoinPool.submit(() ->
- nodes.parallelStream().forEach(node -> {
- String nodeId = node.getNodeId();
- LOG.info("Starting provisioning for node : {}", nodeId);
- List<String> createdEthInterfaces = new ArrayList<>();
- List<String> createdOtuInterfaces = new ArrayList<>();
- List<String> createdOduInterfaces = new ArrayList<>();
- List<String> createdOchInterfaces = new ArrayList<>();
- List<String> createdConnections = new ArrayList<>();
- int crossConnectFlag = 0;
-
- try {
- // if the node is currently mounted then proceed
- if (this.deviceTransactionManager.isDeviceMounted(nodeId)) {
- String srcTp = node.getSrcTp();
- String destTp = node.getDestTp();
-
- Long waveNumber = input.getWaveNumber();
- if ((destTp != null) && destTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
- crossConnectFlag++;
- // create OpenRoadm Xponder Line Interfaces
- String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, destTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
- createdOchInterfaces.add(supportingOchInterface);
-
- String supportingOtuInterface = this.openRoadmInterfaceFactory.createOpenRoadmOtu4Interface(
- nodeId, destTp, supportingOchInterface);
- createdOtuInterfaces.add(supportingOtuInterface);
-
- createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(
- nodeId, destTp,supportingOtuInterface));
- }
- if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
- crossConnectFlag++;
- // create OpenRoadm Xponder Client Interfaces
- createdEthInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId,
- srcTp));
-
-
- }
- if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
- crossConnectFlag++;
- // create OpenRoadm Xponder Line Interfaces
- String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, srcTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
- createdOchInterfaces.add(supportingOchInterface);
-
- String supportingOtuInterface = this.openRoadmInterfaceFactory.createOpenRoadmOtu4Interface(
- nodeId, srcTp, supportingOchInterface);
- createdOtuInterfaces.add(supportingOtuInterface);
-
- createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(
- nodeId, srcTp, supportingOtuInterface));
- }
- if ((destTp != null) && destTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
- crossConnectFlag++;
- // create OpenRoadm Xponder Client Interfaces
- createdEthInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId,
- destTp));
-
-
- }
- if ((srcTp != null) && (srcTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
- || srcTp.contains(OpenRoadmInterfacesImpl.PP_TOKEN))) {
- createdOchInterfaces.add(this.openRoadmInterfaceFactory .createOpenRoadmOchInterface(nodeId,
- srcTp, waveNumber));
- }
- if ((destTp != null) && (destTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN)
- || destTp.contains(OpenRoadmInterfacesImpl.PP_TOKEN))) {
- createdOchInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(nodeId,
- destTp, waveNumber));
- }
- if (crossConnectFlag < 1) {
- LOG.info("Creating cross connect between source {} and destination {} for node {}",
- srcTp, destTp, nodeId);
- Optional<String> connectionNameOpt = this.crossConnect.postCrossConnect(nodeId, waveNumber,
- srcTp, destTp);
- if (connectionNameOpt.isPresent()) {
- nodesProvisioned.add(nodeId);
- List<Ports> ports = this.crossConnect.getConnectionPortTrail(nodeId, waveNumber, srcTp,
- destTp);
- if (ServicePathDirection.A_TO_Z.equals(direction)) {
- topology.updateAtoZTopologyList(ports, nodeId);
- }
- if (ServicePathDirection.Z_TO_A.equals(direction)) {
- topology.updateZtoATopologyList(ports, nodeId);
-
- }
- createdConnections.add(connectionNameOpt.get());
- } else {
- processErrorMessage("Unable to post Roadm-connection for node " + nodeId, forkJoinPool,
- results);
- success.set(false);
- }
+ ForkJoinTask forkJoinTask = forkJoinPool.submit(() -> nodes.parallelStream().forEach(node -> {
+ String nodeId = node.getNodeId();
+ LOG.info("Starting provisioning for node : {}", nodeId);
+ List<String> createdEthInterfaces = new ArrayList<>();
+ List<String> createdOtuInterfaces = new ArrayList<>();
+ List<String> createdOduInterfaces = new ArrayList<>();
+ List<String> createdOchInterfaces = new ArrayList<>();
+ List<String> createdConnections = new ArrayList<>();
+ int crossConnectFlag = 0;
+ try {
+ // if the node is currently mounted then proceed
+ if (this.deviceTransactionManager.isDeviceMounted(nodeId)) {
+ String srcTp = node.getSrcTp();
+ String destTp = node.getDestTp();
+ Long waveNumber = input.getWaveNumber();
+ if ((destTp != null) && destTp.contains(StringConstants.NETWORK_TOKEN)) {
+ crossConnectFlag++;
+ // create OpenRoadm Xponder Line Interfaces
+ String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
+ nodeId, destTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
+ createdOchInterfaces.add(supportingOchInterface);
+ String supportingOtuInterface = this.openRoadmInterfaceFactory
+ .createOpenRoadmOtu4Interface(nodeId, destTp, supportingOchInterface);
+ createdOtuInterfaces.add(supportingOtuInterface);
+ createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
+ destTp, supportingOtuInterface));
+ }
+ if ((srcTp != null) && srcTp.contains(StringConstants.CLIENT_TOKEN)) {
+ crossConnectFlag++;
+ // create OpenRoadm Xponder Client Interfaces
+ createdEthInterfaces.add(
+ this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, srcTp));
+ }
+ if ((srcTp != null) && srcTp.contains(StringConstants.NETWORK_TOKEN)) {
+ crossConnectFlag++;
+ // create OpenRoadm Xponder Line Interfaces
+ String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
+ nodeId, srcTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
+ createdOchInterfaces.add(supportingOchInterface);
+ String supportingOtuInterface = this.openRoadmInterfaceFactory
+ .createOpenRoadmOtu4Interface(nodeId, srcTp, supportingOchInterface);
+ createdOtuInterfaces.add(supportingOtuInterface);
+ createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
+ srcTp, supportingOtuInterface));
+ }
+ if ((destTp != null) && destTp.contains(StringConstants.CLIENT_TOKEN)) {
+ crossConnectFlag++;
+ // create OpenRoadm Xponder Client Interfaces
+ createdEthInterfaces.add(
+ this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId, destTp));
+ }
+ if ((srcTp != null) && (srcTp.contains(StringConstants.TTP_TOKEN)
+ || srcTp.contains(StringConstants.PP_TOKEN))) {
+ createdOchInterfaces.addAll(
+ this.openRoadmInterfaceFactory
+ .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber));
+ }
+ if ((destTp != null) && (destTp.contains(StringConstants.TTP_TOKEN)
+ || destTp.contains(StringConstants.PP_TOKEN))) {
+ createdOchInterfaces.addAll(
+ this.openRoadmInterfaceFactory
+ .createOpenRoadmOchInterface(nodeId, destTp, waveNumber));
+ }
+ if (crossConnectFlag < 1) {
+ LOG.info("Creating cross connect between source {} and destination {} for node {}", srcTp,
+ destTp, nodeId);
+ Optional<String> connectionNameOpt =
+ this.crossConnect.postCrossConnect(nodeId, waveNumber, srcTp, destTp);
+ if (connectionNameOpt.isPresent()) {
+ nodesProvisioned.add(nodeId);
+ createdConnections.add(connectionNameOpt.get());
+ } else {
+ processErrorMessage("Unable to post Roadm-connection for node " + nodeId, forkJoinPool,
+ results);
+ success.set(false);