Few core changes in preparation of P4Runtime subsystem refactoring

Refactoring aims at providing a more robust connection procedure of
P4Runtime-based devices.

Refactoring requires devices to be registered to the core with
available=false (i.e. offline), and marked online only when the P4
pipeline has been deployed to the device. Also, it leaves the duty of
handling pipeconf-specific drivers to the driver subsystem, instead of
having the GeneralDeviceProvider take care of it, which resulted to be
brittle.

Changes include:
- Choose not to mark device online when re-asserting mastership role by
declaring special device annotation.
- Lookup drivers in device projectable model unsing driver service
device-based method, which is consistent with the way other subsystems
look for device drivers.
- In DriverManager, when looking for device drivers, consider the case
of pipeconf-programmable devices, in which case a special "merged"
driver needs to instantiated at runtime.
- In PacketManager, push flow objectives only if device is available
(i.e. after pipeline has been deployed).

Change-Id: I80f78a4f40730a06cb82fa55fefab08a91a89268
diff --git a/core/api/src/test/java/org/onosproject/net/pi/PiPipeconfServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/pi/PiPipeconfServiceAdapter.java
new file mode 100644
index 0000000..8eebf5f
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/net/pi/PiPipeconfServiceAdapter.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.net.pi;
+
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.pi.model.PiPipeconf;
+import org.onosproject.net.pi.model.PiPipeconfId;
+import org.onosproject.net.pi.service.PiPipeconfService;
+
+import java.util.Collections;
+import java.util.Optional;
+
+/**
+ * Test adapter of PiPipeconfService.
+ */
+public class PiPipeconfServiceAdapter implements PiPipeconfService {
+    @Override
+    public void register(PiPipeconf pipeconf) throws IllegalStateException {
+
+    }
+
+    @Override
+    public void remove(PiPipeconfId pipeconfId) throws IllegalStateException {
+
+    }
+
+    @Override
+    public Iterable<PiPipeconf> getPipeconfs() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public Optional<PiPipeconf> getPipeconf(PiPipeconfId id) {
+        return Optional.empty();
+    }
+
+    @Override
+    public void bindToDevice(PiPipeconfId pipeconfId, DeviceId deviceId) {
+
+    }
+
+    @Override
+    public String getMergedDriver(DeviceId deviceId, PiPipeconfId pipeconfId) {
+        return null;
+    }
+
+    @Override
+    public Optional<PiPipeconfId> ofDevice(DeviceId deviceId) {
+        return Optional.empty();
+    }
+}