+ }
+ Map<NodeKey, org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node>
+ tapiNodeList = new HashMap<>();
+ Map<LinkKey, org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Link>
+ tapiLinkList = new HashMap<>();
+ Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(T0_MULTI_LAYER_TOPO.getBytes(Charset.forName("UTF-8")))
+ .toString());
+ ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topoUuid);
+ Iterator<Entry<String, List<String>>> it = networkPortMap.entrySet().iterator();
+ while (it.hasNext()) {
+ String nodeId = it.next().getKey();
+ tapiFactory.convertNode(otnNodeMap.get(new NodeId(nodeId)), networkPortMap.get(nodeId));
+ tapiNodeList.putAll(tapiFactory.getTapiNodes());
+ tapiLinkList.putAll(tapiFactory.getTapiLinks());
+ }
+ if (openroadmTopo.nonnullNode().values().stream().filter(nt ->
+ nt.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Node1.class)
+ .getNodeType().equals(OpenroadmNodeType.SRG)).count() > 0) {
+ tapiFactory.convertRoadmInfrastructure();
+ tapiNodeList.putAll(tapiFactory.getTapiNodes());
+ tapiLinkList.putAll(tapiFactory.getTapiLinks());
+ } else {
+ LOG.warn("Unable to abstract an ROADM infrasctructure from openroadm-topology");
+ }
+ if (otnTopo.augmentation(Network1.class) != null) {
+ List<Link> otnLinkList = new ArrayList<>(otnTopo.augmentation(Network1.class).getLink().values());
+ Collections.sort(otnLinkList, (l1, l2) -> l1.getLinkId().getValue()
+ .compareTo(l2.getLinkId().getValue()));
+ tapiFactory.convertLinks(otnLinkList);
+ tapiLinkList.putAll(tapiFactory.getTapiLinks());
+ }
+ Name name = new NameBuilder().setValue(T0_MULTI_LAYER_TOPO).setValueName("TAPI Topology Name").build();
+ return new TopologyBuilder()
+ .setName(Map.of(name.key(), name))