[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/SubscriberFlowInfo.java b/impl/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java
index 444f45f..225e48f 100644
--- a/impl/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java
+++ b/impl/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java
@@ -32,30 +32,44 @@
     private final UniTagInformation tagInfo;
     private MeterId downId;
     private MeterId upId;
+    private MeterId downOltId;
+    private MeterId upOltId;
     private final String downBpInfo;
     private final String upBpInfo;
+    private final String downOltBpInfo;
+    private final String upOltBpInfo;
 
     /**
      * Builds the mapper of information.
-     * @param nniPort the nni port
-     * @param uniPort the uni port
-     * @param tagInfo the tag info
-     * @param downId the downstream meter id
-     * @param upId the upstream meter id
-     * @param downBpInfo the downstream bandwidth profile
-     * @param upBpInfo the upstream bandwidth profile
+     * @param nniPort       the nni port
+     * @param uniPort       the uni port
+     * @param tagInfo       the tag info
+     * @param downId        the downstream meter id
+     * @param upId          the upstream meter id
+     * @param downOltId     the downstream meter id of OLT device
+     * @param upOltId       the upstream meter id of OLT device
+     * @param downBpInfo    the downstream bandwidth profile
+     * @param upBpInfo      the upstream bandwidth profile
+     * @param downOltBpInfo the downstream bandwidth profile of OLT device
+     * @param upOltBpInfo   the upstream bandwidth profile of OLT device
      */
     SubscriberFlowInfo(AccessDevicePort nniPort, AccessDevicePort uniPort,
                        UniTagInformation tagInfo, MeterId downId, MeterId upId,
-                       String downBpInfo, String upBpInfo) {
+                       MeterId downOltId, MeterId upOltId,
+                       String downBpInfo, String upBpInfo,
+                       String downOltBpInfo, String upOltBpInfo) {
         this.devId = uniPort.deviceId();
         this.nniPort = nniPort;
         this.uniPort = uniPort;
         this.tagInfo = tagInfo;
         this.downId = downId;
         this.upId = upId;
+        this.downOltId = downOltId;
+        this.upOltId = upOltId;
         this.downBpInfo = downBpInfo;
         this.upBpInfo = upBpInfo;
+        this.downOltBpInfo = downOltBpInfo;
+        this.upOltBpInfo = upOltBpInfo;
     }
 
     /**
@@ -113,6 +127,24 @@
     }
 
     /**
+     * Gets the downstream meter id of this subscriber and flow information of OLT device.
+     *
+     * @return downstream olt meter id
+     */
+    MeterId getDownOltId() {
+        return downOltId;
+    }
+
+    /**
+     * Gets the upstream meter id of this subscriber and flow information of OLT device.
+     *
+     * @return upstream olt meter id
+     */
+    MeterId getUpOltId() {
+        return upOltId;
+    }
+
+    /**
      * Gets the downstream bandwidth profile of this subscriber and flow information.
      *
      * @return downstream bandwidth profile
@@ -131,7 +163,26 @@
     }
 
     /**
+     * Gets the downstream bandwidth profile of this subscriber and flow information of OLT device.
+     *
+     * @return downstream OLT bandwidth profile
+     */
+    String getDownOltBpInfo() {
+        return downOltBpInfo;
+    }
+
+    /**
+     * Gets the upstream bandwidth profile of this subscriber and flow information of OLT device.
+     *
+     * @return upstream OLT bandwidth profile.
+     */
+    String getUpOltBpInfo() {
+        return upOltBpInfo;
+    }
+
+    /**
      * Sets the upstream meter id.
+     *
      * @param upMeterId the upstream meter id
      */
     void setUpMeterId(MeterId upMeterId) {
@@ -140,12 +191,31 @@
 
     /**
      * Sets the downstream meter id.
+     *
      * @param downMeterId the downstream meter id
      */
     void setDownMeterId(MeterId downMeterId) {
         this.downId = downMeterId;
     }
 
+    /**
+     * Sets the upstream meter id of OLT.
+     *
+     * @param upOltMeterId the upstream meter id of OLT
+     */
+    void setUpOltMeterId(MeterId upOltMeterId) {
+        this.upOltId = upOltMeterId;
+    }
+
+    /**
+     * Sets the downstream meter id of OLT.
+     *
+     * @param downOltMeterId the downstream meter id of OLT
+     */
+    void setDownOltMeterId(MeterId downOltMeterId) {
+        this.downOltId = downOltMeterId;
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) {
@@ -160,12 +230,14 @@
                 uniPort.equals(flowInfo.uniPort) &&
                 tagInfo.equals(flowInfo.tagInfo) &&
                 downBpInfo.equals(flowInfo.downBpInfo) &&
-                upBpInfo.equals(flowInfo.upBpInfo);
+                upBpInfo.equals(flowInfo.upBpInfo) &&
+                Objects.equals(downOltBpInfo, flowInfo.downOltBpInfo) &&
+                Objects.equals(upOltBpInfo, flowInfo.upOltBpInfo);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(devId, nniPort, uniPort, tagInfo, downBpInfo, upBpInfo);
+        return Objects.hash(devId, nniPort, uniPort, tagInfo, downBpInfo, upBpInfo, downOltBpInfo, upOltBpInfo);
     }
 
     @Override
@@ -177,8 +249,12 @@
                 .add("tagInfo", tagInfo)
                 .add("downId", downId)
                 .add("upId", upId)
+                .add("downOltId", downOltId)
+                .add("upOltId", upOltId)
                 .add("downBpInfo", downBpInfo)
                 .add("upBpInfo", upBpInfo)
+                .add("downOltBpInfo", downOltBpInfo)
+                .add("upOltBpInfo", upOltBpInfo)
                 .toString();
     }
 }