[SDFAB-1048] Fix wiring issue caused by readPortId

Leverage the dep already in place between gnmi driver and gnmi protocol
and expose readPortId as cfg property of GnmiControllerImpl

Change-Id: I34defd8928589129dc84cae45033f7f7c3c673bb
diff --git a/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java b/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java
index 4c3018a..ac0fda7 100644
--- a/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java
+++ b/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java
@@ -27,7 +27,6 @@
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.NodeId;
 import org.onosproject.core.CoreService;
-import org.onosproject.drivers.gnmi.OpenConfigGnmiDeviceDescriptionDiscovery;
 import org.onosproject.gnmi.api.GnmiController;
 import org.onosproject.mastership.MastershipInfo;
 import org.onosproject.mastership.MastershipService;
@@ -98,8 +97,6 @@
 import static org.onlab.util.Tools.groupedThreads;
 import static org.onosproject.provider.general.device.impl.OsgiPropertyConstants.CHECKUP_INTERVAL;
 import static org.onosproject.provider.general.device.impl.OsgiPropertyConstants.CHECKUP_INTERVAL_DEFAULT;
-import static org.onosproject.provider.general.device.impl.OsgiPropertyConstants.READ_PORT_ID;
-import static org.onosproject.provider.general.device.impl.OsgiPropertyConstants.READ_PORT_ID_DEFAULT;
 import static org.onosproject.provider.general.device.impl.OsgiPropertyConstants.STATS_POLL_INTERVAL;
 import static org.onosproject.provider.general.device.impl.OsgiPropertyConstants.STATS_POLL_INTERVAL_DEFAULT;
 import static org.slf4j.LoggerFactory.getLogger;
@@ -113,8 +110,7 @@
 @Component(immediate = true,
         property = {
                 CHECKUP_INTERVAL + ":Integer=" + CHECKUP_INTERVAL_DEFAULT,
-                STATS_POLL_INTERVAL + ":Integer=" + STATS_POLL_INTERVAL_DEFAULT,
-                READ_PORT_ID + ":Boolean=" + READ_PORT_ID_DEFAULT,
+                STATS_POLL_INTERVAL + ":Integer=" + STATS_POLL_INTERVAL_DEFAULT
         })
 public class GeneralDeviceProvider extends AbstractProvider
         implements DeviceProvider {
@@ -178,11 +174,6 @@
      */
     private int statsPollInterval = STATS_POLL_INTERVAL_DEFAULT;
 
-    /**
-     * Configure read port-id for gnmi drivers; default is false.
-     */
-    private boolean readPortId = READ_PORT_ID_DEFAULT;
-
     private final Map<DeviceId, DeviceHandshaker> handshakersWithListeners = Maps.newConcurrentMap();
     private final Map<DeviceId, Long> lastCheckups = Maps.newConcurrentMap();
     private final InternalPipeconfWatchdogListener pipeconfWatchdogListener = new InternalPipeconfWatchdogListener();
@@ -242,11 +233,6 @@
                 properties, STATS_POLL_INTERVAL, STATS_POLL_INTERVAL_DEFAULT);
         log.info("Configured. {} is configured to {} seconds",
                  STATS_POLL_INTERVAL, statsPollInterval);
-        final boolean oldReaPortId = readPortId;
-        String strReadPortId = Tools.get(properties, READ_PORT_ID);
-        readPortId = Boolean.parseBoolean(strReadPortId);
-        log.info("Configured. {} is configured to {}",
-                READ_PORT_ID, readPortId);
 
         if (oldCheckupInterval != checkupInterval) {
             startOrReschedulePeriodicCheckupTasks();
@@ -255,12 +241,6 @@
         if (oldStatsPollFrequency != statsPollInterval) {
             statsPoller.reschedule(statsPollInterval);
         }
-
-        if (oldReaPortId != readPortId) {
-            // FIXME temporary solution will be removed when the
-            //  transition to p4rt translation is completed
-            OpenConfigGnmiDeviceDescriptionDiscovery.readPortId = readPortId;
-        }
     }
 
     @Deactivate