New PiInterpreter API to map logical port to long type

Introduce a new API for PiInterpreter to map logical port number to a long
port number and deprecate the old one.
The reason we need to translate logical port number to a long type is that
the mapped number will become negative when translating port number to
an unsigned integer with MSB (e.g., 0xFFFFFFFD) and the low level driver
or translator is expecting to get a positive number.

Change-Id: I751e69461b0cf97280f12fd98ca2b15b83cbe84f
diff --git a/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java b/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java
index 1ba85e0..11ca7c9 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java
@@ -106,12 +106,26 @@
      *
      * @param port port number
      * @return optional integer
+     * @deprecated in ONOS 3.0 using {@link #mapLogicalPort} instead
      */
+    @Deprecated
     default Optional<Integer> mapLogicalPortNumber(PortNumber port) {
         return Optional.empty();
     }
 
     /**
+     * Maps the given logical port number to the data plane port ID (long)
+     * identifying the same port for this pipeconf, if such mapping is
+     * possible.
+     *
+     * @param port port number
+     * @return optional long
+     */
+    default Optional<Long> mapLogicalPort(PortNumber port) {
+        return mapLogicalPortNumber(port).map(integer -> (long) integer);
+    }
+
+    /**
      * If the given table allows for mutable default actions, this method
      * returns an action instance to be used when ONOS tries to remove a
      * different default action previously set.