- // ODU interface specific data
- OduBuilder oduIfBuilder = new OduBuilder().setRate(ODU0.class)
- .setOduFunction(ODUTTPCTP.class)
- .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
- if (isNetworkPort) {
- LOG.debug("Network port is true");
- List<Uint16> tribSlots = new ArrayList<>();
- // add trib slots
- tribSlots.add(Uint16.valueOf(tribSlot));
- ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
- // set trib port numbers
- .setTribPortNumber(tribPortNumber).setTribSlots(tribSlots);
- oduIfBuilder.setOduFunction(ODUCTP.class)
- .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
- .setParentOduAllocation(parentOduAllocationBuilder.build());
- LOG.debug("Network port is true {} {} {}",
- oduIfBuilder.getParentOduAllocation().getTribSlots(),
- oduIfBuilder.getRate(),
- oduIfBuilder.getParentOduAllocation().getTribPortNumber());
+ Class<? extends OduFunctionIdentity> oduFunction;
+ MonitoringMode monitoringMode;
+ Opu opu = null;
+ ParentOduAllocation parentOduAllocation = null;
+ if (isCTP) {
+ oduFunction = ODUCTP.class;
+ monitoringMode = MonitoringMode.Monitored;
+ Set<Uint16> tribSlots = new HashSet<>();
+ Uint16 newIdx = Uint16.valueOf(tribSlotIndex);
+ tribSlots.add(newIdx);
+ IntStream.range(tribSlotIndex, tribSlotIndex + 8)
+ .forEach(nbr -> tribSlots.add(Uint16.valueOf(nbr)));
+ parentOduAllocation = new ParentOduAllocationBuilder()
+ .setTribPortNumber(Uint16.valueOf(tribPortNumber))
+ .setTribSlots(tribSlots)
+ .build();