[VOL-4180] Multi UNI feature implemented to OLT application.
Change-Id: I3d45719ebdce304ba94652ed9de553e40d76a77c
EAPOL flow bug-fixed
review fixes finshed
Multi UNI feature implemented to OLT application.
- It's possible to fetch a meter by annotations. (OltPipeline)
- New meters can be created for bandwidth profiles of OLT device.
- Olt meterId is transported via writeMetadata so that voltha/rw-core can parse it and assign the correct meters to ONU and OLT flows.
Change-Id: Ia6c9909b5f03b0f3fe329bd11580f891bfab3a32
diff --git a/impl/src/main/java/org/opencord/olt/impl/OltMeterService.java b/impl/src/main/java/org/opencord/olt/impl/OltMeterService.java
index 59aed0e..ab603b1 100644
--- a/impl/src/main/java/org/opencord/olt/impl/OltMeterService.java
+++ b/impl/src/main/java/org/opencord/olt/impl/OltMeterService.java
@@ -182,6 +182,15 @@
@Override
public MeterId getMeterIdFromBpMapping(DeviceId deviceId, String bandwidthProfile) {
+ if (bandwidthProfile == null) {
+ log.warn("Bandwidth Profile requested is null");
+ return null;
+ }
+ if (bpInfoToMeter.get(bandwidthProfile) == null) {
+ log.warn("Bandwidth Profile '{}' is not present in the map",
+ bandwidthProfile);
+ return null;
+ }
if (bpInfoToMeter.get(bandwidthProfile).value().isEmpty()) {
log.warn("Bandwidth Profile '{}' is not currently mapped to a meter",
bandwidthProfile);
@@ -282,6 +291,10 @@
@Override
public synchronized boolean checkAndAddPendingMeter(DeviceId deviceId, BandwidthProfileInformation bwpInfo) {
+ if (bwpInfo == null) {
+ log.debug("Bandwidth profile is null for device: {}", deviceId);
+ return false;
+ }
if (pendingMeters.containsKey(deviceId)
&& pendingMeters.get(deviceId).contains(bwpInfo)) {
log.debug("Meter is already pending on {} with bp {}",