Adding IntentCleanup as a component.

Listens for CORRUPT intent events and periodically polls for CORRUPT intents.

Change-Id: I29d8dbe14b46522815dc13e969f259f68b690855
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/MockFlowRuleService.java b/core/net/src/test/java/org/onosproject/net/intent/impl/MockFlowRuleService.java
index 7211e9d..8bd29bf 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/MockFlowRuleService.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/MockFlowRuleService.java
@@ -15,9 +15,7 @@
  */
 package org.onosproject.net.intent.impl;
 
-import java.util.Set;
-import java.util.stream.Collectors;
-
+import com.google.common.collect.Sets;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.flow.DefaultFlowEntry;
@@ -26,7 +24,11 @@
 import org.onosproject.net.flow.FlowRuleOperations;
 import org.onosproject.net.flow.FlowRuleServiceAdapter;
 
-import com.google.common.collect.Sets;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
+
+import static org.onosproject.net.flow.FlowRuleOperation.Type.REMOVE;
 
 
 public class MockFlowRuleService extends FlowRuleServiceAdapter {
@@ -45,9 +47,10 @@
 
     @Override
     public void apply(FlowRuleOperations ops) {
+        AtomicBoolean thisSuccess = new AtomicBoolean(success);
         ops.stages().forEach(stage -> stage.forEach(flow -> {
             if (errorFlow == flow.rule().id().value()) {
-                success = false;
+                thisSuccess.set(false);
             } else {
                 switch (flow.type()) {
                     case ADD:
@@ -62,7 +65,7 @@
                 }
             }
         }));
-        if (success) {
+        if (thisSuccess.get()) {
             ops.callback().onSuccess(ops);
         } else {
             ops.callback().onError(ops);