Refactor to separate api from implementation

Change-Id: Ia3ff3eab719cd380f502d359367e65835693ce12
diff --git a/api/pom.xml b/api/pom.xml
new file mode 100644
index 0000000..49a3aec
--- /dev/null
+++ b/api/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2020-present Open Networking Foundation
+  ~
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opencord</groupId>
+        <artifactId>mcast</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>mcast-api</artifactId>
+    <packaging>bundle</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+            <version>${onos.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/api/src/main/java/org/opencord/cordmcast/CordMcastService.java b/api/src/main/java/org/opencord/cordmcast/CordMcastService.java
new file mode 100644
index 0000000..591f186
--- /dev/null
+++ b/api/src/main/java/org/opencord/cordmcast/CordMcastService.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * 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.opencord.cordmcast;
+
+/**
+ * CORD multicast provisioning application.
+ */
+public interface CordMcastService {
+
+}
diff --git a/api/src/main/java/org/opencord/cordmcast/CordMcastStatistics.java b/api/src/main/java/org/opencord/cordmcast/CordMcastStatistics.java
new file mode 100644
index 0000000..6bdb702
--- /dev/null
+++ b/api/src/main/java/org/opencord/cordmcast/CordMcastStatistics.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.opencord.cordmcast;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.VlanId;
+
+/**
+ * POJO Class to store group data from mcast event.
+ */
+public class CordMcastStatistics {
+    //Group Address
+    private IpAddress groupAddress;
+    //Set of source address in a group.
+    private String sourceAddress;
+    //vlan id used in mcast event.
+    private VlanId vlanId;
+
+    public CordMcastStatistics(IpAddress groupAddress, String sourceAddresss, VlanId vlanId) {
+        this.vlanId = vlanId;
+        this.sourceAddress = sourceAddresss;
+        this.groupAddress = groupAddress;
+    }
+
+    public IpAddress getGroupAddress() {
+        return groupAddress;
+    }
+
+    public void setGroupAddress(IpAddress groupAddress) {
+        this.groupAddress = groupAddress;
+    }
+
+    public String getSourceAddress() {
+        return sourceAddress;
+    }
+
+    public void setSourceAddress(String sourceAddress) {
+        this.sourceAddress = sourceAddress;
+    }
+
+    public VlanId getVlanId() {
+        return vlanId;
+    }
+
+    public void setVlanId(VlanId vlanId) {
+        this.vlanId = vlanId;
+    }
+}
diff --git a/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsEvent.java b/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsEvent.java
new file mode 100644
index 0000000..52581d9
--- /dev/null
+++ b/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsEvent.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.opencord.cordmcast;
+
+import org.onosproject.event.AbstractEvent;
+
+import java.util.List;
+
+/**
+ * Event indicating Mcast statistics data.
+ */
+public class CordMcastStatisticsEvent extends
+        AbstractEvent<CordMcastStatisticsEvent.Type, List<CordMcastStatistics>> {
+
+    // Mcast event type.
+    public enum Type {
+        STATUS_UPDATE
+    }
+
+    public CordMcastStatisticsEvent(Type type, List<CordMcastStatistics> stats) {
+        super(type, stats);
+    }
+}
diff --git a/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsEventListener.java b/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsEventListener.java
new file mode 100644
index 0000000..30177ae
--- /dev/null
+++ b/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsEventListener.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.opencord.cordmcast;
+
+import org.onosproject.event.EventListener;
+
+/**
+ * Listener for Mcast statistics events.
+ */
+public interface CordMcastStatisticsEventListener extends
+        EventListener<CordMcastStatisticsEvent> {
+
+}
diff --git a/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsService.java b/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsService.java
new file mode 100644
index 0000000..3ab6f09
--- /dev/null
+++ b/api/src/main/java/org/opencord/cordmcast/CordMcastStatisticsService.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.opencord.cordmcast;
+
+import org.onlab.packet.VlanId;
+import org.onosproject.event.ListenerService;
+
+/**
+ * Service for interacting with CordMcastStatisticsEvent data.
+ */
+public interface CordMcastStatisticsService
+        extends ListenerService<CordMcastStatisticsEvent, CordMcastStatisticsEventListener> {
+    /**
+     * To set current vlanValue in Statistics Service.
+     * @param vlanValue current vlan value.
+     */
+    public void setVlanValue(VlanId vlanValue);
+}
diff --git a/api/src/main/java/org/opencord/cordmcast/package-info.java b/api/src/main/java/org/opencord/cordmcast/package-info.java
new file mode 100644
index 0000000..6d17b35
--- /dev/null
+++ b/api/src/main/java/org/opencord/cordmcast/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Foundation
+ *
+ * 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.
+ */
+
+/**
+ * Application for provisioning multicast streams in the context of cord.
+ */
+package org.opencord.cordmcast;
\ No newline at end of file