[SDFAB-359] Allow purging flows, groups and meters by device and application ID
Change-Id: I5e507d230789979ac997dbc99697fa0483363f70
(cherry picked from commit cfd774018c0ed926873b1e171c106217cb2ac568)
diff --git a/core/api/src/main/java/org/onosproject/net/group/GroupService.java b/core/api/src/main/java/org/onosproject/net/group/GroupService.java
index 460ccb6..bf18a2e 100644
--- a/core/api/src/main/java/org/onosproject/net/group/GroupService.java
+++ b/core/api/src/main/java/org/onosproject/net/group/GroupService.java
@@ -133,6 +133,16 @@
void purgeGroupEntries(DeviceId deviceId);
/**
+ * Purges all the group entries on the specified device and application.
+ *
+ * @param deviceId device identifier
+ * @param appId application identifier
+ */
+ default void purgeGroupEntries(DeviceId deviceId, ApplicationId appId) {
+ throw new UnsupportedOperationException("purgeGroupEntries not implemented");
+ }
+
+ /**
* Purges all group entries.
*/
default void purgeGroupEntries() {}
diff --git a/core/api/src/main/java/org/onosproject/net/group/GroupStore.java b/core/api/src/main/java/org/onosproject/net/group/GroupStore.java
index 850b2ce..672bb4e 100644
--- a/core/api/src/main/java/org/onosproject/net/group/GroupStore.java
+++ b/core/api/src/main/java/org/onosproject/net/group/GroupStore.java
@@ -17,6 +17,7 @@
import java.util.Collection;
+import org.onosproject.core.ApplicationId;
import org.onosproject.core.GroupId;
import org.onosproject.net.DeviceId;
import org.onosproject.store.Store;
@@ -130,6 +131,14 @@
void purgeGroupEntry(DeviceId deviceId);
/**
+ * Removes all group entries of given device and given application from store.
+ *
+ * @param deviceId device id
+ * @param appId application id
+ */
+ void purgeGroupEntries(DeviceId deviceId, ApplicationId appId);
+
+ /**
* Removes all group entries from store.
*/
default void purgeGroupEntries() {}