[ONOS-7731] Update api interface & implementation of openstack vtap app

Change-Id: I7c3c7888b00a7357b13e3b1756e9cd0a1bb6a5c0
diff --git a/apps/openstackvtap/api/src/main/java/org/onosproject/openstackvtap/api/OpenstackVtapService.java b/apps/openstackvtap/api/src/main/java/org/onosproject/openstackvtap/api/OpenstackVtapService.java
index 5041aaf..bfb63a0 100644
--- a/apps/openstackvtap/api/src/main/java/org/onosproject/openstackvtap/api/OpenstackVtapService.java
+++ b/apps/openstackvtap/api/src/main/java/org/onosproject/openstackvtap/api/OpenstackVtapService.java
@@ -15,47 +15,111 @@
  */
 package org.onosproject.openstackvtap.api;
 
+import org.onlab.packet.IpAddress;
 import org.onosproject.event.ListenerService;
 import org.onosproject.net.DeviceId;
 
 import java.util.Set;
 
 /**
- * Service for interacting with the inventory of vTap.
+ * Service for interacting with the inventory of openstack vtap.
  */
 public interface OpenstackVtapService
         extends ListenerService<OpenstackVtapEvent, OpenstackVtapListener> {
 
     /**
-     * Returns the number of vTaps in the store.
+     * Creates a new openstack vtap network based on the specified description.
      *
-     * @param type               vTap type
-     * @return vTap count
+     * @param mode      mode of vtap network
+     * @param networkId network id of the vtap tunneling network
+     * @param serverIp  server IP address used for tunneling
+     * @return created openstack vtap network object or null if error occurred
+     */
+    OpenstackVtapNetwork createVtapNetwork(OpenstackVtapNetwork.Mode mode, Integer networkId, IpAddress serverIp);
+
+    /**
+     * Updates the openstack vtap network based on the specified description.
+     *
+     * @param description description of vtap network
+     * @return updated openstack vtap network object or null if error occurred
+     */
+    OpenstackVtapNetwork updateVtapNetwork(OpenstackVtapNetwork description);
+
+    /**
+     * Removes the specified openstack vtap network.
+     *
+     * @return removed openstack vtap network object or null if error occurred
+     */
+    OpenstackVtapNetwork removeVtapNetwork();
+
+    /**
+     * Returns the openstack vtap network.
+     *
+     * @return openstack vtap network or null if not exists
+     */
+    OpenstackVtapNetwork getVtapNetwork();
+
+    /**
+     * Returns a set of devices which are associated with the openstack vtap network.
+     *
+     * @return set of devices
+     */
+    Set<DeviceId> getVtapNetworkDevices();
+
+    /**
+     * Creates a new openstack vtap based on the specified type and criterion.
+     *
+     * @param type          type of vtap (all,rx,tx)
+     * @param vtapCriterion criterion of vtap
+     * @return created openstack vtap object or null if error occurred
+     */
+    OpenstackVtap createVtap(OpenstackVtap.Type type, OpenstackVtapCriterion vtapCriterion);
+
+    /**
+     * Updates the openstack vtap with specified description.
+     *
+     * @param description description of vtap
+     * @return updated openstack vtap object or null if error occurred
+     */
+    OpenstackVtap updateVtap(OpenstackVtap description);
+
+    /**
+     * Removes the specified openstack vtap with given vtap identifier.
+     *
+     * @param vtapId vtap identifier
+     * @return removed openstack vtap object or null if error occurred
+     */
+    OpenstackVtap removeVtap(OpenstackVtapId vtapId);
+
+    /**
+     * Returns the number of openstack vtaps for the given type.
+     *
+     * @param type type of vtap (any,rx,tx,all)
+     * @return number of openstack vtaps
      */
     int getVtapCount(OpenstackVtap.Type type);
 
     /**
-     * Returns a collection of selected vTaps in the store.
+     * Returns a set of openstack vtaps for the given type.
      *
-     * @param type               vTap type
-     * @return iterable collection of selected vTaps
+     * @param type type of vtap (any,rx,tx,all)
+     * @return set of openstack vtaps
      */
     Set<OpenstackVtap> getVtaps(OpenstackVtap.Type type);
 
     /**
-     * Returns the vTap with the specified identifier.
+     * Returns the openstack vtap with the specified identifier.
      *
-     * @param vTapId             vTap identifier
-     * @return vTap or null if not exist
+     * @param vtapId vtap identifier
+     * @return openstack vtap or null if one with the given identifier is not known
      */
-    OpenstackVtap getVtap(OpenstackVtapId vTapId);
+    OpenstackVtap getVtap(OpenstackVtapId vtapId);
 
     /**
-     * Returns a collection of vTaps which are associated with the given device.
+     * Returns a set of openstack vtaps which are associated with the given device.
      *
-     * @param type               vTap type
-     * @param deviceId           device identifier
-     * @return a set of vTaps
+     * @param deviceId device identifier
+     * @return set of openstack vtaps
      */
-    Set<OpenstackVtap> getVtapsByDeviceId(OpenstackVtap.Type type, DeviceId deviceId);
+    Set<OpenstackVtap> getVtapsByDeviceId(DeviceId deviceId);
 }