Implemented global packet-out functionality in the PacketModule.

Updated with javadoc for the interfaces, and fixes to bugs pointed out by
Pavlin and Yuta regarding the implementation of calculateOutPorts in
BroadcastPacketOutNotification.

Change-Id: I6174d27877972cf437955ef8d82e9a02b36d0b5f
diff --git a/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
index cea27ae..3e098ed 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
@@ -1,7 +1,10 @@
 package net.onrc.onos.core.packetservice;
 
+import java.util.Map;
 
-// TODO This class is too generic to be handled by ProxyArpService.
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+
 // TODO The generic broadcast packet shouldn't contain an IP address which is
 // only for ARP packets.
 
@@ -70,4 +73,18 @@
     public int getTargetAddress() {
         return address;
     }
+
+    @Override
+    public Multimap<Long, Short> calculateOutPorts(Multimap<Long, Short> localSwitches) {
+        Multimap<Long, Short> outPorts = HashMultimap.create();
+
+        for (Map.Entry<Long, Short> entry : localSwitches.entries()) {
+            if (!entry.getKey().equals(inSwitch) ||
+                    !entry.getValue().equals(inPort)) {
+                outPorts.put(entry.getKey(), entry.getValue());
+            }
+        }
+
+        return outPorts;
+    }
 }