[SDFAB-359] Purge all objective for a given application ID

Change-Id: I51847b0be890deacec5caddc18d52bcd2993959a
(cherry picked from commit 607fd0b70e4553226d0937d36de9cde655f2eb62)
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/Pipeliner.java b/core/api/src/main/java/org/onosproject/net/behaviour/Pipeliner.java
index 6f497e7..bd4af6c 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/Pipeliner.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/Pipeliner.java
@@ -17,6 +17,7 @@
 
 import java.util.List;
 
+import org.onosproject.core.ApplicationId;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.driver.HandlerBehaviour;
 import org.onosproject.net.flowobjective.FilteringObjective;
@@ -68,6 +69,13 @@
     void next(NextObjective nextObjective);
 
     /**
+     * Purges all objectives for the given application.
+     *
+     * @param appId application identifier
+     */
+    void purgeAll(ApplicationId appId);
+
+    /**
      *  Retrieves a mapping of the nextObjective to the groups in the dataplane,
      *  and returns it in a form that can be displayed on the CLI. Typically
      *  group-ids are returned for groups with multiple buckets, where each list element
diff --git a/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java b/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java
index 11a7f5f..4def953 100644
--- a/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java
+++ b/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java
@@ -25,6 +25,7 @@
 import com.google.common.collect.Maps;
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.commons.lang3.tuple.Pair;
+import org.onosproject.core.ApplicationId;
 import org.onosproject.net.DeviceId;
 
 /**
@@ -129,6 +130,14 @@
     List<String> getPendingFlowObjectives();
 
     /**
+     * Purges all flow objectives on a given device and for a given application.
+     *
+     * @param deviceId device identifier
+     * @param appId application identifier
+     */
+    void purgeAll(DeviceId deviceId, ApplicationId appId);
+
+    /**
      * Returns all filtering objective that are waiting for the completion of previous objective
      * with the same FilteringObjQueueKey.
      *