- private OduSwitchingPools createTpdrSwitchPool() {
- return new OduSwitchingPoolsBuilder().build();
+ private OduSwitchingPools createTpdrSwitchPool(List<Mapping> xpdrNetMaps) {
+ Map<NonBlockingListKey, NonBlockingList> nblMap = new HashMap<>();
+ int count = 1;
+ for (int i = 1; i <= xpdrNetMaps.size(); i++) {
+ LOG.info("XPDr net LCP = {}", xpdrNetMaps.get(i - 1).getLogicalConnectionPoint());
+ LOG.info("XPDr net associated LCP = {}", xpdrNetMaps.get(i - 1).getConnectionMapLcp());
+ TpId tpid1 = new TpId(xpdrNetMaps.get(i - 1).getLogicalConnectionPoint());
+ TpId tpid2 = new TpId(xpdrNetMaps.get(i - 1).getConnectionMapLcp());
+ List<TpId> tpList = new ArrayList<>();
+ tpList.add(tpid1);
+ tpList.add(tpid2);
+ NonBlockingList nbl = new NonBlockingListBuilder()
+ .setNblNumber(Uint16.valueOf(count))
+ .setTpList(tpList)
+ .build();
+ nblMap.put(nbl.key(), nbl);
+ count++;
+ }
+ return new OduSwitchingPoolsBuilder()
+ .setNonBlockingList(nblMap)
+ .setSwitchingPoolNumber(Uint16.valueOf(1))
+ .build();