Move LinkDiscovery package to ONOS namespace
- Due to the design of LinkDiscoveryManager, modification by ONOS could not be easily sliced out, thus moving the whole modified LinkDiscovery features to ONOS package namespace.
- move out TopoLinksResource to core/web to avoid mixing with FL originated code bases
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java b/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java
index dfdabd4..b56cfef 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/ILinkStorage.java
@@ -2,8 +2,8 @@
import java.util.List;
-import net.floodlightcontroller.linkdiscovery.LinkInfo;
import net.floodlightcontroller.routing.Link;
+import net.onrc.onos.ofcontroller.linkdiscovery.LinkInfo;
public interface ILinkStorage extends INetMapStorage {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
index ef625a8..839d3e7 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/LinkStorageImpl.java
@@ -3,11 +3,11 @@
import java.util.ArrayList;
import java.util.List;
-import net.floodlightcontroller.linkdiscovery.LinkInfo;
import net.floodlightcontroller.routing.Link;
import net.onrc.onos.ofcontroller.core.ILinkStorage;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.linkdiscovery.LinkInfo;
import net.onrc.onos.util.GraphDBConnection;
import net.onrc.onos.util.GraphDBOperation;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/web/TopoLinksResource.java b/src/main/java/net/onrc/onos/ofcontroller/core/web/TopoLinksResource.java
new file mode 100644
index 0000000..327c110
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/web/TopoLinksResource.java
@@ -0,0 +1,20 @@
+package net.onrc.onos.ofcontroller.core.web;
+
+import java.util.List;
+import net.floodlightcontroller.routing.Link;
+import net.onrc.onos.ofcontroller.core.internal.TopoLinkServiceImpl;
+
+import org.restlet.resource.Get;
+import org.restlet.resource.ServerResource;
+
+public class TopoLinksResource extends ServerResource {
+
+ @Get("json")
+ public List<Link> retrieve() {
+ TopoLinkServiceImpl impl = new TopoLinkServiceImpl();
+
+ List<Link> retval = impl.getActiveLinks();
+ return retval;
+ }
+
+}