Support multiple Links from a Port

- Support multiple Links from a Port (ONOS-1574,ONOS-1391)

Change-Id: I0b53a950d0ad1e37bbedb726fee2d35df4ff0d60
diff --git a/src/main/java/net/onrc/onos/core/topology/Port.java b/src/main/java/net/onrc/onos/core/topology/Port.java
index 0ca5cce..8613537 100644
--- a/src/main/java/net/onrc/onos/core/topology/Port.java
+++ b/src/main/java/net/onrc/onos/core/topology/Port.java
@@ -1,5 +1,7 @@
 package net.onrc.onos.core.topology;
 
+import java.util.Collection;
+
 import net.onrc.onos.core.topology.web.serializers.PortSerializer;
 import net.onrc.onos.core.util.Dpid;
 import net.onrc.onos.core.util.PortNumber;
@@ -66,6 +68,9 @@
 
     /**
      * Gets the outgoing link from this port.
+     * <p/>
+     * FIXME As a temporary workaround, it will look for type "packet" and
+     * returns it if found, else return whichever link is found first.
      *
      * @return {@link Link} if there exist a outgoing link from this,
      *         {@code null} otherwise.
@@ -73,13 +78,48 @@
     public Link getOutgoingLink();
 
     /**
+     * Gets the outgoing link from this port.
+     *
+     * @param type type of the link
+     * @return {@link Link} if there exist a outgoing link from this,
+     *         {@code null} otherwise.
+     */
+    public Link getOutgoingLink(String type);
+
+    /**
+     * Gets all the outgoing links from this port.
+     *
+     * @return Collection of {@link Link}s
+     */
+    public Collection<Link> getOutgoingLinks();
+
+    /**
      * Gets the incoming link to this port.
+     * <p/>
+     * FIXME As a temporary workaround, it will look for type "packet" and
+     * returns it if found, else return whichever link is found first.
      *
      * @return {@link Link} if there exist a incoming link to this, {@code null}
      *         otherwise.
      */
     public Link getIncomingLink();
 
+    /**
+     * Gets the incoming link to this port.
+     *
+     * @param type type of the link
+     * @return {@link Link} if there exist a incoming link to this, {@code null}
+     *         otherwise.
+     */
+    public Link getIncomingLink(String type);
+
+    /**
+     * Gets all the incoming links to this port.
+     *
+     * @return Collection of {@link Link}s
+     */
+    public Collection<Link> getIncomingLinks();
+
     // XXX Iterable or Collection?
     /**
      * Gets all the devices attached to this port.