Break the references between Port and Link.

This is in preparation for implementing topology versioning. Ports may have
different Links in different versions of the topology, so we don't want the
reference inside the Port object. References are now held in indexes in the
NetworkGraphImpl.

As a result of this, there was a small API change:
  NetworkGraph.getLink  ->  NetworkGraph.getOutgoingLink
  NetworkGraph.getIncomingLink was added.

Change-Id: I086d198c8040607253c8729b9d5f94ab6bc738db
diff --git a/src/main/java/net/onrc/onos/core/topology/PortImpl.java b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
index 32646d0..1f6946a 100644
--- a/src/main/java/net/onrc/onos/core/topology/PortImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
@@ -4,6 +4,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import net.onrc.onos.core.util.SwitchPort;
+
 /**
  * Port Object stored in In-memory Topology.
  * <p/>
@@ -17,8 +19,8 @@
     private Long number;
     private String description;
 
-    protected Link outgoingLink;
-    protected Link incomingLink;
+    private final SwitchPort switchPort;
+
     // These needs to be ConcurrentCollecton if allowing Graph to be accessed Concurrently
     protected Set<Device> devices;
 
@@ -27,6 +29,8 @@
         this.sw = parentSwitch;
         this.number = number;
         this.devices = new HashSet<>();
+
+        switchPort = new SwitchPort(parentSwitch.getDpid(), number.shortValue());
     }
 
     @Override
@@ -40,6 +44,11 @@
     }
 
     @Override
+    public SwitchPort asSwitchPort() {
+        return switchPort;
+    }
+
+    @Override
     public String getDescription() {
         return description;
     }
@@ -61,12 +70,14 @@
 
     @Override
     public Link getOutgoingLink() {
-        return outgoingLink;
+        return graph.getOutgoingLink(switchPort.dpid().value(),
+                (long) switchPort.port().value());
     }
 
     @Override
     public Link getIncomingLink() {
-        return incomingLink;
+        return graph.getIncomingLink(switchPort.dpid().value(),
+                (long) switchPort.port().value());
     }
 
     @Override
@@ -74,14 +85,6 @@
         return Collections.unmodifiableSet(this.devices);
     }
 
-    public void setOutgoingLink(Link link) {
-        outgoingLink = link;
-    }
-
-    public void setIncomingLink(Link link) {
-        incomingLink = link;
-    }
-
     /**
      * @param d
      * @return true if successfully added