Expose PolicyService through API package

Change-Id: I2166e14a0dd256b3f8ab680c8f2ad59cce8a3678
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/AbstractPolicy.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/AbstractPolicy.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/AbstractPolicy.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/AbstractPolicy.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicy.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicy.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicy.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicy.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/Policy.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/Policy.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/Policy.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/Policy.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyData.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyData.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyData.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyData.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyId.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyId.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyId.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyId.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyService.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyService.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyService.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyService.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyState.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyState.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyState.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/PolicyState.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicy.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicy.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicy.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicy.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatch.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatch.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatch.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatch.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchData.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchData.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchData.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchData.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchId.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchId.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchId.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchId.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchState.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchState.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchState.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchState.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/package-info.java b/api/src/main/java/org/onosproject/segmentrouting/policy/api/package-info.java
similarity index 100%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/package-info.java
rename to api/src/main/java/org/onosproject/segmentrouting/policy/api/package-info.java
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/cli/TrafficMatchRemoveCommand.java b/impl/src/main/java/org/onosproject/segmentrouting/cli/TrafficMatchRemoveCommand.java
index f6f0212..bda4468 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/cli/TrafficMatchRemoveCommand.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/cli/TrafficMatchRemoveCommand.java
@@ -15,7 +15,6 @@
  */
 package org.onosproject.segmentrouting.cli;
 
-
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicyCodec.java b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/DropPolicyCodec.java
similarity index 92%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicyCodec.java
rename to impl/src/main/java/org/onosproject/segmentrouting/policy/impl/DropPolicyCodec.java
index 407bd08..2d6f321 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/DropPolicyCodec.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/DropPolicyCodec.java
@@ -13,12 +13,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.segmentrouting.policy.api;
+package org.onosproject.segmentrouting.policy.impl;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.onosproject.codec.CodecContext;
 import org.onosproject.codec.JsonCodec;
