ONOS-1048 - Define interfaces instead of using IntentManager

- Define IntentProcessor interface containing methods to process an intent
- Pull out IntentCompiler related tasks to CompilerRegistry
- Pull out IntentInstaller related tasks to InstallerRegistry
- Create an IntentProcessor subclass as inner class in IntentManager

Change-Id: Ia3e8d574a1053e7ddc9b961873ef758c9e0b1b26
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/WithdrawRequest.java b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/WithdrawRequest.java
index bbc7f34..f2e120f 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/WithdrawRequest.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/WithdrawRequest.java
@@ -16,7 +16,7 @@
 package org.onosproject.net.intent.impl.phase;
 
 import org.onosproject.net.intent.IntentData;
-import org.onosproject.net.intent.impl.IntentManager;
+import org.onosproject.net.intent.impl.IntentProcessor;
 
 import java.util.Optional;
 
@@ -27,13 +27,12 @@
  */
 public final class WithdrawRequest implements IntentProcessPhase {
 
-    // TODO: define an interface and use it, instead of IntentManager
-    private final IntentManager intentManager;
+    private final IntentProcessor processor;
     private final IntentData pending;
     private final IntentData current;
 
-    public WithdrawRequest(IntentManager intentManager, IntentData intentData, IntentData current) {
-        this.intentManager = checkNotNull(intentManager);
+    public WithdrawRequest(IntentProcessor processor, IntentData intentData, IntentData current) {
+        this.processor = checkNotNull(processor);
         this.pending = checkNotNull(intentData);
         this.current = checkNotNull(current);
     }
@@ -43,6 +42,6 @@
         //TODO perhaps we want to validate that the pending and current are the
         // same version i.e. they are the same
         // Note: this call is not just the symmetric version of submit
-        return Optional.of(new WithdrawCoordinating(intentManager, pending, current));
+        return Optional.of(new WithdrawCoordinating(processor, pending, current));
     }
 }