support addition and removal of mcast sinks
vlan mcast rules are now optional

Change-Id: Icb7022089a6e139970040d8cdea97df0cdc8dc7c
diff --git a/src/main/java/org/onosproject/igmp/IgmpSnoop.java b/src/main/java/org/onosproject/igmp/IgmpSnoop.java
index 52760a6..2cec57b 100644
--- a/src/main/java/org/onosproject/igmp/IgmpSnoop.java
+++ b/src/main/java/org/onosproject/igmp/IgmpSnoop.java
@@ -246,7 +246,7 @@
                 .withMeta(DefaultTrafficTreatment.builder()
                                   .setOutput(PortNumber.CONTROLLER).build())
                 .fromApp(appId)
-                .withPriority(1000)
+                .withPriority(10000)
                 .add(new ObjectiveContext() {
                     @Override
                     public void onSuccess(Objective objective) {
@@ -417,6 +417,7 @@
     private class InternalDeviceListener implements DeviceListener {
         @Override
         public void event(DeviceEvent event) {
+            DeviceId devId = event.subject().id();
             switch (event.type()) {
 
                 case DEVICE_ADDED:
@@ -427,11 +428,15 @@
                 case PORT_STATS_UPDATED:
                     break;
                 case PORT_ADDED:
-                    if (event.port().isEnabled()) {
+                    if (!oltData.get(devId).uplink().equals(event.port().number()) &&
+                            event.port().isEnabled()) {
                         processFilterObjective(event.subject().id(), event.port(), false);
                     }
                     break;
                 case PORT_UPDATED:
+                    if (oltData.get(devId).uplink().equals(event.port().number())) {
+                        break;
+                    }
                     if (event.port().isEnabled()) {
                         processFilterObjective(event.subject().id(), event.port(), false);
                     } else {