+import org.onosproject.segmentrouting.policy.api.DropPolicy;
 
 /**
  * Codec of DropPolicy class.
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java
index 87fa61a..f1dc285 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java
@@ -47,22 +47,19 @@
 import org.onosproject.net.intent.WorkPartitionService;
 import org.onosproject.net.link.LinkService;
 import org.onosproject.segmentrouting.SegmentRoutingService;
-import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException;
 import org.onosproject.segmentrouting.policy.api.DropPolicy;
-import org.onosproject.segmentrouting.policy.api.DropPolicyCodec;
 import org.onosproject.segmentrouting.policy.api.Policy;
-import org.onosproject.segmentrouting.policy.api.Policy.PolicyType;
 import org.onosproject.segmentrouting.policy.api.PolicyData;
 import org.onosproject.segmentrouting.policy.api.PolicyId;
 import org.onosproject.segmentrouting.policy.api.PolicyService;
 import org.onosproject.segmentrouting.policy.api.PolicyState;
 import org.onosproject.segmentrouting.policy.api.RedirectPolicy;
-import org.onosproject.segmentrouting.policy.api.RedirectPolicyCodec;
 import org.onosproject.segmentrouting.policy.api.TrafficMatch;
-import org.onosproject.segmentrouting.policy.api.TrafficMatchCodec;
 import org.onosproject.segmentrouting.policy.api.TrafficMatchData;
 import org.onosproject.segmentrouting.policy.api.TrafficMatchId;
 import org.onosproject.segmentrouting.policy.api.TrafficMatchState;
+import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException;
+import org.onosproject.segmentrouting.policy.api.Policy.PolicyType;
 import org.onosproject.store.serializers.KryoNamespaces;
 import org.onosproject.store.service.ConsistentMap;
 import org.onosproject.store.service.MapEvent;
@@ -101,7 +98,7 @@
     static final String KEY_SEPARATOR = "|";
 
     // Supported policies
-    private static final Set<Policy.PolicyType> SUPPORTED_POLICIES = ImmutableSet.of(
+    private static final Set<PolicyType> SUPPORTED_POLICIES = ImmutableSet.of(
             PolicyType.DROP, PolicyType.REDIRECT);
 
     // Driver should use this meta to match port_is_edge field in the ACL table
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicyCodec.java b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/RedirectPolicyCodec.java
similarity index 95%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicyCodec.java
rename to impl/src/main/java/org/onosproject/segmentrouting/policy/impl/RedirectPolicyCodec.java
index efb2828..f3c4ab9 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/RedirectPolicyCodec.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/RedirectPolicyCodec.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.segmentrouting.policy.api;
+package org.onosproject.segmentrouting.policy.impl;
 
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -21,6 +21,7 @@
 import org.onosproject.codec.CodecContext;
 import org.onosproject.codec.JsonCodec;
 import org.onosproject.net.DeviceId;
+import org.onosproject.segmentrouting.policy.api.RedirectPolicy;
 
 import java.util.LinkedList;
 import java.util.List;
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchCodec.java b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/TrafficMatchCodec.java
similarity index 93%
rename from impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchCodec.java
rename to impl/src/main/java/org/onosproject/segmentrouting/policy/impl/TrafficMatchCodec.java
index 1f4f8be..fe6d464 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/policy/api/TrafficMatchCodec.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/TrafficMatchCodec.java
@@ -13,13 +13,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.segmentrouting.policy.api;
+package org.onosproject.segmentrouting.policy.impl;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import org.onosproject.codec.CodecContext;
 import org.onosproject.codec.JsonCodec;
 import org.onosproject.net.flow.TrafficSelector;
+import org.onosproject.segmentrouting.policy.api.PolicyId;
+import org.onosproject.segmentrouting.policy.api.TrafficMatch;
 
 import static org.onlab.util.Tools.nullIsIllegal;
 
diff --git a/impl/src/test/java/org/onosproject/segmentrouting/policy/api/DropPolicyCodecTest.java b/impl/src/test/java/org/onosproject/segmentrouting/policy/impl/DropPolicyCodecTest.java
similarity index 95%
rename from impl/src/test/java/org/onosproject/segmentrouting/policy/api/DropPolicyCodecTest.java
rename to impl/src/test/java/org/onosproject/segmentrouting/policy/impl/DropPolicyCodecTest.java
index 5d95625..e9af865 100644
--- a/impl/src/test/java/org/onosproject/segmentrouting/policy/api/DropPolicyCodecTest.java
+++ b/impl/src/test/java/org/onosproject/segmentrouting/policy/impl/DropPolicyCodecTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.segmentrouting.policy.api;
+package org.onosproject.segmentrouting.policy.impl;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -24,6 +24,7 @@
 import org.onosproject.codec.CodecContext;
 import org.onosproject.codec.JsonCodec;
 import org.onosproject.codec.impl.MockCodecContext;
+import org.onosproject.segmentrouting.policy.api.DropPolicy;
 
 import java.io.InputStream;
 
diff --git a/impl/src/test/java/org/onosproject/segmentrouting/policy/api/RedirectPolicyCodecTest.java b/impl/src/test/java/org/onosproject/segmentrouting/policy/impl/RedirectPolicyCodecTest.java
similarity index 95%
rename from impl/src/test/java/org/onosproject/segmentrouting/policy/api/RedirectPolicyCodecTest.java
rename to impl/src/test/java/org/onosproject/segmentrouting/policy/impl/RedirectPolicyCodecTest.java
index 7541436..ff75769 100644
--- a/impl/src/test/java/org/onosproject/segmentrouting/policy/api/RedirectPolicyCodecTest.java
+++ b/impl/src/test/java/org/onosproject/segmentrouting/policy/impl/RedirectPolicyCodecTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.segmentrouting.policy.api;
+package org.onosproject.segmentrouting.policy.impl;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -25,6 +25,7 @@
 import org.onosproject.codec.JsonCodec;
 import org.onosproject.codec.impl.MockCodecContext;
 import org.onosproject.net.DeviceId;
+import org.onosproject.segmentrouting.policy.api.RedirectPolicy;
 
 import java.io.InputStream;
 import java.util.LinkedList;
diff --git a/impl/src/test/java/org/onosproject/segmentrouting/policy/api/TrafficMatchCodecTest.java b/impl/src/test/java/org/onosproject/segmentrouting/policy/impl/TrafficMatchCodecTest.java
similarity index 94%
rename from impl/src/test/java/org/onosproject/segmentrouting/policy/api/TrafficMatchCodecTest.java
rename to impl/src/test/java/org/onosproject/segmentrouting/policy/impl/TrafficMatchCodecTest.java
index c70eb7c..f78fb80 100644
--- a/impl/src/test/java/org/onosproject/segmentrouting/policy/api/TrafficMatchCodecTest.java
+++ b/impl/src/test/java/org/onosproject/segmentrouting/policy/impl/TrafficMatchCodecTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.segmentrouting.policy.api;
+package org.onosproject.segmentrouting.policy.impl;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -28,6 +28,8 @@
 import org.onosproject.codec.impl.MockCodecContext;
 import org.onosproject.net.flow.DefaultTrafficSelector;
 import org.onosproject.net.flow.TrafficSelector;
+import org.onosproject.segmentrouting.policy.api.PolicyId;
+import org.onosproject.segmentrouting.policy.api.TrafficMatch;
 
 import java.io.InputStream;
 
diff --git a/web/pom.xml b/web/pom.xml
index 1cf8ee1..910e5f1 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -42,13 +42,19 @@
     </properties>
 
     <dependencies>
-        <!-- Trellis impl -->
+        <!-- Trellis -->
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>segmentrouting-impl</artifactId>
             <version>${project.parent.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>segmentrouting-api</artifactId>
+            <version>${project.parent.version}</version>
+            <scope>provided</scope>
+        </dependency>
 
         <!-- ONOS core -->
         <dependency>