Reference to Link should be held by Port object
Change-Id: Idda4d59d434c097482d947d9abcb2bb91844c06f
diff --git a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java
index 6e250bc..325718a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/networkgraph/SwitchImpl.java
@@ -3,13 +3,15 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
-import edu.stanford.ramcloud.JRamCloud.ObjectDoesntExistException;
-import edu.stanford.ramcloud.JRamCloud.WrongVersionException;
import net.onrc.onos.datastore.topology.RCPort;
import net.onrc.onos.datastore.topology.RCSwitch;
import net.onrc.onos.ofcontroller.util.FlowEntry;
+import edu.stanford.ramcloud.JRamCloud.ObjectDoesntExistException;
+import edu.stanford.ramcloud.JRamCloud.WrongVersionException;
/**
* Switch Object stored in In-memory Topology.
@@ -81,7 +83,11 @@
@Override
public Iterable<Link> getLinks() {
- return graph.getLinksFromSwitch(dpid);
+ Set<Link> links = new HashSet<>();
+ for( Port p : ports.values()) {
+ links.add(p.getLink());
+ }
+ return links;
}
public void store() {