[SDFAB-359] Purge all on device disconnection

The previous logic was relying on the purgeOnDisconnection device configuration.
However, we want to allow flow rules to stay in the store when a device disconnects if those are
created by a different application. For this reason, we purge flow rule and groups explicitly on
device disconnection in SR by specifying the SR app ID.

Change-Id: I59369a1a18b82f134aaaab37be49e2ac746a4e9f
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/impl/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index c42773f..b12b229 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -1689,6 +1689,12 @@
             .forEach(entry -> entry.getValue().cleanUpForNeighborDown(device.id()));
 
         phasedRecoveryService.reset(device.id());
+
+        // Trigger purgeAll only on devices managed by SR, other devices rely on
+        // the purgeOnDisconnection device property.
+        if (deviceConfiguration.isConfigured(device.id())) {
+            flowObjectiveService.purgeAll(device.id(), appId);
+        }
     }
 
     /**