[ONOS-6446] ObjectiveTrackerService is not a public service

If an application want to create custom Intent installer, it might need
ObjectiveTrackerService.

However, the ObjectiveTrackerService is not public api (in /core/net,
should be /core/api); so application outside the ONOS can't use it.

Move ObjectiveTrackerService and it's dependence to /code/api

Change-Id: Ie2ad8dd9d39ccae1c91f4b57887089e0aec83ede
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
index f94ad8c..7b09a1a 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
@@ -50,7 +50,9 @@
 import org.onosproject.net.intent.IntentStore;
 import org.onosproject.net.intent.IntentStoreDelegate;
 import org.onosproject.net.intent.Key;
+import org.onosproject.net.intent.ObjectiveTrackerService;
 import org.onosproject.net.intent.PointToPointIntent;
+import org.onosproject.net.intent.TopologyChangeDelegate;
 import org.onosproject.net.intent.impl.compiler.PointToPointIntentCompiler;
 import org.onosproject.net.intent.impl.phase.FinalIntentProcessPhase;
 import org.onosproject.net.intent.impl.phase.IntentProcessPhase;
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTracker.java b/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTracker.java
index b11bb0e..4a03009 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTracker.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTracker.java
@@ -43,6 +43,8 @@
 import org.onosproject.net.intent.IntentData;
 import org.onosproject.net.intent.IntentService;
 import org.onosproject.net.intent.Key;
+import org.onosproject.net.intent.ObjectiveTrackerService;
+import org.onosproject.net.intent.TopologyChangeDelegate;
 import org.onosproject.net.intent.WorkPartitionEvent;
 import org.onosproject.net.intent.WorkPartitionEventListener;
 import org.onosproject.net.intent.WorkPartitionService;
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTrackerService.java b/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTrackerService.java
deleted file mode 100644
index 51cdc4f..0000000
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/ObjectiveTrackerService.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2014-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent.impl;
-
-import org.onosproject.net.NetworkResource;
-import org.onosproject.net.intent.IntentData;
-import org.onosproject.net.intent.Key;
-
-import java.util.Collection;
-
-/**
- * Auxiliary service for tracking intent path flows and for notifying the
- * intent service of environment changes via topology change delegate.
- */
-public interface ObjectiveTrackerService {
-
-    /**
-     * Sets a topology change delegate.
-     *
-     * @param delegate topology change delegate
-     */
-    void setDelegate(TopologyChangeDelegate delegate);
-
-    /**
-     * Unsets topology change delegate.
-     *
-     * @param delegate topology change delegate
-     */
-    void unsetDelegate(TopologyChangeDelegate delegate);
-
-    /**
-     * Adds a path flow to be tracked.
-     *
-     * @param intentKey  intent identity on whose behalf the path is being tracked
-     * @param resources resources to track
-     */
-    // TODO consider using the IntentData here rather than just the key
-    void addTrackedResources(Key intentKey,
-                                    Collection<NetworkResource> resources);
-
-    /**
-     * Removes a path flow to be tracked.
-     *
-     * @param intentKey  intent identity on whose behalf the path is being tracked
-     * @param resources resources to stop tracking
-     */
-    void removeTrackedResources(Key intentKey,
-                                       Collection<NetworkResource> resources);
-
-    /**
-     * Submits the specified intent data to be tracked.
-     *
-     * @param intentData intent data object to be tracked
-     */
-    void trackIntent(IntentData intentData);
-}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/TopologyChangeDelegate.java b/core/net/src/main/java/org/onosproject/net/intent/impl/TopologyChangeDelegate.java
deleted file mode 100644
index ba5fc05..0000000
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/TopologyChangeDelegate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2014-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent.impl;
-
-import org.onosproject.net.intent.Key;
-
-/**
- * Auxiliary delegate for integration of intent manager and flow trackerService.
- */
-public interface TopologyChangeDelegate {
-
-    /**
-     * Notifies that topology has changed in such a way that the specified
-     * intents should be recompiled. If the {@code compileAllFailed} parameter
-     * is true, then all intents in {@link org.onosproject.net.intent.IntentState#FAILED}
-     * state should be compiled as well.
-     *
-     * @param intentIds intents that should be recompiled
-     * @param compileAllFailed true implies full compile of all failed intents
-     *                         is required; false for selective recompile only
-     */
-    void triggerCompile(Iterable<Key> intentIds, boolean compileAllFailed);
-
-}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/DomainIntentInstaller.java b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/DomainIntentInstaller.java
index a713034..fe36853 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/DomainIntentInstaller.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/DomainIntentInstaller.java
@@ -31,7 +31,7 @@
 import org.onosproject.net.intent.IntentInstaller;
 import org.onosproject.net.intent.IntentOperationContext;
 import org.onosproject.net.intent.impl.IntentManager;
-import org.onosproject.net.intent.impl.ObjectiveTrackerService;
+import org.onosproject.net.intent.ObjectiveTrackerService;
 import org.slf4j.Logger;
 
 import java.util.List;
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowObjectiveIntentInstaller.java b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowObjectiveIntentInstaller.java
index 22ff970..a237b8e 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowObjectiveIntentInstaller.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowObjectiveIntentInstaller.java
@@ -39,7 +39,7 @@
 import org.onosproject.net.intent.IntentOperationContext;
 import org.onosproject.net.intent.IntentInstaller;
 import org.onosproject.net.intent.impl.IntentManager;
-import org.onosproject.net.intent.impl.ObjectiveTrackerService;
+import org.onosproject.net.intent.ObjectiveTrackerService;
 import org.slf4j.Logger;
 
 import java.util.Collection;
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowRuleIntentInstaller.java b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowRuleIntentInstaller.java
index df2c28c..e736e01 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowRuleIntentInstaller.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/FlowRuleIntentInstaller.java
@@ -33,7 +33,7 @@
 import org.onosproject.net.intent.IntentOperationContext;
 import org.onosproject.net.intent.IntentInstaller;
 import org.onosproject.net.intent.impl.IntentManager;
-import org.onosproject.net.intent.impl.ObjectiveTrackerService;
+import org.onosproject.net.intent.ObjectiveTrackerService;
 import org.slf4j.Logger;
 
 import java.util.Collection;
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/ProtectionEndpointIntentInstaller.java b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/ProtectionEndpointIntentInstaller.java
index 58c24e6..c2fde34 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/installer/ProtectionEndpointIntentInstaller.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/installer/ProtectionEndpointIntentInstaller.java
@@ -38,7 +38,7 @@
 import org.onosproject.net.intent.IntentInstaller;
 import org.onosproject.net.intent.ProtectionEndpointIntent;
 import org.onosproject.net.intent.impl.IntentManager;
-import org.onosproject.net.intent.impl.ObjectiveTrackerService;
+import org.onosproject.net.intent.ObjectiveTrackerService;
 import org.slf4j.Logger;
 
 import java.util.ArrayList;