[Falcon] Refactored mcast store implementation.
Change-Id: Ie3fbc675d02c5abe5f5a419d2fc12dbe8fb4ec35
refactored mcast store implementation
Change-Id: I67d70d678813184c522c78e0771f6b8f8f9c25f8
diff --git a/core/api/src/main/java/org/onosproject/net/mcast/McastStore.java b/core/api/src/main/java/org/onosproject/net/mcast/McastStore.java
new file mode 100644
index 0000000..96b21f6
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/mcast/McastStore.java
@@ -0,0 +1,68 @@
+package org.onosproject.net.mcast;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.store.Store;
+
+import java.util.Set;
+
+/**
+ * Entity responsible for storing multicast state information.
+ */
+public interface McastStore extends Store<McastEvent, McastStoreDelegate> {
+
+ enum Type {
+ /**
+ * Adding a route to the mcast rib.
+ */
+ ADD,
+
+ /**
+ * Removing a route from the mcast rib.
+ */
+ REMOVE
+ }
+
+ /**
+ * Updates the store with the route information.
+ *
+ * @param route a multicast route
+ * @param operation an operation
+ */
+ void storeRoute(McastRoute route, Type operation);
+
+ /**
+ * Updates the store with source information for the given route. Only one
+ * source is permitted. Submitting another source will replace the previous
+ * value.
+ *
+ * @param route a multicast route
+ * @param source a source
+ */
+ void storeSource(McastRoute route, ConnectPoint source);
+
+ /**
+ * Updates the store with sink information for a given route. There may be
+ * multiple sinks.
+ *
+ * @param route a multicast route
+ * @param sink a sink
+ * @param operation an operation
+ */
+ void storeSink(McastRoute route, ConnectPoint sink, Type operation);
+
+ /**
+ * Obtain the source for a multicast route.
+ *
+ * @param route a multicast route
+ * @return a connect point
+ */
+ ConnectPoint sourceFor(McastRoute route);
+
+ /**
+ * Obtain the sinks for a multicast route.
+ *
+ * @param route a multicast route
+ * @return a set of sinks
+ */
+ Set<ConnectPoint> sinksFor(McastRoute route);
+}