initial impl of a multicast route table

Change-Id: Ic86a0665d1ade6b85b05e602ead2bd9c0a7dde07
diff --git a/core/api/src/main/java/org/onosproject/net/mcast/McastEvent.java b/core/api/src/main/java/org/onosproject/net/mcast/McastEvent.java
index 9cb93f2..979194c 100644
--- a/core/api/src/main/java/org/onosproject/net/mcast/McastEvent.java
+++ b/core/api/src/main/java/org/onosproject/net/mcast/McastEvent.java
@@ -21,6 +21,8 @@
 
 import java.util.Optional;
 
+import static com.google.common.base.MoreObjects.toStringHelper;
+
 /**
  * An entity representing a multicast event. Event either add or remove
  * sinks or sources.
@@ -48,11 +50,6 @@
         SOURCE_ADDED,
 
         /**
-         * A source for a mcast route (ie. the subject) has been removed.
-         */
-        SOURCE_REMOVED,
-
-        /**
          * A sink for a mcast route (ie. the subject) has been added.
          */
         SINK_ADDED,
@@ -75,15 +72,15 @@
         source = Optional.empty();
     }
 
-    protected McastEvent(McastEvent.Type type, McastRoute subject,
-                       ConnectPoint sink,
-                       ConnectPoint source) {
+    public McastEvent(McastEvent.Type type, McastRoute subject,
+                      ConnectPoint sink,
+                      ConnectPoint source) {
         super(type, subject);
         this.sink = Optional.ofNullable(sink);
         this.source = Optional.ofNullable(source);
     }
 
-    protected McastEvent(McastEvent.Type type, McastRoute subject, long time,
+    public McastEvent(McastEvent.Type type, McastRoute subject, long time,
                        ConnectPoint sink,
                        ConnectPoint source) {
         super(type, subject, time);
@@ -102,12 +99,20 @@
     }
 
     /**
-     * The source which has been removed or added. The field may not be set
-     * if the source has not been detected yet or has been removed.
+     * The source which has been removed or added.
 
      * @return an optional connect point
      */
     public Optional<ConnectPoint> source() {
         return source;
     }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("type", type())
+                .add("route", subject())
+                .add("source", source)
+                .add("sinks", sink).toString();
+    }
 }
diff --git a/core/api/src/main/java/org/onosproject/net/mcast/McastRoute.java b/core/api/src/main/java/org/onosproject/net/mcast/McastRoute.java
index 47ab12b..ff1292b 100644
--- a/core/api/src/main/java/org/onosproject/net/mcast/McastRoute.java
+++ b/core/api/src/main/java/org/onosproject/net/mcast/McastRoute.java
@@ -20,6 +20,7 @@
 import org.onlab.packet.IpPrefix;
 
 import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * An entity representing a multicast route consisting of a source
@@ -50,6 +51,9 @@
     private final Type type;
 
     public McastRoute(IpPrefix source, IpPrefix group, Type type) {
+        checkNotNull(source, "Multicast route must have a source");
+        checkNotNull(group, "Multicast route must specify a group address");
+        checkNotNull(type, "Must indicate what type of route");
         this.source = source;
         this.group = group;
         this.type = type;
diff --git a/core/api/src/main/java/org/onosproject/net/mcast/MulticastRouteTable.java b/core/api/src/main/java/org/onosproject/net/mcast/MulticastRouteService.java
similarity index 89%
rename from core/api/src/main/java/org/onosproject/net/mcast/MulticastRouteTable.java
rename to core/api/src/main/java/org/onosproject/net/mcast/MulticastRouteService.java
index a5e8d30..56e87c5 100644
--- a/core/api/src/main/java/org/onosproject/net/mcast/MulticastRouteTable.java
+++ b/core/api/src/main/java/org/onosproject/net/mcast/MulticastRouteService.java
@@ -24,7 +24,7 @@
  * A service interface for maintaining multicast information.
  */
 @Beta
-public interface MulticastRouteTable {
+public interface MulticastRouteService {
 
     /**
      * Adds a route to the information base.
@@ -59,14 +59,6 @@
     void addSink(McastRoute route, ConnectPoint connectPoint);
 
     /**
-     * Removes a source connection from the route.
-     *
-     * @param route the multicast route
-     * @param connectPoint a source connect point
-     */
-    void removeSource(McastRoute route, ConnectPoint connectPoint);
-
-    /**
      * Removes a sink from the route.
      *
      * @param route the multicast route
diff --git a/core/api/src/main/java/org/onosproject/net/mcast/package-info.java b/core/api/src/main/java/org/onosproject/net/mcast/package-info.java
new file mode 100644
index 0000000..e8dcc7b
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/mcast/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 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.
+ */
+
+/**
+ * External model entities of the multicast RIB.
+ */
+package org.onosproject.net.mcast;
\ No newline at end of file