- private void createOduc4TtpInterface(OtnServicePathInput input, List<NodeInterface> nodeInterfaces,
- CopyOnWriteArrayList<LinkTp> linkTpList) throws OpenRoadmInterfaceException {
- if (input.getNodes() == null) {
- return;
- }
- LOG.info("Creation of ODUC4 TTP interface in OTN service path {}", input);
- for (int i = 0; i < input.getNodes().size(); i++) {
- Nodes node = input.getNodes().get(i);
- String supportingOtuInterface = node.getNetworkTp() + "-OTUC4";
-
- Nodes tgtNode =
- i + 1 == input.getNodes().size()
- // For the end node, tgtNode becomes the first node in the list
- ? input.getNodes().get(0)
- : input.getNodes().get(i + 1);
+ private void createHighOrderInterfaces(OtnServicePathInput input, List<NodeInterface> nodeInterfaces,
+ CopyOnWriteArrayList<LinkTp> linkTpList) throws OpenRoadmInterfaceException {
+ for (Nodes node : input.nonnullNodes()) {
+ AEndApiInfo apiInfoA = null;
+ ZEndApiInfo apiInfoZ = null;
+ if (input.getAEndApiInfo() != null && input.getAEndApiInfo().getNodeId().contains(node.getNodeId())) {
+ apiInfoA = input.getAEndApiInfo();
+ }
+ if (input.getZEndApiInfo() != null && input.getZEndApiInfo().getNodeId().contains(node.getNodeId())) {
+ apiInfoZ = input.getZEndApiInfo();
+ }
+ // check if the node is mounted or not?
+ Set<String> createdEthInterfaces = new HashSet<>();
+ Set<String> createdOduInterfaces = new HashSet<>();
+ switch (input.getServiceRate().intValue()) {
+ case 100:
+ LOG.info("Input service is 100G");
+ if (node.getClientTp() != null && node.getNetwork2Tp() == null) {
+ createdEthInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmEth100GInterface(
+ node.getNodeId(), node.getClientTp()));
+ createdOduInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmOdu4HOInterface(
+ node.getNodeId(), node.getClientTp(), false, apiInfoA, apiInfoZ, "21"));
+ // supporting interface? payload ?
+ createdOduInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmOdu4HOInterface(
+ node.getNodeId(), node.getNetworkTp(), true, null, null, null));
+ linkTpList.add(new LinkTpBuilder().setNodeId(node.getNodeId()).setTpId(node.getClientTp())
+ .build());
+ }
+ if (node.getClientTp() == null && node.getNetwork2Tp() == null) {
+ createdOduInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmOdu4HOInterface(
+ node.getNodeId(), node.getNetworkTp(), false, apiInfoA, apiInfoZ, "21"));
+ linkTpList.add(new LinkTpBuilder().setNodeId(node.getNodeId()).setTpId(node.getNetworkTp())
+ .build());
+ }
+ if (node.getClientTp() == null && node.getNetwork2Tp() != null) {
+ // supporting interface? payload ?
+ createdOduInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmOdu4HOInterface(
+ node.getNodeId(), node.getNetworkTp(), true, null, null, null));
+ createdOduInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmOdu4HOInterface(
+ node.getNodeId(), node.getNetwork2Tp(), true, null, null, null));
+ }
+ break;
+ default:
+ LOG.error("service rate {} not managed yet", input.getServiceRate());
+ return;
+ }